From 4465e13a7ef82a5519cf06295efb6f254cc8bb37 Mon Sep 17 00:00:00 2001 From: Senja Filipi Date: Tue, 5 Mar 2019 20:24:18 -0800 Subject: [PATCH 1/6] moving IHostEnvironment, IExceptionContext etc from MIcrosoft.ML to Microsoft.Ml.Runtime moving Loss related types from MIcrosoft.ML to Microsoft.Ml.Trainers --- src/Microsoft.ML.Core/ComponentModel/ComponentCatalog.cs | 3 +-- src/Microsoft.ML.Core/ComponentModel/ComponentFactory.cs | 2 +- src/Microsoft.ML.Core/Data/IFileHandle.cs | 2 +- src/Microsoft.ML.Core/Data/IHostEnvironment.cs | 2 +- src/Microsoft.ML.Core/Data/IProgressChannel.cs | 2 +- src/Microsoft.ML.Core/Environment/HostEnvironmentBase.cs | 2 +- src/Microsoft.ML.Core/Utilities/Contracts.cs | 2 +- src/Microsoft.ML.Data/Dirty/ILoss.cs | 2 +- src/Microsoft.ML.Data/Utils/LossFunctions.cs | 2 +- 9 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Microsoft.ML.Core/ComponentModel/ComponentCatalog.cs b/src/Microsoft.ML.Core/ComponentModel/ComponentCatalog.cs index 0c28b6c099..b8d282a5a3 100644 --- a/src/Microsoft.ML.Core/ComponentModel/ComponentCatalog.cs +++ b/src/Microsoft.ML.Core/ComponentModel/ComponentCatalog.cs @@ -11,8 +11,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -// REVIEW: Determine ideal namespace. -namespace Microsoft.ML +namespace Microsoft.ML.Runtime { /// /// This catalogs instantiatable components (aka, loadable classes). Components are registered via diff --git a/src/Microsoft.ML.Core/ComponentModel/ComponentFactory.cs b/src/Microsoft.ML.Core/ComponentModel/ComponentFactory.cs index 93ebdf6397..25165f62c9 100644 --- a/src/Microsoft.ML.Core/ComponentModel/ComponentFactory.cs +++ b/src/Microsoft.ML.Core/ComponentModel/ComponentFactory.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.ML +namespace Microsoft.ML.Runtime { /// /// This is a token interface that all component factories must implement. diff --git a/src/Microsoft.ML.Core/Data/IFileHandle.cs b/src/Microsoft.ML.Core/Data/IFileHandle.cs index b5b2ae8183..bdd05aa1ca 100644 --- a/src/Microsoft.ML.Core/Data/IFileHandle.cs +++ b/src/Microsoft.ML.Core/Data/IFileHandle.cs @@ -7,7 +7,7 @@ using System.IO; using Microsoft.ML.Internal.Utilities; -namespace Microsoft.ML +namespace Microsoft.ML.Data { /// /// A file handle. diff --git a/src/Microsoft.ML.Core/Data/IHostEnvironment.cs b/src/Microsoft.ML.Core/Data/IHostEnvironment.cs index 79a8129764..4667011855 100644 --- a/src/Microsoft.ML.Core/Data/IHostEnvironment.cs +++ b/src/Microsoft.ML.Core/Data/IHostEnvironment.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.ML +namespace Microsoft.ML.Runtime { /// /// A channel provider can create new channels and generic information pipes. diff --git a/src/Microsoft.ML.Core/Data/IProgressChannel.cs b/src/Microsoft.ML.Core/Data/IProgressChannel.cs index c379d19775..43c847943e 100644 --- a/src/Microsoft.ML.Core/Data/IProgressChannel.cs +++ b/src/Microsoft.ML.Core/Data/IProgressChannel.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; -namespace Microsoft.ML +namespace Microsoft.ML.Runtime { /// /// This is a factory interface for . diff --git a/src/Microsoft.ML.Core/Environment/HostEnvironmentBase.cs b/src/Microsoft.ML.Core/Environment/HostEnvironmentBase.cs index 37c34a353a..3b46334a9e 100644 --- a/src/Microsoft.ML.Core/Environment/HostEnvironmentBase.cs +++ b/src/Microsoft.ML.Core/Environment/HostEnvironmentBase.cs @@ -7,7 +7,7 @@ using System.Collections.Generic; using System.IO; -namespace Microsoft.ML.Data +namespace Microsoft.ML.Runtime { /// /// Base class for channel providers. This is a common base class for. diff --git a/src/Microsoft.ML.Core/Utilities/Contracts.cs b/src/Microsoft.ML.Core/Utilities/Contracts.cs index a987bcf190..9770197f58 100644 --- a/src/Microsoft.ML.Core/Utilities/Contracts.cs +++ b/src/Microsoft.ML.Core/Utilities/Contracts.cs @@ -17,7 +17,7 @@ #if CPUMATH_INFRASTRUCTURE namespace Microsoft.ML.Internal.CpuMath.Core #else -namespace Microsoft.ML +namespace Microsoft.ML.Runtime #endif { using Conditional = System.Diagnostics.ConditionalAttribute; diff --git a/src/Microsoft.ML.Data/Dirty/ILoss.cs b/src/Microsoft.ML.Data/Dirty/ILoss.cs index 6e35c17bea..8b79c442f6 100644 --- a/src/Microsoft.ML.Data/Dirty/ILoss.cs +++ b/src/Microsoft.ML.Data/Dirty/ILoss.cs @@ -5,7 +5,7 @@ using System; using Microsoft.ML.EntryPoints; -namespace Microsoft.ML +namespace Microsoft.ML.Trainers { public interface ILossFunction { diff --git a/src/Microsoft.ML.Data/Utils/LossFunctions.cs b/src/Microsoft.ML.Data/Utils/LossFunctions.cs index a48b05c1be..7d32856497 100644 --- a/src/Microsoft.ML.Data/Utils/LossFunctions.cs +++ b/src/Microsoft.ML.Data/Utils/LossFunctions.cs @@ -37,7 +37,7 @@ [assembly: EntryPointModule(typeof(SquaredLossFactory))] [assembly: EntryPointModule(typeof(TweedieLoss.Options))] -namespace Microsoft.ML +namespace Microsoft.ML.Trainers { /// /// The loss function may know the close-form solution to the optimal dual update From 3d369c8c65b3174993a4e148b2d311e323b5f862 Mon Sep 17 00:00:00 2001 From: Senja Filipi Date: Wed, 6 Mar 2019 10:35:48 -0800 Subject: [PATCH 2/6] partial namespace updates --- src/Microsoft.ML.Core/CommandLine/CmdParser.cs | 1 + .../ComponentModel/AssemblyLoadingUtils.cs | 2 +- src/Microsoft.ML.Core/Data/AnnotationUtils.cs | 1 + src/Microsoft.ML.Core/Data/ColumnTypeExtensions.cs | 1 + src/Microsoft.ML.Core/Data/IFileHandle.cs | 1 + src/Microsoft.ML.Core/Data/IHostEnvironment.cs | 1 + src/Microsoft.ML.Core/Data/ISchemaBindableMapper.cs | 1 + src/Microsoft.ML.Core/Data/KeyTypeExtensions.cs | 2 ++ src/Microsoft.ML.Core/Data/LinkedRootCursorBase.cs | 1 + .../Data/LinkedRowFilterCursorBase.cs | 1 + .../Data/LinkedRowRootCursorBase.cs | 1 + src/Microsoft.ML.Core/Data/ModelLoadContext.cs | 1 + src/Microsoft.ML.Core/Data/ModelLoading.cs | 1 + src/Microsoft.ML.Core/Data/ModelSaveContext.cs | 1 + src/Microsoft.ML.Core/Data/ProgressReporter.cs | 2 +- src/Microsoft.ML.Core/Data/Repository.cs | 1 + src/Microsoft.ML.Core/Data/RootCursorBase.cs | 1 + src/Microsoft.ML.Core/Data/ServerChannel.cs | 2 +- src/Microsoft.ML.Core/Data/SynchronizedCursorBase.cs | 1 + src/Microsoft.ML.Core/EntryPoints/EntryPointUtils.cs | 1 + src/Microsoft.ML.Core/EntryPoints/PredictorModel.cs | 1 + src/Microsoft.ML.Core/EntryPoints/TransformModel.cs | 1 + .../Environment/ConsoleEnvironment.cs | 2 +- .../Utilities/ResourceManagerUtils.cs | 1 + src/Microsoft.ML.Core/Utilities/ThreadUtils.cs | 1 + .../Commands/CrossValidationCommand.cs | 1 + src/Microsoft.ML.Data/Commands/DataCommand.cs | 1 + src/Microsoft.ML.Data/Commands/EvaluateCommand.cs | 1 + src/Microsoft.ML.Data/Commands/SaveDataCommand.cs | 1 + .../Commands/SavePredictorCommand.cs | 1 + src/Microsoft.ML.Data/Commands/ScoreCommand.cs | 1 + src/Microsoft.ML.Data/Commands/ShowSchemaCommand.cs | 1 + src/Microsoft.ML.Data/Commands/TestCommand.cs | 1 + src/Microsoft.ML.Data/Commands/TrainCommand.cs | 1 + src/Microsoft.ML.Data/Commands/TrainTestCommand.cs | 2 +- src/Microsoft.ML.Data/Commands/TypeInfoCommand.cs | 1 + src/Microsoft.ML.Data/Data/BufferBuilder.cs | 1 + src/Microsoft.ML.Data/Data/Combiner.cs | 1 + src/Microsoft.ML.Data/Data/Conversion.cs | 1 + src/Microsoft.ML.Data/Data/DataViewUtils.cs | 1 + src/Microsoft.ML.Data/Data/ILegacyDataLoader.cs | 2 +- src/Microsoft.ML.Data/Data/RowCursorUtils.cs | 1 + src/Microsoft.ML.Data/Data/SchemaDefinition.cs | 1 + src/Microsoft.ML.Data/Data/SlotCursor.cs | 1 + .../DataLoadSave/Binary/BinaryLoader.cs | 1 + .../DataLoadSave/Binary/BinaryLoaderSaverCatalog.cs | 1 + .../DataLoadSave/Binary/BinarySaver.cs | 1 + .../DataLoadSave/Binary/CodecFactory.cs | 1 + src/Microsoft.ML.Data/DataLoadSave/Binary/Codecs.cs | 1 + .../DataLoadSave/Binary/CompressionKind.cs | 1 + .../DataLoadSave/Binary/MemoryStreamPool.cs | 1 + .../DataLoadSave/CompositeDataLoader.cs | 2 +- .../DataLoadSave/CompositeLoaderEstimator.cs | 1 + .../DataLoadSave/DataOperationsCatalog.cs | 1 + src/Microsoft.ML.Data/DataLoadSave/EstimatorChain.cs | 1 + .../DataLoadSave/EstimatorExtensions.cs | 1 + .../DataLoadSave/LegacyCompositeDataLoader.cs | 2 +- .../DataLoadSave/MultiFileSource.cs | 1 + .../DataLoadSave/Text/BlockingQueue.cs | 1 + .../DataLoadSave/Text/TextLoader.cs | 2 +- .../DataLoadSave/Text/TextLoaderCursor.cs | 2 +- .../DataLoadSave/Text/TextLoaderParser.cs | 1 + .../DataLoadSave/Text/TextLoaderSaverCatalog.cs | 1 + src/Microsoft.ML.Data/DataLoadSave/Text/TextSaver.cs | 1 + .../DataLoadSave/TransformWrapper.cs | 2 +- .../DataLoadSave/TransformerChain.cs | 1 + .../DataLoadSave/Transpose/TransposeLoader.cs | 2 +- .../DataLoadSave/Transpose/TransposeSaver.cs | 1 + .../DataLoadSave/TrivialEstimator.cs | 1 + src/Microsoft.ML.Data/DataView/AppendRowsDataView.cs | 1 + .../DataView/ArrayDataViewBuilder.cs | 1 + src/Microsoft.ML.Data/DataView/CacheDataView.cs | 1 + .../DataView/CompositeRowToRowMapper.cs | 1 + .../DataView/DataViewConstructionUtils.cs | 1 + src/Microsoft.ML.Data/DataView/DataViewExtensions.cs | 1 + src/Microsoft.ML.Data/DataView/EmptyDataView.cs | 1 + .../DataView/InternalSchemaDefinition.cs | 1 + src/Microsoft.ML.Data/DataView/LambdaColumnMapper.cs | 2 +- src/Microsoft.ML.Data/DataView/LambdaFilter.cs | 2 +- .../DataView/RowToRowMapperTransform.cs | 1 + src/Microsoft.ML.Data/DataView/SimpleRow.cs | 3 +-- src/Microsoft.ML.Data/DataView/Transposer.cs | 1 + src/Microsoft.ML.Data/DataView/TypedCursor.cs | 1 + src/Microsoft.ML.Data/DataView/ZipBinding.cs | 1 + src/Microsoft.ML.Data/DataView/ZipDataView.cs | 1 + src/Microsoft.ML.Data/DebuggerExtensions.cs | 1 + .../Depricated/Instances/HeaderSchema.cs | 2 +- .../Depricated/Vector/GenericSpanSortHelper.cs | 1 + .../Depricated/Vector/VBufferMathUtils.cs | 1 + .../Depricated/Vector/VectorUtils.cs | 1 + .../Dirty/ChooseColumnsByIndexTransform.cs | 1 + src/Microsoft.ML.Data/Dirty/ILoss.cs | 1 + src/Microsoft.ML.Data/Dirty/IniFileUtils.cs | 1 + src/Microsoft.ML.Data/Dirty/ModelParametersBase.cs | 1 + src/Microsoft.ML.Data/Dirty/PredictionUtils.cs | 1 + src/Microsoft.ML.Data/Dirty/PredictorUtils.cs | 1 + src/Microsoft.ML.Data/EntryPoints/CommonOutputs.cs | 1 - src/Microsoft.ML.Data/EntryPoints/EntryPointNode.cs | 1 + src/Microsoft.ML.Data/EntryPoints/InputBase.cs | 1 + src/Microsoft.ML.Data/EntryPoints/InputBuilder.cs | 1 + .../EntryPoints/PredictorModelImpl.cs | 2 +- .../EntryPoints/SchemaManipulation.cs | 1 + src/Microsoft.ML.Data/EntryPoints/SelectRows.cs | 1 + .../EntryPoints/SummarizePredictor.cs | 1 + .../EntryPoints/TransformModelImpl.cs | 1 + .../Evaluators/AnomalyDetectionEvaluator.cs | 1 + src/Microsoft.ML.Data/Evaluators/AucAggregator.cs | 1 + .../Evaluators/BinaryClassifierEvaluator.cs | 1 + .../Evaluators/ClusteringEvaluator.cs | 1 + src/Microsoft.ML.Data/Evaluators/EvaluatorBase.cs | 1 + src/Microsoft.ML.Data/Evaluators/EvaluatorUtils.cs | 1 + src/Microsoft.ML.Data/Evaluators/MamlEvaluator.cs | 1 + .../Evaluators/Metrics/AnomalyDetectionMetrics.cs | 2 +- .../Metrics/BinaryClassificationMetrics.cs | 1 + .../Metrics/CalibratedBinaryClassificationMetrics.cs | 1 + .../Evaluators/Metrics/ClusteringMetrics.cs | 1 + .../Metrics/MultiClassClassifierMetrics.cs | 1 + .../Evaluators/Metrics/RankingMetrics.cs | 1 + .../Evaluators/Metrics/RegressionMetrics.cs | 1 + .../Evaluators/MultiClassClassifierEvaluator.cs | 1 + .../Evaluators/MultiOutputRegressionEvaluator.cs | 12 +++++++----- .../Evaluators/QuantileRegressionEvaluator.cs | 2 +- src/Microsoft.ML.Data/Evaluators/RankingEvaluator.cs | 2 +- .../Evaluators/RegressionEvaluator.cs | 2 ++ .../Evaluators/RegressionEvaluatorBase.cs | 2 ++ src/Microsoft.ML.Data/MLContext.cs | 1 + .../Model/ModelOperationsCatalog.cs | 1 + src/Microsoft.ML.Data/Model/Pfa/BoundPfaContext.cs | 1 + src/Microsoft.ML.Data/Model/Pfa/ModelUtils.cs | 1 + src/Microsoft.ML.Data/Model/Pfa/PfaContext.cs | 1 + src/Microsoft.ML.Data/Model/Pfa/PfaUtils.cs | 1 + src/Microsoft.ML.Data/Model/Pfa/SavePfaCommand.cs | 1 + .../Model/PredictionEngineExtensions.cs | 1 + src/Microsoft.ML.Data/Prediction/Calibrator.cs | 1 + .../Prediction/CalibratorCatalog.cs | 1 + src/Microsoft.ML.Data/Prediction/PredictionEngine.cs | 1 + .../Scorers/BinaryClassifierScorer.cs | 1 + src/Microsoft.ML.Data/Scorers/ClusteringScorer.cs | 2 +- .../Scorers/FeatureContributionCalculation.cs | 2 +- src/Microsoft.ML.Data/Scorers/GenericScorer.cs | 2 +- .../Scorers/MultiClassClassifierScorer.cs | 2 +- .../Scorers/PredictedLabelScorerBase.cs | 1 + .../Scorers/PredictionTransformer.cs | 2 +- .../Scorers/QuantileRegressionScorer.cs | 1 + src/Microsoft.ML.Data/Scorers/RowToRowScorerBase.cs | 1 + .../Scorers/SchemaBindablePredictorWrapper.cs | 2 +- src/Microsoft.ML.Data/Scorers/ScoreSchemaFactory.cs | 3 +-- src/Microsoft.ML.Data/TrainCatalog.cs | 1 + .../Training/TrainerEstimatorBase.cs | 1 + src/Microsoft.ML.Data/Training/TrainerInputBase.cs | 5 +---- src/Microsoft.ML.Data/Training/TrainerUtils.cs | 2 +- .../Transforms/BindingsWrappedRowCursor.cs | 1 + .../Transforms/BootstrapSamplingTransformer.cs | 2 +- src/Microsoft.ML.Data/Transforms/CatalogUtils.cs | 1 + .../Transforms/ColumnBindingsBase.cs | 1 + .../Transforms/ColumnConcatenatingEstimator.cs | 1 + .../Transforms/ColumnConcatenatingTransformer.cs | 1 + src/Microsoft.ML.Data/Transforms/ColumnCopying.cs | 1 + src/Microsoft.ML.Data/Transforms/ColumnSelecting.cs | 2 ++ .../FeatureContributionCalculationTransformer.cs | 1 + .../Transforms/GenerateNumberTransform.cs | 2 +- src/Microsoft.ML.Data/Transforms/Hashing.cs | 1 + src/Microsoft.ML.Data/Transforms/InvertHashUtils.cs | 1 + src/Microsoft.ML.Data/Transforms/KeyToValue.cs | 2 +- src/Microsoft.ML.Data/Transforms/KeyToVector.cs | 1 + .../Transforms/LabelConvertTransform.cs | 1 + .../Transforms/LabelIndicatorTransform.cs | 2 +- .../Transforms/MetadataDispatcher.cs | 1 + src/Microsoft.ML.Data/Transforms/NAFilter.cs | 2 +- src/Microsoft.ML.Data/Transforms/NopTransform.cs | 2 +- src/Microsoft.ML.Data/Transforms/NormalizeColumn.cs | 1 + .../Transforms/NormalizeColumnDbl.cs | 1 + .../Transforms/NormalizeColumnSng.cs | 1 + src/Microsoft.ML.Data/Transforms/NormalizeUtils.cs | 1 + src/Microsoft.ML.Data/Transforms/Normalizer.cs | 1 + .../Transforms/OneToOneTransformerBase.cs | 1 + src/Microsoft.ML.Data/Transforms/RangeFilter.cs | 2 +- .../Transforms/RowShufflingTransformer.cs | 2 +- .../Transforms/RowToRowTransformerBase.cs | 1 + src/Microsoft.ML.Data/Transforms/SkipTakeFilter.cs | 3 +-- .../Transforms/SlotsDroppingTransformer.cs | 1 + src/Microsoft.ML.Data/Transforms/TransformBase.cs | 1 + .../Utilities/ApplyTransformUtils.cs | 2 +- src/Microsoft.ML.Data/Utilities/ColumnCursor.cs | 2 +- src/Microsoft.ML.Data/Utilities/ComponentCreation.cs | 1 + src/Microsoft.ML.Data/Utilities/LocalEnvironment.cs | 1 + src/Microsoft.ML.Data/Utilities/ModelFileUtils.cs | 1 + src/Microsoft.ML.Data/Utilities/SlotDropper.cs | 1 + src/Microsoft.ML.Data/Utilities/TimerScope.cs | 1 + src/Microsoft.ML.Data/Utilities/TypeParsingUtils.cs | 1 + src/Microsoft.ML.Data/Utils/ApiUtils.cs | 1 + src/Microsoft.ML.Data/Utils/LossFunctions.cs | 2 ++ src/Microsoft.ML.Data/Utils/SequencePool.cs | 1 + src/Microsoft.ML.FastTree/Training/StepSearch.cs | 1 + src/Microsoft.ML.Transforms/MetricStatistics.cs | 1 + 195 files changed, 205 insertions(+), 52 deletions(-) diff --git a/src/Microsoft.ML.Core/CommandLine/CmdParser.cs b/src/Microsoft.ML.Core/CommandLine/CmdParser.cs index 3a7dfce5b1..b5882ae187 100644 --- a/src/Microsoft.ML.Core/CommandLine/CmdParser.cs +++ b/src/Microsoft.ML.Core/CommandLine/CmdParser.cs @@ -11,6 +11,7 @@ using System.Reflection; using System.Text; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.CommandLine { diff --git a/src/Microsoft.ML.Core/ComponentModel/AssemblyLoadingUtils.cs b/src/Microsoft.ML.Core/ComponentModel/AssemblyLoadingUtils.cs index a194088d3b..0974646878 100644 --- a/src/Microsoft.ML.Core/ComponentModel/AssemblyLoadingUtils.cs +++ b/src/Microsoft.ML.Core/ComponentModel/AssemblyLoadingUtils.cs @@ -8,7 +8,7 @@ using System.Reflection; using Microsoft.ML.Internal.Utilities; -namespace Microsoft.ML +namespace Microsoft.ML.Runtime { [Obsolete("The usage for this is intended for the internal command line utilities and is not intended for anything related to the API. " + "Please consider another way of doing whatever it is you're attempting to accomplish.")] diff --git a/src/Microsoft.ML.Core/Data/AnnotationUtils.cs b/src/Microsoft.ML.Core/Data/AnnotationUtils.cs index 9b93bc64dc..0bd0ad4dda 100644 --- a/src/Microsoft.ML.Core/Data/AnnotationUtils.cs +++ b/src/Microsoft.ML.Core/Data/AnnotationUtils.cs @@ -8,6 +8,7 @@ using System.Threading; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Core/Data/ColumnTypeExtensions.cs b/src/Microsoft.ML.Core/Data/ColumnTypeExtensions.cs index 67e6434d82..838f58a384 100644 --- a/src/Microsoft.ML.Core/Data/ColumnTypeExtensions.cs +++ b/src/Microsoft.ML.Core/Data/ColumnTypeExtensions.cs @@ -4,6 +4,7 @@ using System; using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Core/Data/IFileHandle.cs b/src/Microsoft.ML.Core/Data/IFileHandle.cs index bdd05aa1ca..1a014ff924 100644 --- a/src/Microsoft.ML.Core/Data/IFileHandle.cs +++ b/src/Microsoft.ML.Core/Data/IFileHandle.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.IO; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Core/Data/IHostEnvironment.cs b/src/Microsoft.ML.Core/Data/IHostEnvironment.cs index 4667011855..f81a1aa293 100644 --- a/src/Microsoft.ML.Core/Data/IHostEnvironment.cs +++ b/src/Microsoft.ML.Core/Data/IHostEnvironment.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using Microsoft.ML.Data; namespace Microsoft.ML.Runtime { diff --git a/src/Microsoft.ML.Core/Data/ISchemaBindableMapper.cs b/src/Microsoft.ML.Core/Data/ISchemaBindableMapper.cs index 4f98287774..f4d8b30af7 100644 --- a/src/Microsoft.ML.Core/Data/ISchemaBindableMapper.cs +++ b/src/Microsoft.ML.Core/Data/ISchemaBindableMapper.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Core/Data/KeyTypeExtensions.cs b/src/Microsoft.ML.Core/Data/KeyTypeExtensions.cs index e88f23c382..016bf70ef4 100644 --- a/src/Microsoft.ML.Core/Data/KeyTypeExtensions.cs +++ b/src/Microsoft.ML.Core/Data/KeyTypeExtensions.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using Microsoft.ML.Runtime; + namespace Microsoft.ML.Data { /// diff --git a/src/Microsoft.ML.Core/Data/LinkedRootCursorBase.cs b/src/Microsoft.ML.Core/Data/LinkedRootCursorBase.cs index fb065628ca..4ca7b69de0 100644 --- a/src/Microsoft.ML.Core/Data/LinkedRootCursorBase.cs +++ b/src/Microsoft.ML.Core/Data/LinkedRootCursorBase.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Core/Data/LinkedRowFilterCursorBase.cs b/src/Microsoft.ML.Core/Data/LinkedRowFilterCursorBase.cs index 673eec3f23..e1a6d56175 100644 --- a/src/Microsoft.ML.Core/Data/LinkedRowFilterCursorBase.cs +++ b/src/Microsoft.ML.Core/Data/LinkedRowFilterCursorBase.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Core/Data/LinkedRowRootCursorBase.cs b/src/Microsoft.ML.Core/Data/LinkedRowRootCursorBase.cs index 5dce5621c3..5cc9fd555b 100644 --- a/src/Microsoft.ML.Core/Data/LinkedRowRootCursorBase.cs +++ b/src/Microsoft.ML.Core/Data/LinkedRowRootCursorBase.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Core/Data/ModelLoadContext.cs b/src/Microsoft.ML.Core/Data/ModelLoadContext.cs index ff0d9addd2..91f2e77c42 100644 --- a/src/Microsoft.ML.Core/Data/ModelLoadContext.cs +++ b/src/Microsoft.ML.Core/Data/ModelLoadContext.cs @@ -6,6 +6,7 @@ using System.IO; using System.Text; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Core/Data/ModelLoading.cs b/src/Microsoft.ML.Core/Data/ModelLoading.cs index 6186c04da5..0302598bf6 100644 --- a/src/Microsoft.ML.Core/Data/ModelLoading.cs +++ b/src/Microsoft.ML.Core/Data/ModelLoading.cs @@ -7,6 +7,7 @@ using System.Reflection; using System.Text; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Core/Data/ModelSaveContext.cs b/src/Microsoft.ML.Core/Data/ModelSaveContext.cs index efc3c94fa7..7c8f2cf891 100644 --- a/src/Microsoft.ML.Core/Data/ModelSaveContext.cs +++ b/src/Microsoft.ML.Core/Data/ModelSaveContext.cs @@ -6,6 +6,7 @@ using System.IO; using System.Text; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Core/Data/ProgressReporter.cs b/src/Microsoft.ML.Core/Data/ProgressReporter.cs index f890b7e97f..d5be2a4197 100644 --- a/src/Microsoft.ML.Core/Data/ProgressReporter.cs +++ b/src/Microsoft.ML.Core/Data/ProgressReporter.cs @@ -9,7 +9,7 @@ using System.Threading; using Microsoft.ML.Internal.Utilities; -namespace Microsoft.ML.Data +namespace Microsoft.ML.Runtime { /// /// The progress reporting classes used by descendants. diff --git a/src/Microsoft.ML.Core/Data/Repository.cs b/src/Microsoft.ML.Core/Data/Repository.cs index a53314fc83..ab4117c8f6 100644 --- a/src/Microsoft.ML.Core/Data/Repository.cs +++ b/src/Microsoft.ML.Core/Data/Repository.cs @@ -7,6 +7,7 @@ using System.IO; using System.IO.Compression; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Core/Data/RootCursorBase.cs b/src/Microsoft.ML.Core/Data/RootCursorBase.cs index 054389e749..643fa8f607 100644 --- a/src/Microsoft.ML.Core/Data/RootCursorBase.cs +++ b/src/Microsoft.ML.Core/Data/RootCursorBase.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Core/Data/ServerChannel.cs b/src/Microsoft.ML.Core/Data/ServerChannel.cs index c85be7eb82..5165febd75 100644 --- a/src/Microsoft.ML.Core/Data/ServerChannel.cs +++ b/src/Microsoft.ML.Core/Data/ServerChannel.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using Microsoft.ML.EntryPoints; -namespace Microsoft.ML +namespace Microsoft.ML.Runtime { /// /// Instances of this class are used to set up a bundle of named delegates. These diff --git a/src/Microsoft.ML.Core/Data/SynchronizedCursorBase.cs b/src/Microsoft.ML.Core/Data/SynchronizedCursorBase.cs index 4915791606..0cabaf59a2 100644 --- a/src/Microsoft.ML.Core/Data/SynchronizedCursorBase.cs +++ b/src/Microsoft.ML.Core/Data/SynchronizedCursorBase.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Core/EntryPoints/EntryPointUtils.cs b/src/Microsoft.ML.Core/EntryPoints/EntryPointUtils.cs index e184a98d14..a2954280c6 100644 --- a/src/Microsoft.ML.Core/EntryPoints/EntryPointUtils.cs +++ b/src/Microsoft.ML.Core/EntryPoints/EntryPointUtils.cs @@ -8,6 +8,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.CommandLine; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.EntryPoints { diff --git a/src/Microsoft.ML.Core/EntryPoints/PredictorModel.cs b/src/Microsoft.ML.Core/EntryPoints/PredictorModel.cs index db337b9d65..585fb23a0e 100644 --- a/src/Microsoft.ML.Core/EntryPoints/PredictorModel.cs +++ b/src/Microsoft.ML.Core/EntryPoints/PredictorModel.cs @@ -5,6 +5,7 @@ using System.IO; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.EntryPoints { diff --git a/src/Microsoft.ML.Core/EntryPoints/TransformModel.cs b/src/Microsoft.ML.Core/EntryPoints/TransformModel.cs index 75d6127393..dac2f9b1b5 100644 --- a/src/Microsoft.ML.Core/EntryPoints/TransformModel.cs +++ b/src/Microsoft.ML.Core/EntryPoints/TransformModel.cs @@ -5,6 +5,7 @@ using System.IO; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.EntryPoints { diff --git a/src/Microsoft.ML.Core/Environment/ConsoleEnvironment.cs b/src/Microsoft.ML.Core/Environment/ConsoleEnvironment.cs index 673f0159e3..011efea28f 100644 --- a/src/Microsoft.ML.Core/Environment/ConsoleEnvironment.cs +++ b/src/Microsoft.ML.Core/Environment/ConsoleEnvironment.cs @@ -7,7 +7,7 @@ using System.Linq; using System.Threading; -namespace Microsoft.ML.Data +namespace Microsoft.ML.Runtime { using Stopwatch = System.Diagnostics.Stopwatch; diff --git a/src/Microsoft.ML.Core/Utilities/ResourceManagerUtils.cs b/src/Microsoft.ML.Core/Utilities/ResourceManagerUtils.cs index a83f60c9ee..c43f0828d1 100644 --- a/src/Microsoft.ML.Core/Utilities/ResourceManagerUtils.cs +++ b/src/Microsoft.ML.Core/Utilities/ResourceManagerUtils.cs @@ -9,6 +9,7 @@ using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Core/Utilities/ThreadUtils.cs b/src/Microsoft.ML.Core/Utilities/ThreadUtils.cs index 78423d9e29..9e08475d40 100644 --- a/src/Microsoft.ML.Core/Utilities/ThreadUtils.cs +++ b/src/Microsoft.ML.Core/Utilities/ThreadUtils.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Data/Commands/CrossValidationCommand.cs b/src/Microsoft.ML.Data/Commands/CrossValidationCommand.cs index 64190db69c..0c2c36f3f2 100644 --- a/src/Microsoft.ML.Data/Commands/CrossValidationCommand.cs +++ b/src/Microsoft.ML.Data/Commands/CrossValidationCommand.cs @@ -15,6 +15,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Transforms; +using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(CrossValidationCommand), typeof(CrossValidationCommand.Arguments), typeof(SignatureCommand), "Cross Validation", CrossValidationCommand.LoadName)] diff --git a/src/Microsoft.ML.Data/Commands/DataCommand.cs b/src/Microsoft.ML.Data/Commands/DataCommand.cs index e48692685f..691286bfc7 100644 --- a/src/Microsoft.ML.Data/Commands/DataCommand.cs +++ b/src/Microsoft.ML.Data/Commands/DataCommand.cs @@ -12,6 +12,7 @@ using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Commands/EvaluateCommand.cs b/src/Microsoft.ML.Data/Commands/EvaluateCommand.cs index 0923c1f85b..102d9272f0 100644 --- a/src/Microsoft.ML.Data/Commands/EvaluateCommand.cs +++ b/src/Microsoft.ML.Data/Commands/EvaluateCommand.cs @@ -11,6 +11,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; [assembly: LoadableClass(EvaluateTransform.Summary, typeof(IDataTransform), typeof(EvaluateTransform), typeof(EvaluateTransform.Arguments), typeof(SignatureDataTransform), "Evaluate Predictor", "Evaluate")] diff --git a/src/Microsoft.ML.Data/Commands/SaveDataCommand.cs b/src/Microsoft.ML.Data/Commands/SaveDataCommand.cs index e55dcad632..e702c0ffd2 100644 --- a/src/Microsoft.ML.Data/Commands/SaveDataCommand.cs +++ b/src/Microsoft.ML.Data/Commands/SaveDataCommand.cs @@ -13,6 +13,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(SaveDataCommand.Summary, typeof(SaveDataCommand), typeof(SaveDataCommand.Arguments), typeof(SignatureCommand), diff --git a/src/Microsoft.ML.Data/Commands/SavePredictorCommand.cs b/src/Microsoft.ML.Data/Commands/SavePredictorCommand.cs index 86ace0e0a0..82c25a2f7f 100644 --- a/src/Microsoft.ML.Data/Commands/SavePredictorCommand.cs +++ b/src/Microsoft.ML.Data/Commands/SavePredictorCommand.cs @@ -12,6 +12,7 @@ using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Tools; [assembly: LoadableClass(SavePredictorCommand.Summary, typeof(SavePredictorCommand), typeof(SavePredictorCommand.Arguments), typeof(SignatureCommand), diff --git a/src/Microsoft.ML.Data/Commands/ScoreCommand.cs b/src/Microsoft.ML.Data/Commands/ScoreCommand.cs index 3d65f09234..c7c04f1bf1 100644 --- a/src/Microsoft.ML.Data/Commands/ScoreCommand.cs +++ b/src/Microsoft.ML.Data/Commands/ScoreCommand.cs @@ -12,6 +12,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; [assembly: LoadableClass(ScoreCommand.Summary, typeof(ScoreCommand), typeof(ScoreCommand.Arguments), typeof(SignatureCommand), "Score Predictor", "Score")] diff --git a/src/Microsoft.ML.Data/Commands/ShowSchemaCommand.cs b/src/Microsoft.ML.Data/Commands/ShowSchemaCommand.cs index 52aff4aa37..699c27082b 100644 --- a/src/Microsoft.ML.Data/Commands/ShowSchemaCommand.cs +++ b/src/Microsoft.ML.Data/Commands/ShowSchemaCommand.cs @@ -16,6 +16,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.Conversion; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; [assembly: LoadableClass(ShowSchemaCommand.Summary, typeof(ShowSchemaCommand), typeof(ShowSchemaCommand.Arguments), typeof(SignatureCommand), "Show Schema", ShowSchemaCommand.LoadName, "schema")] diff --git a/src/Microsoft.ML.Data/Commands/TestCommand.cs b/src/Microsoft.ML.Data/Commands/TestCommand.cs index ac6a3d6731..fb285e30b1 100644 --- a/src/Microsoft.ML.Data/Commands/TestCommand.cs +++ b/src/Microsoft.ML.Data/Commands/TestCommand.cs @@ -9,6 +9,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; [assembly: LoadableClass(TestCommand.Summary, typeof(TestCommand), typeof(TestCommand.Arguments), typeof(SignatureCommand), "Test Predictor", "Test")] diff --git a/src/Microsoft.ML.Data/Commands/TrainCommand.cs b/src/Microsoft.ML.Data/Commands/TrainCommand.cs index 129629cc19..4e979a6a11 100644 --- a/src/Microsoft.ML.Data/Commands/TrainCommand.cs +++ b/src/Microsoft.ML.Data/Commands/TrainCommand.cs @@ -15,6 +15,7 @@ using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(TrainCommand.Summary, typeof(TrainCommand), typeof(TrainCommand.Arguments), typeof(SignatureCommand), diff --git a/src/Microsoft.ML.Data/Commands/TrainTestCommand.cs b/src/Microsoft.ML.Data/Commands/TrainTestCommand.cs index 04da159ec5..56881a9315 100644 --- a/src/Microsoft.ML.Data/Commands/TrainTestCommand.cs +++ b/src/Microsoft.ML.Data/Commands/TrainTestCommand.cs @@ -11,7 +11,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; [assembly: LoadableClass(TrainTestCommand.Summary, typeof(TrainTestCommand), typeof(TrainTestCommand.Arguments), typeof(SignatureCommand), "Train Test", TrainTestCommand.LoadName)] diff --git a/src/Microsoft.ML.Data/Commands/TypeInfoCommand.cs b/src/Microsoft.ML.Data/Commands/TypeInfoCommand.cs index 5c22104cce..a75830357a 100644 --- a/src/Microsoft.ML.Data/Commands/TypeInfoCommand.cs +++ b/src/Microsoft.ML.Data/Commands/TypeInfoCommand.cs @@ -11,6 +11,7 @@ using Microsoft.ML.Data.Commands; using Microsoft.ML.Data.Conversion; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(TypeInfoCommand), typeof(TypeInfoCommand.Arguments), typeof(SignatureCommand), "", TypeInfoCommand.LoadName)] diff --git a/src/Microsoft.ML.Data/Data/BufferBuilder.cs b/src/Microsoft.ML.Data/Data/BufferBuilder.cs index d29a09f65d..003e8aa6ad 100644 --- a/src/Microsoft.ML.Data/Data/BufferBuilder.cs +++ b/src/Microsoft.ML.Data/Data/BufferBuilder.cs @@ -4,6 +4,7 @@ using System; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Data/Combiner.cs b/src/Microsoft.ML.Data/Data/Combiner.cs index 4824409a6c..0523b45357 100644 --- a/src/Microsoft.ML.Data/Data/Combiner.cs +++ b/src/Microsoft.ML.Data/Data/Combiner.cs @@ -4,6 +4,7 @@ using System; using System.Threading; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Data/Conversion.cs b/src/Microsoft.ML.Data/Data/Conversion.cs index c8c847214f..d047472ad1 100644 --- a/src/Microsoft.ML.Data/Data/Conversion.cs +++ b/src/Microsoft.ML.Data/Data/Conversion.cs @@ -11,6 +11,7 @@ using System.Threading; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data.Conversion { diff --git a/src/Microsoft.ML.Data/Data/DataViewUtils.cs b/src/Microsoft.ML.Data/Data/DataViewUtils.cs index 2fe3090ebc..efffb6428d 100644 --- a/src/Microsoft.ML.Data/Data/DataViewUtils.cs +++ b/src/Microsoft.ML.Data/Data/DataViewUtils.cs @@ -13,6 +13,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data.Conversion; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Data/ILegacyDataLoader.cs b/src/Microsoft.ML.Data/Data/ILegacyDataLoader.cs index e78468bbce..537708491c 100644 --- a/src/Microsoft.ML.Data/Data/ILegacyDataLoader.cs +++ b/src/Microsoft.ML.Data/Data/ILegacyDataLoader.cs @@ -4,7 +4,7 @@ using System.IO; using Microsoft.Data.DataView; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Data/RowCursorUtils.cs b/src/Microsoft.ML.Data/Data/RowCursorUtils.cs index cacd0d223c..72a8465c97 100644 --- a/src/Microsoft.ML.Data/Data/RowCursorUtils.cs +++ b/src/Microsoft.ML.Data/Data/RowCursorUtils.cs @@ -10,6 +10,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data.Conversion; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Data/SchemaDefinition.cs b/src/Microsoft.ML.Data/Data/SchemaDefinition.cs index a93b480d8b..7427eb10b1 100644 --- a/src/Microsoft.ML.Data/Data/SchemaDefinition.cs +++ b/src/Microsoft.ML.Data/Data/SchemaDefinition.cs @@ -8,6 +8,7 @@ using System.Reflection; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Data/SlotCursor.cs b/src/Microsoft.ML.Data/Data/SlotCursor.cs index 47754a44a5..f72fabb1b0 100644 --- a/src/Microsoft.ML.Data/Data/SlotCursor.cs +++ b/src/Microsoft.ML.Data/Data/SlotCursor.cs @@ -4,6 +4,7 @@ using System; using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataLoadSave/Binary/BinaryLoader.cs b/src/Microsoft.ML.Data/DataLoadSave/Binary/BinaryLoader.cs index a6d251e8c9..066e21ec3c 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/Binary/BinaryLoader.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/Binary/BinaryLoader.cs @@ -20,6 +20,7 @@ using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(BinaryLoader.Summary, typeof(BinaryLoader), typeof(BinaryLoader.Arguments), typeof(SignatureDataLoader), diff --git a/src/Microsoft.ML.Data/DataLoadSave/Binary/BinaryLoaderSaverCatalog.cs b/src/Microsoft.ML.Data/DataLoadSave/Binary/BinaryLoaderSaverCatalog.cs index 85806421a6..003e71fac0 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/Binary/BinaryLoaderSaverCatalog.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/Binary/BinaryLoaderSaverCatalog.cs @@ -6,6 +6,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.Data.IO; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Data/DataLoadSave/Binary/BinarySaver.cs b/src/Microsoft.ML.Data/DataLoadSave/Binary/BinarySaver.cs index 347f6bc86d..4aeae6ea37 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/Binary/BinarySaver.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/Binary/BinarySaver.cs @@ -17,6 +17,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; [assembly: LoadableClass(BinarySaver.Summary, typeof(BinarySaver), typeof(BinarySaver.Arguments), typeof(SignatureDataSaver), "Binary Saver", "BinarySaver", "Binary")] diff --git a/src/Microsoft.ML.Data/DataLoadSave/Binary/CodecFactory.cs b/src/Microsoft.ML.Data/DataLoadSave/Binary/CodecFactory.cs index f46ca14c80..c177ecde58 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/Binary/CodecFactory.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/Binary/CodecFactory.cs @@ -8,6 +8,7 @@ using System.Text; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data.IO { diff --git a/src/Microsoft.ML.Data/DataLoadSave/Binary/Codecs.cs b/src/Microsoft.ML.Data/DataLoadSave/Binary/Codecs.cs index 150b62caab..ad9d53c8a3 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/Binary/Codecs.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/Binary/Codecs.cs @@ -10,6 +10,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data.IO { diff --git a/src/Microsoft.ML.Data/DataLoadSave/Binary/CompressionKind.cs b/src/Microsoft.ML.Data/DataLoadSave/Binary/CompressionKind.cs index fbfd5bef1f..d15fbab15e 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/Binary/CompressionKind.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/Binary/CompressionKind.cs @@ -5,6 +5,7 @@ using System.IO; using System.IO.Compression; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data.IO { diff --git a/src/Microsoft.ML.Data/DataLoadSave/Binary/MemoryStreamPool.cs b/src/Microsoft.ML.Data/DataLoadSave/Binary/MemoryStreamPool.cs index 5fbb5c1318..cb5034c7af 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/Binary/MemoryStreamPool.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/Binary/MemoryStreamPool.cs @@ -6,6 +6,7 @@ using System.IO; using System.Threading; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data.IO { diff --git a/src/Microsoft.ML.Data/DataLoadSave/CompositeDataLoader.cs b/src/Microsoft.ML.Data/DataLoadSave/CompositeDataLoader.cs index 04d6faf750..04b60eef0b 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/CompositeDataLoader.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/CompositeDataLoader.cs @@ -4,7 +4,7 @@ using System.IO; using Microsoft.Data.DataView; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataLoadSave/CompositeLoaderEstimator.cs b/src/Microsoft.ML.Data/DataLoadSave/CompositeLoaderEstimator.cs index 978b5d6fe5..babb02172b 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/CompositeLoaderEstimator.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/CompositeLoaderEstimator.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataLoadSave/DataOperationsCatalog.cs b/src/Microsoft.ML.Data/DataLoadSave/DataOperationsCatalog.cs index 5692260bab..d40ed37a99 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/DataOperationsCatalog.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/DataOperationsCatalog.cs @@ -6,6 +6,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML diff --git a/src/Microsoft.ML.Data/DataLoadSave/EstimatorChain.cs b/src/Microsoft.ML.Data/DataLoadSave/EstimatorChain.cs index a6ce5bdb36..184b69dbe2 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/EstimatorChain.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/EstimatorChain.cs @@ -5,6 +5,7 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataLoadSave/EstimatorExtensions.cs b/src/Microsoft.ML.Data/DataLoadSave/EstimatorExtensions.cs index 0236d6a99a..316753bb26 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/EstimatorExtensions.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/EstimatorExtensions.cs @@ -6,6 +6,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Data/DataLoadSave/LegacyCompositeDataLoader.cs b/src/Microsoft.ML.Data/DataLoadSave/LegacyCompositeDataLoader.cs index f3a0c4426d..6d5ffae791 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/LegacyCompositeDataLoader.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/LegacyCompositeDataLoader.cs @@ -11,7 +11,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(ILegacyDataLoader), typeof(LegacyCompositeDataLoader), typeof(LegacyCompositeDataLoader.Arguments), typeof(SignatureDataLoader), "Composite Data Loader", "CompositeDataLoader", "Composite", "PipeData", "Pipe", "PipeDataLoader")] diff --git a/src/Microsoft.ML.Data/DataLoadSave/MultiFileSource.cs b/src/Microsoft.ML.Data/DataLoadSave/MultiFileSource.cs index 616587d558..6dd5405486 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/MultiFileSource.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/MultiFileSource.cs @@ -5,6 +5,7 @@ using System; using System.IO; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataLoadSave/Text/BlockingQueue.cs b/src/Microsoft.ML.Data/DataLoadSave/Text/BlockingQueue.cs index 511702a9ee..df67285d40 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/Text/BlockingQueue.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/Text/BlockingQueue.cs @@ -6,6 +6,7 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.Threading; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoader.cs b/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoader.cs index be48c2659c..fa20833639 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoader.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoader.cs @@ -12,7 +12,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; [assembly: LoadableClass(TextLoader.Summary, typeof(ILegacyDataLoader), typeof(TextLoader), typeof(TextLoader.Options), typeof(SignatureDataLoader), "Text Loader", "TextLoader", "Text", DocName = "loader/TextLoader.md")] diff --git a/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoaderCursor.cs b/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoaderCursor.cs index 709c65597e..b0f6428916 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoaderCursor.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoaderCursor.cs @@ -3,13 +3,13 @@ // See the LICENSE file in the project root for more information. using System; -using System.Collections.Concurrent; using System.Collections.Generic; using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoaderParser.cs b/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoaderParser.cs index 205a89bd6e..87e59f332d 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoaderParser.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoaderParser.cs @@ -12,6 +12,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data.Conversion; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoaderSaverCatalog.cs b/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoaderSaverCatalog.cs index e4c33f1df5..358350bc67 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoaderSaverCatalog.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoaderSaverCatalog.cs @@ -6,6 +6,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.Data.IO; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Data/DataLoadSave/Text/TextSaver.cs b/src/Microsoft.ML.Data/DataLoadSave/Text/TextSaver.cs index 01539963aa..63b29301ea 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/Text/TextSaver.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/Text/TextSaver.cs @@ -13,6 +13,7 @@ using Microsoft.ML.Data.Conversion; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; [assembly: LoadableClass(TextSaver.Summary, typeof(TextSaver), typeof(TextSaver.Arguments), typeof(SignatureDataSaver), "Text Saver", "TextSaver", "Text", DocName = "saver/TextSaver.md")] diff --git a/src/Microsoft.ML.Data/DataLoadSave/TransformWrapper.cs b/src/Microsoft.ML.Data/DataLoadSave/TransformWrapper.cs index 4a6110bffb..548cab40d7 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/TransformWrapper.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/TransformWrapper.cs @@ -8,7 +8,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.DataLoadSave; using Microsoft.ML.Data.IO; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(TransformWrapper), null, typeof(SignatureLoadModel), "Transform wrapper", TransformWrapper.LoaderSignature)] diff --git a/src/Microsoft.ML.Data/DataLoadSave/TransformerChain.cs b/src/Microsoft.ML.Data/DataLoadSave/TransformerChain.cs index cc5ad43eef..73235797e5 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/TransformerChain.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/TransformerChain.cs @@ -12,6 +12,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(TransformerChain), typeof(TransformerChain), null, typeof(SignatureLoadModel), "Transformer chain", TransformerChain.LoaderSignature)] diff --git a/src/Microsoft.ML.Data/DataLoadSave/Transpose/TransposeLoader.cs b/src/Microsoft.ML.Data/DataLoadSave/Transpose/TransposeLoader.cs index 479f66e175..de130040d2 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/Transpose/TransposeLoader.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/Transpose/TransposeLoader.cs @@ -15,7 +15,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; [assembly: LoadableClass(TransposeLoader.Summary, typeof(TransposeLoader), typeof(TransposeLoader.Arguments), typeof(SignatureDataLoader), "Transpose Loader", TransposeLoader.LoadName, "Transpose", "trans")] diff --git a/src/Microsoft.ML.Data/DataLoadSave/Transpose/TransposeSaver.cs b/src/Microsoft.ML.Data/DataLoadSave/Transpose/TransposeSaver.cs index 4770c131d1..93ff133b90 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/Transpose/TransposeSaver.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/Transpose/TransposeSaver.cs @@ -13,6 +13,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(TransposeSaver.Summary, typeof(TransposeSaver), typeof(TransposeSaver.Arguments), typeof(SignatureDataSaver), diff --git a/src/Microsoft.ML.Data/DataLoadSave/TrivialEstimator.cs b/src/Microsoft.ML.Data/DataLoadSave/TrivialEstimator.cs index 1431d55037..f12cba05d9 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/TrivialEstimator.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/TrivialEstimator.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataView/AppendRowsDataView.cs b/src/Microsoft.ML.Data/DataView/AppendRowsDataView.cs index c62912dc0e..6007333c1f 100644 --- a/src/Microsoft.ML.Data/DataView/AppendRowsDataView.cs +++ b/src/Microsoft.ML.Data/DataView/AppendRowsDataView.cs @@ -8,6 +8,7 @@ using System.Reflection; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataView/ArrayDataViewBuilder.cs b/src/Microsoft.ML.Data/DataView/ArrayDataViewBuilder.cs index 1803b042e7..ad8570aad1 100644 --- a/src/Microsoft.ML.Data/DataView/ArrayDataViewBuilder.cs +++ b/src/Microsoft.ML.Data/DataView/ArrayDataViewBuilder.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataView/CacheDataView.cs b/src/Microsoft.ML.Data/DataView/CacheDataView.cs index 550be3e5a5..0d09050dd2 100644 --- a/src/Microsoft.ML.Data/DataView/CacheDataView.cs +++ b/src/Microsoft.ML.Data/DataView/CacheDataView.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataView/CompositeRowToRowMapper.cs b/src/Microsoft.ML.Data/DataView/CompositeRowToRowMapper.cs index 5170877f6b..932b1a8fc4 100644 --- a/src/Microsoft.ML.Data/DataView/CompositeRowToRowMapper.cs +++ b/src/Microsoft.ML.Data/DataView/CompositeRowToRowMapper.cs @@ -7,6 +7,7 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataView/DataViewConstructionUtils.cs b/src/Microsoft.ML.Data/DataView/DataViewConstructionUtils.cs index 22a44c4620..e1f8ec1e35 100644 --- a/src/Microsoft.ML.Data/DataView/DataViewConstructionUtils.cs +++ b/src/Microsoft.ML.Data/DataView/DataViewConstructionUtils.cs @@ -10,6 +10,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataView/DataViewExtensions.cs b/src/Microsoft.ML.Data/DataView/DataViewExtensions.cs index b777c95d6f..57ee83f804 100644 --- a/src/Microsoft.ML.Data/DataView/DataViewExtensions.cs +++ b/src/Microsoft.ML.Data/DataView/DataViewExtensions.cs @@ -4,6 +4,7 @@ using System.Linq; using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataView/EmptyDataView.cs b/src/Microsoft.ML.Data/DataView/EmptyDataView.cs index a747244bcd..45106d5f25 100644 --- a/src/Microsoft.ML.Data/DataView/EmptyDataView.cs +++ b/src/Microsoft.ML.Data/DataView/EmptyDataView.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataView/InternalSchemaDefinition.cs b/src/Microsoft.ML.Data/DataView/InternalSchemaDefinition.cs index c4078a67bf..bdf8852cfa 100644 --- a/src/Microsoft.ML.Data/DataView/InternalSchemaDefinition.cs +++ b/src/Microsoft.ML.Data/DataView/InternalSchemaDefinition.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Reflection; using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataView/LambdaColumnMapper.cs b/src/Microsoft.ML.Data/DataView/LambdaColumnMapper.cs index ccf2ab597c..106afc4315 100644 --- a/src/Microsoft.ML.Data/DataView/LambdaColumnMapper.cs +++ b/src/Microsoft.ML.Data/DataView/LambdaColumnMapper.cs @@ -6,7 +6,7 @@ using System.Reflection; using Microsoft.Data.DataView; using Microsoft.ML.Data.Conversion; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataView/LambdaFilter.cs b/src/Microsoft.ML.Data/DataView/LambdaFilter.cs index 62e4864139..0fe957ce4e 100644 --- a/src/Microsoft.ML.Data/DataView/LambdaFilter.cs +++ b/src/Microsoft.ML.Data/DataView/LambdaFilter.cs @@ -8,7 +8,7 @@ using System.Reflection; using Microsoft.Data.DataView; using Microsoft.ML.Data.Conversion; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataView/RowToRowMapperTransform.cs b/src/Microsoft.ML.Data/DataView/RowToRowMapperTransform.cs index c1c0a343db..dcd6520a48 100644 --- a/src/Microsoft.ML.Data/DataView/RowToRowMapperTransform.cs +++ b/src/Microsoft.ML.Data/DataView/RowToRowMapperTransform.cs @@ -13,6 +13,7 @@ using Microsoft.ML.Model; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(RowToRowMapperTransform), null, typeof(SignatureLoadDataTransform), "", RowToRowMapperTransform.LoaderSignature)] diff --git a/src/Microsoft.ML.Data/DataView/SimpleRow.cs b/src/Microsoft.ML.Data/DataView/SimpleRow.cs index c1b14f62b0..c3a2ec985a 100644 --- a/src/Microsoft.ML.Data/DataView/SimpleRow.cs +++ b/src/Microsoft.ML.Data/DataView/SimpleRow.cs @@ -3,10 +3,9 @@ // See the LICENSE file in the project root for more information. using System; -using System.Collections.Generic; -using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataView/Transposer.cs b/src/Microsoft.ML.Data/DataView/Transposer.cs index dc01d356f8..0d3b045871 100644 --- a/src/Microsoft.ML.Data/DataView/Transposer.cs +++ b/src/Microsoft.ML.Data/DataView/Transposer.cs @@ -10,6 +10,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataView/TypedCursor.cs b/src/Microsoft.ML.Data/DataView/TypedCursor.cs index 909c9c2da6..f9c95721ff 100644 --- a/src/Microsoft.ML.Data/DataView/TypedCursor.cs +++ b/src/Microsoft.ML.Data/DataView/TypedCursor.cs @@ -8,6 +8,7 @@ using System.Reflection; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataView/ZipBinding.cs b/src/Microsoft.ML.Data/DataView/ZipBinding.cs index 1d5492198c..542dcc4d57 100644 --- a/src/Microsoft.ML.Data/DataView/ZipBinding.cs +++ b/src/Microsoft.ML.Data/DataView/ZipBinding.cs @@ -5,6 +5,7 @@ using System; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataView/ZipDataView.cs b/src/Microsoft.ML.Data/DataView/ZipDataView.cs index 44e921b32e..c9c4621489 100644 --- a/src/Microsoft.ML.Data/DataView/ZipDataView.cs +++ b/src/Microsoft.ML.Data/DataView/ZipDataView.cs @@ -7,6 +7,7 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DebuggerExtensions.cs b/src/Microsoft.ML.Data/DebuggerExtensions.cs index 8270fb06e0..5e5285ba0e 100644 --- a/src/Microsoft.ML.Data/DebuggerExtensions.cs +++ b/src/Microsoft.ML.Data/DebuggerExtensions.cs @@ -4,6 +4,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML diff --git a/src/Microsoft.ML.Data/Depricated/Instances/HeaderSchema.cs b/src/Microsoft.ML.Data/Depricated/Instances/HeaderSchema.cs index 989617d0fa..897e3342c6 100644 --- a/src/Microsoft.ML.Data/Depricated/Instances/HeaderSchema.cs +++ b/src/Microsoft.ML.Data/Depricated/Instances/HeaderSchema.cs @@ -10,7 +10,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Internallearn { diff --git a/src/Microsoft.ML.Data/Depricated/Vector/GenericSpanSortHelper.cs b/src/Microsoft.ML.Data/Depricated/Vector/GenericSpanSortHelper.cs index f11fbce53b..f022c658f8 100644 --- a/src/Microsoft.ML.Data/Depricated/Vector/GenericSpanSortHelper.cs +++ b/src/Microsoft.ML.Data/Depricated/Vector/GenericSpanSortHelper.cs @@ -19,6 +19,7 @@ ===========================================================*/ using System; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Numeric { diff --git a/src/Microsoft.ML.Data/Depricated/Vector/VBufferMathUtils.cs b/src/Microsoft.ML.Data/Depricated/Vector/VBufferMathUtils.cs index 2591b11b56..50c2f20e21 100644 --- a/src/Microsoft.ML.Data/Depricated/Vector/VBufferMathUtils.cs +++ b/src/Microsoft.ML.Data/Depricated/Vector/VBufferMathUtils.cs @@ -6,6 +6,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.CpuMath; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Numeric { diff --git a/src/Microsoft.ML.Data/Depricated/Vector/VectorUtils.cs b/src/Microsoft.ML.Data/Depricated/Vector/VectorUtils.cs index e43cb95406..a84e0a1433 100644 --- a/src/Microsoft.ML.Data/Depricated/Vector/VectorUtils.cs +++ b/src/Microsoft.ML.Data/Depricated/Vector/VectorUtils.cs @@ -7,6 +7,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.CpuMath; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Numeric { diff --git a/src/Microsoft.ML.Data/Dirty/ChooseColumnsByIndexTransform.cs b/src/Microsoft.ML.Data/Dirty/ChooseColumnsByIndexTransform.cs index ffbd447297..5ff26170bf 100644 --- a/src/Microsoft.ML.Data/Dirty/ChooseColumnsByIndexTransform.cs +++ b/src/Microsoft.ML.Data/Dirty/ChooseColumnsByIndexTransform.cs @@ -11,6 +11,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(ChooseColumnsByIndexTransform), typeof(ChooseColumnsByIndexTransform.Options), typeof(SignatureDataTransform), "", "ChooseColumnsByIndexTransform", "ChooseColumnsByIndex")] diff --git a/src/Microsoft.ML.Data/Dirty/ILoss.cs b/src/Microsoft.ML.Data/Dirty/ILoss.cs index 8b79c442f6..1c0a3ac7d7 100644 --- a/src/Microsoft.ML.Data/Dirty/ILoss.cs +++ b/src/Microsoft.ML.Data/Dirty/ILoss.cs @@ -4,6 +4,7 @@ using System; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers { diff --git a/src/Microsoft.ML.Data/Dirty/IniFileUtils.cs b/src/Microsoft.ML.Data/Dirty/IniFileUtils.cs index 30932bc3df..702ffdd405 100644 --- a/src/Microsoft.ML.Data/Dirty/IniFileUtils.cs +++ b/src/Microsoft.ML.Data/Dirty/IniFileUtils.cs @@ -5,6 +5,7 @@ using System.Text; using System.Text.RegularExpressions; using Microsoft.ML.Calibrators; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Data/Dirty/ModelParametersBase.cs b/src/Microsoft.ML.Data/Dirty/ModelParametersBase.cs index 9922747deb..d76dc1c4ec 100644 --- a/src/Microsoft.ML.Data/Dirty/ModelParametersBase.cs +++ b/src/Microsoft.ML.Data/Dirty/ModelParametersBase.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Model { diff --git a/src/Microsoft.ML.Data/Dirty/PredictionUtils.cs b/src/Microsoft.ML.Data/Dirty/PredictionUtils.cs index f5ffc98082..f3689fced4 100644 --- a/src/Microsoft.ML.Data/Dirty/PredictionUtils.cs +++ b/src/Microsoft.ML.Data/Dirty/PredictionUtils.cs @@ -8,6 +8,7 @@ using System.Text; using Microsoft.ML.CommandLine; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Internallearn { diff --git a/src/Microsoft.ML.Data/Dirty/PredictorUtils.cs b/src/Microsoft.ML.Data/Dirty/PredictorUtils.cs index a4aa0e9e63..95a5dfc3e8 100644 --- a/src/Microsoft.ML.Data/Dirty/PredictorUtils.cs +++ b/src/Microsoft.ML.Data/Dirty/PredictorUtils.cs @@ -5,6 +5,7 @@ using System.IO; using Microsoft.ML.Data; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Internallearn { diff --git a/src/Microsoft.ML.Data/EntryPoints/CommonOutputs.cs b/src/Microsoft.ML.Data/EntryPoints/CommonOutputs.cs index ca3784c647..38dea9c7cc 100644 --- a/src/Microsoft.ML.Data/EntryPoints/CommonOutputs.cs +++ b/src/Microsoft.ML.Data/EntryPoints/CommonOutputs.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using Microsoft.Data.DataView; -using Microsoft.ML.Data; namespace Microsoft.ML.EntryPoints { diff --git a/src/Microsoft.ML.Data/EntryPoints/EntryPointNode.cs b/src/Microsoft.ML.Data/EntryPoints/EntryPointNode.cs index fac0d77753..0780612e31 100644 --- a/src/Microsoft.ML.Data/EntryPoints/EntryPointNode.cs +++ b/src/Microsoft.ML.Data/EntryPoints/EntryPointNode.cs @@ -9,6 +9,7 @@ using System.Text.RegularExpressions; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Newtonsoft.Json; using Newtonsoft.Json.Linq; diff --git a/src/Microsoft.ML.Data/EntryPoints/InputBase.cs b/src/Microsoft.ML.Data/EntryPoints/InputBase.cs index b2825bfd4b..45056b8543 100644 --- a/src/Microsoft.ML.Data/EntryPoints/InputBase.cs +++ b/src/Microsoft.ML.Data/EntryPoints/InputBase.cs @@ -9,6 +9,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Data.IO; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; namespace Microsoft.ML.EntryPoints diff --git a/src/Microsoft.ML.Data/EntryPoints/InputBuilder.cs b/src/Microsoft.ML.Data/EntryPoints/InputBuilder.cs index ea3e4b7750..a33d59bced 100644 --- a/src/Microsoft.ML.Data/EntryPoints/InputBuilder.cs +++ b/src/Microsoft.ML.Data/EntryPoints/InputBuilder.cs @@ -9,6 +9,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Newtonsoft.Json.Linq; namespace Microsoft.ML.EntryPoints diff --git a/src/Microsoft.ML.Data/EntryPoints/PredictorModelImpl.cs b/src/Microsoft.ML.Data/EntryPoints/PredictorModelImpl.cs index 97559e6d6e..c5cd325173 100644 --- a/src/Microsoft.ML.Data/EntryPoints/PredictorModelImpl.cs +++ b/src/Microsoft.ML.Data/EntryPoints/PredictorModelImpl.cs @@ -9,8 +9,8 @@ using Microsoft.Data.DataView; using Microsoft.ML.Calibrators; using Microsoft.ML.Data; -using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.EntryPoints { diff --git a/src/Microsoft.ML.Data/EntryPoints/SchemaManipulation.cs b/src/Microsoft.ML.Data/EntryPoints/SchemaManipulation.cs index ab3eec6e89..c894469152 100644 --- a/src/Microsoft.ML.Data/EntryPoints/SchemaManipulation.cs +++ b/src/Microsoft.ML.Data/EntryPoints/SchemaManipulation.cs @@ -5,6 +5,7 @@ using Microsoft.ML; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(typeof(void), typeof(SchemaManipulation), null, typeof(SignatureEntryPointModule), "SchemaManipulation")] diff --git a/src/Microsoft.ML.Data/EntryPoints/SelectRows.cs b/src/Microsoft.ML.Data/EntryPoints/SelectRows.cs index 41c4f527e2..4df5764307 100644 --- a/src/Microsoft.ML.Data/EntryPoints/SelectRows.cs +++ b/src/Microsoft.ML.Data/EntryPoints/SelectRows.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: EntryPointModule(typeof(SelectRows))] diff --git a/src/Microsoft.ML.Data/EntryPoints/SummarizePredictor.cs b/src/Microsoft.ML.Data/EntryPoints/SummarizePredictor.cs index e2d15bd809..52df74689f 100644 --- a/src/Microsoft.ML.Data/EntryPoints/SummarizePredictor.cs +++ b/src/Microsoft.ML.Data/EntryPoints/SummarizePredictor.cs @@ -10,6 +10,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; [assembly: EntryPointModule(typeof(SummarizePredictor))] diff --git a/src/Microsoft.ML.Data/EntryPoints/TransformModelImpl.cs b/src/Microsoft.ML.Data/EntryPoints/TransformModelImpl.cs index 7a190349b0..ff90e29ca3 100644 --- a/src/Microsoft.ML.Data/EntryPoints/TransformModelImpl.cs +++ b/src/Microsoft.ML.Data/EntryPoints/TransformModelImpl.cs @@ -11,6 +11,7 @@ using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.EntryPoints { diff --git a/src/Microsoft.ML.Data/Evaluators/AnomalyDetectionEvaluator.cs b/src/Microsoft.ML.Data/Evaluators/AnomalyDetectionEvaluator.cs index 316c95455c..df4a8991e0 100644 --- a/src/Microsoft.ML.Data/Evaluators/AnomalyDetectionEvaluator.cs +++ b/src/Microsoft.ML.Data/Evaluators/AnomalyDetectionEvaluator.cs @@ -12,6 +12,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(typeof(AnomalyDetectionEvaluator), typeof(AnomalyDetectionEvaluator), typeof(AnomalyDetectionEvaluator.Arguments), typeof(SignatureEvaluator), diff --git a/src/Microsoft.ML.Data/Evaluators/AucAggregator.cs b/src/Microsoft.ML.Data/Evaluators/AucAggregator.cs index 33ec27fe32..88e91e71bc 100644 --- a/src/Microsoft.ML.Data/Evaluators/AucAggregator.cs +++ b/src/Microsoft.ML.Data/Evaluators/AucAggregator.cs @@ -7,6 +7,7 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Evaluators/BinaryClassifierEvaluator.cs b/src/Microsoft.ML.Data/Evaluators/BinaryClassifierEvaluator.cs index 240c2a27d3..5d7ac8770e 100644 --- a/src/Microsoft.ML.Data/Evaluators/BinaryClassifierEvaluator.cs +++ b/src/Microsoft.ML.Data/Evaluators/BinaryClassifierEvaluator.cs @@ -12,6 +12,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(typeof(BinaryClassifierEvaluator), typeof(BinaryClassifierEvaluator), typeof(BinaryClassifierEvaluator.Arguments), typeof(SignatureEvaluator), diff --git a/src/Microsoft.ML.Data/Evaluators/ClusteringEvaluator.cs b/src/Microsoft.ML.Data/Evaluators/ClusteringEvaluator.cs index c432740eb9..d679ee146c 100644 --- a/src/Microsoft.ML.Data/Evaluators/ClusteringEvaluator.cs +++ b/src/Microsoft.ML.Data/Evaluators/ClusteringEvaluator.cs @@ -12,6 +12,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(typeof(ClusteringEvaluator), typeof(ClusteringEvaluator), typeof(ClusteringEvaluator.Arguments), typeof(SignatureEvaluator), diff --git a/src/Microsoft.ML.Data/Evaluators/EvaluatorBase.cs b/src/Microsoft.ML.Data/Evaluators/EvaluatorBase.cs index ad06b1d2b0..54f7b3b363 100644 --- a/src/Microsoft.ML.Data/Evaluators/EvaluatorBase.cs +++ b/src/Microsoft.ML.Data/Evaluators/EvaluatorBase.cs @@ -8,6 +8,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Evaluators/EvaluatorUtils.cs b/src/Microsoft.ML.Data/Evaluators/EvaluatorUtils.cs index 428596b119..e7d2f1668a 100644 --- a/src/Microsoft.ML.Data/Evaluators/EvaluatorUtils.cs +++ b/src/Microsoft.ML.Data/Evaluators/EvaluatorUtils.cs @@ -11,6 +11,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML.Data diff --git a/src/Microsoft.ML.Data/Evaluators/MamlEvaluator.cs b/src/Microsoft.ML.Data/Evaluators/MamlEvaluator.cs index 53d314152d..6c60581915 100644 --- a/src/Microsoft.ML.Data/Evaluators/MamlEvaluator.cs +++ b/src/Microsoft.ML.Data/Evaluators/MamlEvaluator.cs @@ -7,6 +7,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.CommandLine; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML.Data diff --git a/src/Microsoft.ML.Data/Evaluators/Metrics/AnomalyDetectionMetrics.cs b/src/Microsoft.ML.Data/Evaluators/Metrics/AnomalyDetectionMetrics.cs index 449d5585f9..009f1fa923 100644 --- a/src/Microsoft.ML.Data/Evaluators/Metrics/AnomalyDetectionMetrics.cs +++ b/src/Microsoft.ML.Data/Evaluators/Metrics/AnomalyDetectionMetrics.cs @@ -2,8 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Evaluators/Metrics/BinaryClassificationMetrics.cs b/src/Microsoft.ML.Data/Evaluators/Metrics/BinaryClassificationMetrics.cs index ff0d3d4a98..8abb854f0f 100644 --- a/src/Microsoft.ML.Data/Evaluators/Metrics/BinaryClassificationMetrics.cs +++ b/src/Microsoft.ML.Data/Evaluators/Metrics/BinaryClassificationMetrics.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Evaluators/Metrics/CalibratedBinaryClassificationMetrics.cs b/src/Microsoft.ML.Data/Evaluators/Metrics/CalibratedBinaryClassificationMetrics.cs index 02b304a830..f8eff9ccb0 100644 --- a/src/Microsoft.ML.Data/Evaluators/Metrics/CalibratedBinaryClassificationMetrics.cs +++ b/src/Microsoft.ML.Data/Evaluators/Metrics/CalibratedBinaryClassificationMetrics.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Evaluators/Metrics/ClusteringMetrics.cs b/src/Microsoft.ML.Data/Evaluators/Metrics/ClusteringMetrics.cs index 42c84992ec..461c99de46 100644 --- a/src/Microsoft.ML.Data/Evaluators/Metrics/ClusteringMetrics.cs +++ b/src/Microsoft.ML.Data/Evaluators/Metrics/ClusteringMetrics.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Evaluators/Metrics/MultiClassClassifierMetrics.cs b/src/Microsoft.ML.Data/Evaluators/Metrics/MultiClassClassifierMetrics.cs index 1e89622641..f9f189eb70 100644 --- a/src/Microsoft.ML.Data/Evaluators/Metrics/MultiClassClassifierMetrics.cs +++ b/src/Microsoft.ML.Data/Evaluators/Metrics/MultiClassClassifierMetrics.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Collections.Immutable; using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Evaluators/Metrics/RankingMetrics.cs b/src/Microsoft.ML.Data/Evaluators/Metrics/RankingMetrics.cs index 4e43bf53ce..2b0b468900 100644 --- a/src/Microsoft.ML.Data/Evaluators/Metrics/RankingMetrics.cs +++ b/src/Microsoft.ML.Data/Evaluators/Metrics/RankingMetrics.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Collections.Immutable; using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Evaluators/Metrics/RegressionMetrics.cs b/src/Microsoft.ML.Data/Evaluators/Metrics/RegressionMetrics.cs index 87c4fefa79..9642f51adf 100644 --- a/src/Microsoft.ML.Data/Evaluators/Metrics/RegressionMetrics.cs +++ b/src/Microsoft.ML.Data/Evaluators/Metrics/RegressionMetrics.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Evaluators/MultiClassClassifierEvaluator.cs b/src/Microsoft.ML.Data/Evaluators/MultiClassClassifierEvaluator.cs index 32db00a259..651ab1439b 100644 --- a/src/Microsoft.ML.Data/Evaluators/MultiClassClassifierEvaluator.cs +++ b/src/Microsoft.ML.Data/Evaluators/MultiClassClassifierEvaluator.cs @@ -12,6 +12,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(typeof(MultiClassClassifierEvaluator), typeof(MultiClassClassifierEvaluator), typeof(MultiClassClassifierEvaluator.Arguments), typeof(SignatureEvaluator), diff --git a/src/Microsoft.ML.Data/Evaluators/MultiOutputRegressionEvaluator.cs b/src/Microsoft.ML.Data/Evaluators/MultiOutputRegressionEvaluator.cs index 73f68e4a96..c862e868e1 100644 --- a/src/Microsoft.ML.Data/Evaluators/MultiOutputRegressionEvaluator.cs +++ b/src/Microsoft.ML.Data/Evaluators/MultiOutputRegressionEvaluator.cs @@ -13,6 +13,8 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; +using Microsoft.ML.Trainers; [assembly: LoadableClass(typeof(MultiOutputRegressionEvaluator), typeof(MultiOutputRegressionEvaluator), typeof(MultiOutputRegressionEvaluator.Arguments), typeof(SignatureEvaluator), "Multi Output Regression Evaluator", MultiOutputRegressionEvaluator.LoadName, "MultiOutputRegression", "MRE")] @@ -176,11 +178,11 @@ public sealed class Counters private readonly IRegressionLoss _lossFunction; - public Double L1 { get { return _sumWeights > 0 ? _sumL1 / _sumWeights : 0; } } + public Double L1 => _sumWeights > 0 ? _sumL1 / _sumWeights : 0; - public Double L2 { get { return _sumWeights > 0 ? _sumL2 / _sumWeights : 0; } } + public Double L2 => _sumWeights > 0 ? _sumL2 / _sumWeights : 0; - public Double Dist { get { return _sumWeights > 0 ? _sumEuclidean / _sumWeights : 0; } } + public Double Dist => _sumWeights > 0 ? _sumEuclidean / _sumWeights : 0; public Double[] PerLabelL1 { @@ -548,7 +550,7 @@ private void CheckInputColumnTypes(DataViewSchema schema, out VectorType labelTy var t = schema[LabelIndex].Type as VectorType; if (t == null || !t.IsKnownSize || (t.ItemType != NumberDataViewType.Single && t.ItemType != NumberDataViewType.Double)) throw Host.ExceptSchemaMismatch(nameof(schema), "label", LabelCol, "known-size vector of float or double", t.ToString()); - labelType = new VectorType((PrimitiveDataViewType)t.ItemType, t.Size); + labelType = new VectorType(t.ItemType, t.Size); var slotNamesType = new VectorType(TextDataViewType.Instance, t.Size); var builder = new DataViewSchema.Annotations.Builder(); builder.AddSlotNames(t.Size, CreateSlotNamesGetter(schema, LabelIndex, labelType.Size, "True")); @@ -557,7 +559,7 @@ private void CheckInputColumnTypes(DataViewSchema schema, out VectorType labelTy t = schema[ScoreIndex].Type as VectorType; if (t == null || !t.IsKnownSize || t.ItemType != NumberDataViewType.Single) throw Host.ExceptSchemaMismatch(nameof(schema), "score", ScoreCol, "known-size vector of float", t.ToString()); - scoreType = new VectorType((PrimitiveDataViewType)t.ItemType, t.Size); + scoreType = new VectorType(t.ItemType, t.Size); builder = new DataViewSchema.Annotations.Builder(); builder.AddSlotNames(t.Size, CreateSlotNamesGetter(schema, ScoreIndex, scoreType.Size, "Predicted")); diff --git a/src/Microsoft.ML.Data/Evaluators/QuantileRegressionEvaluator.cs b/src/Microsoft.ML.Data/Evaluators/QuantileRegressionEvaluator.cs index 7e853dc31f..f3e6bec099 100644 --- a/src/Microsoft.ML.Data/Evaluators/QuantileRegressionEvaluator.cs +++ b/src/Microsoft.ML.Data/Evaluators/QuantileRegressionEvaluator.cs @@ -10,7 +10,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(QuantileRegressionEvaluator), typeof(QuantileRegressionEvaluator), typeof(QuantileRegressionEvaluator.Arguments), typeof(SignatureEvaluator), "Quantile Regression Evaluator", QuantileRegressionEvaluator.LoadName, "QuantileRegression")] diff --git a/src/Microsoft.ML.Data/Evaluators/RankingEvaluator.cs b/src/Microsoft.ML.Data/Evaluators/RankingEvaluator.cs index 72177e70f6..3255f37715 100644 --- a/src/Microsoft.ML.Data/Evaluators/RankingEvaluator.cs +++ b/src/Microsoft.ML.Data/Evaluators/RankingEvaluator.cs @@ -14,7 +14,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(RankingEvaluator), typeof(RankingEvaluator), typeof(RankingEvaluator.Arguments), typeof(SignatureEvaluator), "Ranking Evaluator", RankingEvaluator.LoadName, "Ranking", "rank")] diff --git a/src/Microsoft.ML.Data/Evaluators/RegressionEvaluator.cs b/src/Microsoft.ML.Data/Evaluators/RegressionEvaluator.cs index 9e123522b9..46bc68d560 100644 --- a/src/Microsoft.ML.Data/Evaluators/RegressionEvaluator.cs +++ b/src/Microsoft.ML.Data/Evaluators/RegressionEvaluator.cs @@ -10,6 +10,8 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; +using Microsoft.ML.Trainers; [assembly: LoadableClass(typeof(RegressionEvaluator), typeof(RegressionEvaluator), typeof(RegressionEvaluator.Arguments), typeof(SignatureEvaluator), "Regression Evaluator", RegressionEvaluator.LoadName, "Regression")] diff --git a/src/Microsoft.ML.Data/Evaluators/RegressionEvaluatorBase.cs b/src/Microsoft.ML.Data/Evaluators/RegressionEvaluatorBase.cs index d97bd578ad..1a5a548d15 100644 --- a/src/Microsoft.ML.Data/Evaluators/RegressionEvaluatorBase.cs +++ b/src/Microsoft.ML.Data/Evaluators/RegressionEvaluatorBase.cs @@ -7,6 +7,8 @@ using Microsoft.Data.DataView; using Microsoft.ML.CommandLine; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; +using Microsoft.ML.Trainers; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/MLContext.cs b/src/Microsoft.ML.Data/MLContext.cs index cf29372996..95f494c16e 100644 --- a/src/Microsoft.ML.Data/MLContext.cs +++ b/src/Microsoft.ML.Data/MLContext.cs @@ -4,6 +4,7 @@ using System; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Data/Model/ModelOperationsCatalog.cs b/src/Microsoft.ML.Data/Model/ModelOperationsCatalog.cs index fb83ffd55d..fcc0905bad 100644 --- a/src/Microsoft.ML.Data/Model/ModelOperationsCatalog.cs +++ b/src/Microsoft.ML.Data/Model/ModelOperationsCatalog.cs @@ -4,6 +4,7 @@ using System.IO; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Data/Model/Pfa/BoundPfaContext.cs b/src/Microsoft.ML.Data/Model/Pfa/BoundPfaContext.cs index be262e8bed..a60bab241e 100644 --- a/src/Microsoft.ML.Data/Model/Pfa/BoundPfaContext.cs +++ b/src/Microsoft.ML.Data/Model/Pfa/BoundPfaContext.cs @@ -6,6 +6,7 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Newtonsoft.Json.Linq; namespace Microsoft.ML.Model.Pfa diff --git a/src/Microsoft.ML.Data/Model/Pfa/ModelUtils.cs b/src/Microsoft.ML.Data/Model/Pfa/ModelUtils.cs index e33a9ae4a6..0566a43c12 100644 --- a/src/Microsoft.ML.Data/Model/Pfa/ModelUtils.cs +++ b/src/Microsoft.ML.Data/Model/Pfa/ModelUtils.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Model { diff --git a/src/Microsoft.ML.Data/Model/Pfa/PfaContext.cs b/src/Microsoft.ML.Data/Model/Pfa/PfaContext.cs index 9619e195ca..c36245a5b4 100644 --- a/src/Microsoft.ML.Data/Model/Pfa/PfaContext.cs +++ b/src/Microsoft.ML.Data/Model/Pfa/PfaContext.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; +using Microsoft.ML.Runtime; using Newtonsoft.Json.Linq; namespace Microsoft.ML.Model.Pfa diff --git a/src/Microsoft.ML.Data/Model/Pfa/PfaUtils.cs b/src/Microsoft.ML.Data/Model/Pfa/PfaUtils.cs index 31e829fe3c..71992c3b5c 100644 --- a/src/Microsoft.ML.Data/Model/Pfa/PfaUtils.cs +++ b/src/Microsoft.ML.Data/Model/Pfa/PfaUtils.cs @@ -5,6 +5,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Newtonsoft.Json.Linq; namespace Microsoft.ML.Model.Pfa diff --git a/src/Microsoft.ML.Data/Model/Pfa/SavePfaCommand.cs b/src/Microsoft.ML.Data/Model/Pfa/SavePfaCommand.cs index 6606b64ba5..7bfb9f4c59 100644 --- a/src/Microsoft.ML.Data/Model/Pfa/SavePfaCommand.cs +++ b/src/Microsoft.ML.Data/Model/Pfa/SavePfaCommand.cs @@ -12,6 +12,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Newtonsoft.Json; using Newtonsoft.Json.Linq; diff --git a/src/Microsoft.ML.Data/Model/PredictionEngineExtensions.cs b/src/Microsoft.ML.Data/Model/PredictionEngineExtensions.cs index 1f0b4f3796..0231eebb10 100644 --- a/src/Microsoft.ML.Data/Model/PredictionEngineExtensions.cs +++ b/src/Microsoft.ML.Data/Model/PredictionEngineExtensions.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Data/Prediction/Calibrator.cs b/src/Microsoft.ML.Data/Prediction/Calibrator.cs index ffc8b791c7..26db83e11b 100644 --- a/src/Microsoft.ML.Data/Prediction/Calibrator.cs +++ b/src/Microsoft.ML.Data/Prediction/Calibrator.cs @@ -18,6 +18,7 @@ using Microsoft.ML.Model; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; using Newtonsoft.Json.Linq; diff --git a/src/Microsoft.ML.Data/Prediction/CalibratorCatalog.cs b/src/Microsoft.ML.Data/Prediction/CalibratorCatalog.cs index db74d9670e..503f7a9476 100644 --- a/src/Microsoft.ML.Data/Prediction/CalibratorCatalog.cs +++ b/src/Microsoft.ML.Data/Prediction/CalibratorCatalog.cs @@ -8,6 +8,7 @@ using Microsoft.ML; using Microsoft.ML.Calibrators; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; [assembly: LoadableClass(typeof(CalibratorTransformer), typeof(PlattCalibratorTransformer), null, diff --git a/src/Microsoft.ML.Data/Prediction/PredictionEngine.cs b/src/Microsoft.ML.Data/Prediction/PredictionEngine.cs index ede7292929..33c70466b6 100644 --- a/src/Microsoft.ML.Data/Prediction/PredictionEngine.cs +++ b/src/Microsoft.ML.Data/Prediction/PredictionEngine.cs @@ -7,6 +7,7 @@ using System.IO; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Data/Scorers/BinaryClassifierScorer.cs b/src/Microsoft.ML.Data/Scorers/BinaryClassifierScorer.cs index a764a5190e..5f2f1d9d7d 100644 --- a/src/Microsoft.ML.Data/Scorers/BinaryClassifierScorer.cs +++ b/src/Microsoft.ML.Data/Scorers/BinaryClassifierScorer.cs @@ -9,6 +9,7 @@ using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Newtonsoft.Json.Linq; [assembly: LoadableClass(typeof(BinaryClassifierScorer), typeof(BinaryClassifierScorer.Arguments), typeof(SignatureDataScorer), diff --git a/src/Microsoft.ML.Data/Scorers/ClusteringScorer.cs b/src/Microsoft.ML.Data/Scorers/ClusteringScorer.cs index 19f5be7d78..48bcdaa90f 100644 --- a/src/Microsoft.ML.Data/Scorers/ClusteringScorer.cs +++ b/src/Microsoft.ML.Data/Scorers/ClusteringScorer.cs @@ -7,9 +7,9 @@ using Microsoft.ML; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Model.Pfa; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Newtonsoft.Json.Linq; [assembly: LoadableClass(typeof(ClusteringScorer), typeof(ClusteringScorer.Arguments), typeof(SignatureDataScorer), diff --git a/src/Microsoft.ML.Data/Scorers/FeatureContributionCalculation.cs b/src/Microsoft.ML.Data/Scorers/FeatureContributionCalculation.cs index 32932b48ba..6353fd42f9 100644 --- a/src/Microsoft.ML.Data/Scorers/FeatureContributionCalculation.cs +++ b/src/Microsoft.ML.Data/Scorers/FeatureContributionCalculation.cs @@ -11,10 +11,10 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(IDataScorerTransform), typeof(FeatureContributionScorer), typeof(FeatureContributionScorer.Arguments), typeof(SignatureDataScorer), "Feature Contribution Scorer", "fcc", "wtf", "fct", "FeatureContributionCalculationScorer", AnnotationUtils.Const.ScoreColumnKind.FeatureContribution)] diff --git a/src/Microsoft.ML.Data/Scorers/GenericScorer.cs b/src/Microsoft.ML.Data/Scorers/GenericScorer.cs index 144768d581..ed547ce127 100644 --- a/src/Microsoft.ML.Data/Scorers/GenericScorer.cs +++ b/src/Microsoft.ML.Data/Scorers/GenericScorer.cs @@ -7,9 +7,9 @@ using Microsoft.Data.DataView; using Microsoft.ML; using Microsoft.ML.Data; -using Microsoft.ML.Model; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(GenericScorer), typeof(GenericScorer.Arguments), typeof(SignatureDataScorer), "Generic Scorer", GenericScorer.LoadName, "Generic")] diff --git a/src/Microsoft.ML.Data/Scorers/MultiClassClassifierScorer.cs b/src/Microsoft.ML.Data/Scorers/MultiClassClassifierScorer.cs index fcc51375c5..c0a6061529 100644 --- a/src/Microsoft.ML.Data/Scorers/MultiClassClassifierScorer.cs +++ b/src/Microsoft.ML.Data/Scorers/MultiClassClassifierScorer.cs @@ -10,10 +10,10 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Newtonsoft.Json.Linq; [assembly: LoadableClass(typeof(MultiClassClassifierScorer), diff --git a/src/Microsoft.ML.Data/Scorers/PredictedLabelScorerBase.cs b/src/Microsoft.ML.Data/Scorers/PredictedLabelScorerBase.cs index 9fb8523b98..d555b43ed3 100644 --- a/src/Microsoft.ML.Data/Scorers/PredictedLabelScorerBase.cs +++ b/src/Microsoft.ML.Data/Scorers/PredictedLabelScorerBase.cs @@ -9,6 +9,7 @@ using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Newtonsoft.Json.Linq; namespace Microsoft.ML.Data diff --git a/src/Microsoft.ML.Data/Scorers/PredictionTransformer.cs b/src/Microsoft.ML.Data/Scorers/PredictionTransformer.cs index aef92fa994..be6757bc36 100644 --- a/src/Microsoft.ML.Data/Scorers/PredictionTransformer.cs +++ b/src/Microsoft.ML.Data/Scorers/PredictionTransformer.cs @@ -7,7 +7,7 @@ using Microsoft.ML; using Microsoft.ML.Data; using Microsoft.ML.Data.IO; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(BinaryPredictionTransformer>), typeof(BinaryPredictionTransformer), null, typeof(SignatureLoadModel), "", BinaryPredictionTransformer.LoaderSignature)] diff --git a/src/Microsoft.ML.Data/Scorers/QuantileRegressionScorer.cs b/src/Microsoft.ML.Data/Scorers/QuantileRegressionScorer.cs index 15d3cdc609..d6708079b4 100644 --- a/src/Microsoft.ML.Data/Scorers/QuantileRegressionScorer.cs +++ b/src/Microsoft.ML.Data/Scorers/QuantileRegressionScorer.cs @@ -9,6 +9,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(IDataScorerTransform), typeof(QuantileRegressionScorerTransform), typeof(QuantileRegressionScorerTransform.Arguments), typeof(SignatureDataScorer), "Quantile Regression Scorer", "QuantileRegressionScorer", AnnotationUtils.Const.ScoreColumnKind.QuantileRegression)] diff --git a/src/Microsoft.ML.Data/Scorers/RowToRowScorerBase.cs b/src/Microsoft.ML.Data/Scorers/RowToRowScorerBase.cs index 4b81de40f4..c6727d8608 100644 --- a/src/Microsoft.ML.Data/Scorers/RowToRowScorerBase.cs +++ b/src/Microsoft.ML.Data/Scorers/RowToRowScorerBase.cs @@ -8,6 +8,7 @@ using System.Reflection; using Microsoft.Data.DataView; using Microsoft.ML.CommandLine; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Scorers/SchemaBindablePredictorWrapper.cs b/src/Microsoft.ML.Data/Scorers/SchemaBindablePredictorWrapper.cs index 3a6868d413..d8507617a4 100644 --- a/src/Microsoft.ML.Data/Scorers/SchemaBindablePredictorWrapper.cs +++ b/src/Microsoft.ML.Data/Scorers/SchemaBindablePredictorWrapper.cs @@ -10,11 +10,11 @@ using Microsoft.Data.DataView; using Microsoft.ML; using Microsoft.ML.Data; -using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Newtonsoft.Json.Linq; [assembly: LoadableClass(typeof(SchemaBindablePredictorWrapper), null, typeof(SignatureLoadModel), diff --git a/src/Microsoft.ML.Data/Scorers/ScoreSchemaFactory.cs b/src/Microsoft.ML.Data/Scorers/ScoreSchemaFactory.cs index 991c562ccd..8bc67f307b 100644 --- a/src/Microsoft.ML.Data/Scorers/ScoreSchemaFactory.cs +++ b/src/Microsoft.ML.Data/Scorers/ScoreSchemaFactory.cs @@ -3,9 +3,8 @@ // See the LICENSE file in the project root for more information. using System; -using System.Collections.Generic; using Microsoft.Data.DataView; -using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/TrainCatalog.cs b/src/Microsoft.ML.Data/TrainCatalog.cs index 4f3effa036..072b924e6b 100644 --- a/src/Microsoft.ML.Data/TrainCatalog.cs +++ b/src/Microsoft.ML.Data/TrainCatalog.cs @@ -7,6 +7,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Calibrators; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML diff --git a/src/Microsoft.ML.Data/Training/TrainerEstimatorBase.cs b/src/Microsoft.ML.Data/Training/TrainerEstimatorBase.cs index 2ab3446da2..288000e0c9 100644 --- a/src/Microsoft.ML.Data/Training/TrainerEstimatorBase.cs +++ b/src/Microsoft.ML.Data/Training/TrainerEstimatorBase.cs @@ -5,6 +5,7 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers { diff --git a/src/Microsoft.ML.Data/Training/TrainerInputBase.cs b/src/Microsoft.ML.Data/Training/TrainerInputBase.cs index 1387c27220..ed039b3d58 100644 --- a/src/Microsoft.ML.Data/Training/TrainerInputBase.cs +++ b/src/Microsoft.ML.Data/Training/TrainerInputBase.cs @@ -2,14 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; -using System.Collections.Generic; using Microsoft.Data.DataView; -using Microsoft.ML.Calibrators; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.Data.IO; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers { diff --git a/src/Microsoft.ML.Data/Training/TrainerUtils.cs b/src/Microsoft.ML.Data/Training/TrainerUtils.cs index 9e01cb9411..47540fa68a 100644 --- a/src/Microsoft.ML.Data/Training/TrainerUtils.cs +++ b/src/Microsoft.ML.Data/Training/TrainerUtils.cs @@ -7,8 +7,8 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML.Trainers diff --git a/src/Microsoft.ML.Data/Transforms/BindingsWrappedRowCursor.cs b/src/Microsoft.ML.Data/Transforms/BindingsWrappedRowCursor.cs index 51b5f60fc0..d539a961fd 100644 --- a/src/Microsoft.ML.Data/Transforms/BindingsWrappedRowCursor.cs +++ b/src/Microsoft.ML.Data/Transforms/BindingsWrappedRowCursor.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Transforms/BootstrapSamplingTransformer.cs b/src/Microsoft.ML.Data/Transforms/BootstrapSamplingTransformer.cs index 73fdf1becf..b8aa733b32 100644 --- a/src/Microsoft.ML.Data/Transforms/BootstrapSamplingTransformer.cs +++ b/src/Microsoft.ML.Data/Transforms/BootstrapSamplingTransformer.cs @@ -10,7 +10,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(BootstrapSamplingTransformer.Summary, typeof(BootstrapSamplingTransformer), typeof(BootstrapSamplingTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Data/Transforms/CatalogUtils.cs b/src/Microsoft.ML.Data/Transforms/CatalogUtils.cs index 1a30eddb71..31eec9a28b 100644 --- a/src/Microsoft.ML.Data/Transforms/CatalogUtils.cs +++ b/src/Microsoft.ML.Data/Transforms/CatalogUtils.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Transforms/ColumnBindingsBase.cs b/src/Microsoft.ML.Data/Transforms/ColumnBindingsBase.cs index 9f32ed758f..e0e118fe37 100644 --- a/src/Microsoft.ML.Data/Transforms/ColumnBindingsBase.cs +++ b/src/Microsoft.ML.Data/Transforms/ColumnBindingsBase.cs @@ -10,6 +10,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.CommandLine; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML.Data diff --git a/src/Microsoft.ML.Data/Transforms/ColumnConcatenatingEstimator.cs b/src/Microsoft.ML.Data/Transforms/ColumnConcatenatingEstimator.cs index cbd747f2d0..6bb5b6841a 100644 --- a/src/Microsoft.ML.Data/Transforms/ColumnConcatenatingEstimator.cs +++ b/src/Microsoft.ML.Data/Transforms/ColumnConcatenatingEstimator.cs @@ -7,6 +7,7 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms { diff --git a/src/Microsoft.ML.Data/Transforms/ColumnConcatenatingTransformer.cs b/src/Microsoft.ML.Data/Transforms/ColumnConcatenatingTransformer.cs index 65524b6344..1d52e8347d 100644 --- a/src/Microsoft.ML.Data/Transforms/ColumnConcatenatingTransformer.cs +++ b/src/Microsoft.ML.Data/Transforms/ColumnConcatenatingTransformer.cs @@ -13,6 +13,7 @@ using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; using Newtonsoft.Json.Linq; diff --git a/src/Microsoft.ML.Data/Transforms/ColumnCopying.cs b/src/Microsoft.ML.Data/Transforms/ColumnCopying.cs index 0506105403..ee06f819c2 100644 --- a/src/Microsoft.ML.Data/Transforms/ColumnCopying.cs +++ b/src/Microsoft.ML.Data/Transforms/ColumnCopying.cs @@ -14,6 +14,7 @@ using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; using Microsoft.ML.Model.OnnxConverter; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(ColumnCopyingTransformer.Summary, typeof(IDataTransform), typeof(ColumnCopyingTransformer), diff --git a/src/Microsoft.ML.Data/Transforms/ColumnSelecting.cs b/src/Microsoft.ML.Data/Transforms/ColumnSelecting.cs index dbe0deccbb..1598ae955e 100644 --- a/src/Microsoft.ML.Data/Transforms/ColumnSelecting.cs +++ b/src/Microsoft.ML.Data/Transforms/ColumnSelecting.cs @@ -10,6 +10,8 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(ColumnSelectingTransformer.Summary, typeof(IDataTransform), typeof(ColumnSelectingTransformer), diff --git a/src/Microsoft.ML.Data/Transforms/FeatureContributionCalculationTransformer.cs b/src/Microsoft.ML.Data/Transforms/FeatureContributionCalculationTransformer.cs index c1afca52c3..57054fe836 100644 --- a/src/Microsoft.ML.Data/Transforms/FeatureContributionCalculationTransformer.cs +++ b/src/Microsoft.ML.Data/Transforms/FeatureContributionCalculationTransformer.cs @@ -12,6 +12,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(FeatureContributionCalculatingTransformer.Summary, typeof(FeatureContributionCalculatingTransformer), null, typeof(SignatureLoadModel), diff --git a/src/Microsoft.ML.Data/Transforms/GenerateNumberTransform.cs b/src/Microsoft.ML.Data/Transforms/GenerateNumberTransform.cs index 31bfc44142..b9de5c13e8 100644 --- a/src/Microsoft.ML.Data/Transforms/GenerateNumberTransform.cs +++ b/src/Microsoft.ML.Data/Transforms/GenerateNumberTransform.cs @@ -11,7 +11,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(GenerateNumberTransform.Summary, typeof(GenerateNumberTransform), typeof(GenerateNumberTransform.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Data/Transforms/Hashing.cs b/src/Microsoft.ML.Data/Transforms/Hashing.cs index 0882062ec5..a129f48478 100644 --- a/src/Microsoft.ML.Data/Transforms/Hashing.cs +++ b/src/Microsoft.ML.Data/Transforms/Hashing.cs @@ -12,6 +12,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(HashingTransformer.Summary, typeof(IDataTransform), typeof(HashingTransformer), typeof(HashingTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Data/Transforms/InvertHashUtils.cs b/src/Microsoft.ML.Data/Transforms/InvertHashUtils.cs index c87d1d6b72..476c697723 100644 --- a/src/Microsoft.ML.Data/Transforms/InvertHashUtils.cs +++ b/src/Microsoft.ML.Data/Transforms/InvertHashUtils.cs @@ -9,6 +9,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Transforms/KeyToValue.cs b/src/Microsoft.ML.Data/Transforms/KeyToValue.cs index 4b5d65c674..537ad3af5b 100644 --- a/src/Microsoft.ML.Data/Transforms/KeyToValue.cs +++ b/src/Microsoft.ML.Data/Transforms/KeyToValue.cs @@ -11,9 +11,9 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; using Newtonsoft.Json.Linq; diff --git a/src/Microsoft.ML.Data/Transforms/KeyToVector.cs b/src/Microsoft.ML.Data/Transforms/KeyToVector.cs index 226185c5a1..0a6b29cdcd 100644 --- a/src/Microsoft.ML.Data/Transforms/KeyToVector.cs +++ b/src/Microsoft.ML.Data/Transforms/KeyToVector.cs @@ -13,6 +13,7 @@ using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; using Newtonsoft.Json.Linq; diff --git a/src/Microsoft.ML.Data/Transforms/LabelConvertTransform.cs b/src/Microsoft.ML.Data/Transforms/LabelConvertTransform.cs index 4b49721bb3..a53a4eedeb 100644 --- a/src/Microsoft.ML.Data/Transforms/LabelConvertTransform.cs +++ b/src/Microsoft.ML.Data/Transforms/LabelConvertTransform.cs @@ -10,6 +10,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(LabelConvertTransform.Summary, typeof(LabelConvertTransform), typeof(LabelConvertTransform.Arguments), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Data/Transforms/LabelIndicatorTransform.cs b/src/Microsoft.ML.Data/Transforms/LabelIndicatorTransform.cs index ffa8d9ed08..2c2c06c3d4 100644 --- a/src/Microsoft.ML.Data/Transforms/LabelIndicatorTransform.cs +++ b/src/Microsoft.ML.Data/Transforms/LabelIndicatorTransform.cs @@ -10,7 +10,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(typeof(LabelIndicatorTransform), typeof(LabelIndicatorTransform.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Data/Transforms/MetadataDispatcher.cs b/src/Microsoft.ML.Data/Transforms/MetadataDispatcher.cs index 8733349317..d5b76cb49f 100644 --- a/src/Microsoft.ML.Data/Transforms/MetadataDispatcher.cs +++ b/src/Microsoft.ML.Data/Transforms/MetadataDispatcher.cs @@ -7,6 +7,7 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Transforms/NAFilter.cs b/src/Microsoft.ML.Data/Transforms/NAFilter.cs index 02e87a786e..bafb6ddc65 100644 --- a/src/Microsoft.ML.Data/Transforms/NAFilter.cs +++ b/src/Microsoft.ML.Data/Transforms/NAFilter.cs @@ -11,8 +11,8 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(NAFilter.Summary, typeof(NAFilter), typeof(NAFilter.Arguments), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Data/Transforms/NopTransform.cs b/src/Microsoft.ML.Data/Transforms/NopTransform.cs index de1b957820..f4054b45b7 100644 --- a/src/Microsoft.ML.Data/Transforms/NopTransform.cs +++ b/src/Microsoft.ML.Data/Transforms/NopTransform.cs @@ -8,7 +8,7 @@ using Microsoft.ML; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(NopTransform.Summary, typeof(NopTransform), null, typeof(SignatureLoadDataTransform), diff --git a/src/Microsoft.ML.Data/Transforms/NormalizeColumn.cs b/src/Microsoft.ML.Data/Transforms/NormalizeColumn.cs index ee27b95369..f2320edcb0 100644 --- a/src/Microsoft.ML.Data/Transforms/NormalizeColumn.cs +++ b/src/Microsoft.ML.Data/Transforms/NormalizeColumn.cs @@ -15,6 +15,7 @@ using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; using Newtonsoft.Json.Linq; diff --git a/src/Microsoft.ML.Data/Transforms/NormalizeColumnDbl.cs b/src/Microsoft.ML.Data/Transforms/NormalizeColumnDbl.cs index a216e0cdea..33cbcb9f37 100644 --- a/src/Microsoft.ML.Data/Transforms/NormalizeColumnDbl.cs +++ b/src/Microsoft.ML.Data/Transforms/NormalizeColumnDbl.cs @@ -12,6 +12,7 @@ using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Newtonsoft.Json.Linq; namespace Microsoft.ML.Transforms diff --git a/src/Microsoft.ML.Data/Transforms/NormalizeColumnSng.cs b/src/Microsoft.ML.Data/Transforms/NormalizeColumnSng.cs index fb36327498..51a179ceff 100644 --- a/src/Microsoft.ML.Data/Transforms/NormalizeColumnSng.cs +++ b/src/Microsoft.ML.Data/Transforms/NormalizeColumnSng.cs @@ -12,6 +12,7 @@ using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Newtonsoft.Json.Linq; namespace Microsoft.ML.Transforms diff --git a/src/Microsoft.ML.Data/Transforms/NormalizeUtils.cs b/src/Microsoft.ML.Data/Transforms/NormalizeUtils.cs index a122625a12..c5c1681972 100644 --- a/src/Microsoft.ML.Data/Transforms/NormalizeUtils.cs +++ b/src/Microsoft.ML.Data/Transforms/NormalizeUtils.cs @@ -10,6 +10,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; using Newtonsoft.Json.Linq; diff --git a/src/Microsoft.ML.Data/Transforms/Normalizer.cs b/src/Microsoft.ML.Data/Transforms/Normalizer.cs index b952d09aaa..ed5935bf54 100644 --- a/src/Microsoft.ML.Data/Transforms/Normalizer.cs +++ b/src/Microsoft.ML.Data/Transforms/Normalizer.cs @@ -12,6 +12,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; using Newtonsoft.Json.Linq; diff --git a/src/Microsoft.ML.Data/Transforms/OneToOneTransformerBase.cs b/src/Microsoft.ML.Data/Transforms/OneToOneTransformerBase.cs index 3bcaec1f1c..d88b99445a 100644 --- a/src/Microsoft.ML.Data/Transforms/OneToOneTransformerBase.cs +++ b/src/Microsoft.ML.Data/Transforms/OneToOneTransformerBase.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Transforms/RangeFilter.cs b/src/Microsoft.ML.Data/Transforms/RangeFilter.cs index 4df93b4905..3a49283f56 100644 --- a/src/Microsoft.ML.Data/Transforms/RangeFilter.cs +++ b/src/Microsoft.ML.Data/Transforms/RangeFilter.cs @@ -10,8 +10,8 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(RangeFilter.Summary, typeof(RangeFilter), typeof(RangeFilter.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Data/Transforms/RowShufflingTransformer.cs b/src/Microsoft.ML.Data/Transforms/RowShufflingTransformer.cs index 932b6f0824..cf6670652a 100644 --- a/src/Microsoft.ML.Data/Transforms/RowShufflingTransformer.cs +++ b/src/Microsoft.ML.Data/Transforms/RowShufflingTransformer.cs @@ -12,7 +12,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(RowShufflingTransformer.Summary, typeof(RowShufflingTransformer), typeof(RowShufflingTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Data/Transforms/RowToRowTransformerBase.cs b/src/Microsoft.ML.Data/Transforms/RowToRowTransformerBase.cs index ba7c41105b..c7fae8777c 100644 --- a/src/Microsoft.ML.Data/Transforms/RowToRowTransformerBase.cs +++ b/src/Microsoft.ML.Data/Transforms/RowToRowTransformerBase.cs @@ -6,6 +6,7 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Transforms/SkipTakeFilter.cs b/src/Microsoft.ML.Data/Transforms/SkipTakeFilter.cs index 6f0394dec5..1adf33d813 100644 --- a/src/Microsoft.ML.Data/Transforms/SkipTakeFilter.cs +++ b/src/Microsoft.ML.Data/Transforms/SkipTakeFilter.cs @@ -8,9 +8,8 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(SkipTakeFilter.SkipTakeFilterSummary, typeof(SkipTakeFilter), typeof(SkipTakeFilter.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Data/Transforms/SlotsDroppingTransformer.cs b/src/Microsoft.ML.Data/Transforms/SlotsDroppingTransformer.cs index 274fdd08c7..8f7d05d432 100644 --- a/src/Microsoft.ML.Data/Transforms/SlotsDroppingTransformer.cs +++ b/src/Microsoft.ML.Data/Transforms/SlotsDroppingTransformer.cs @@ -13,6 +13,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(SlotsDroppingTransformer.Summary, typeof(IDataTransform), typeof(SlotsDroppingTransformer), typeof(SlotsDroppingTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Data/Transforms/TransformBase.cs b/src/Microsoft.ML.Data/Transforms/TransformBase.cs index 96f46e63d8..1bc69325dd 100644 --- a/src/Microsoft.ML.Data/Transforms/TransformBase.cs +++ b/src/Microsoft.ML.Data/Transforms/TransformBase.cs @@ -10,6 +10,7 @@ using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Newtonsoft.Json.Linq; namespace Microsoft.ML.Data diff --git a/src/Microsoft.ML.Data/Utilities/ApplyTransformUtils.cs b/src/Microsoft.ML.Data/Utilities/ApplyTransformUtils.cs index d299585101..a2e6e7d561 100644 --- a/src/Microsoft.ML.Data/Utilities/ApplyTransformUtils.cs +++ b/src/Microsoft.ML.Data/Utilities/ApplyTransformUtils.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.IO; using Microsoft.Data.DataView; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Utilities/ColumnCursor.cs b/src/Microsoft.ML.Data/Utilities/ColumnCursor.cs index a61dcf4113..b2f871a16d 100644 --- a/src/Microsoft.ML.Data/Utilities/ColumnCursor.cs +++ b/src/Microsoft.ML.Data/Utilities/ColumnCursor.cs @@ -4,8 +4,8 @@ using System; using System.Collections.Generic; -using System.Linq; using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Utilities/ComponentCreation.cs b/src/Microsoft.ML.Data/Utilities/ComponentCreation.cs index 07842b1d21..ef2f9ad7f6 100644 --- a/src/Microsoft.ML.Data/Utilities/ComponentCreation.cs +++ b/src/Microsoft.ML.Data/Utilities/ComponentCreation.cs @@ -8,6 +8,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.CommandLine; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Utilities/LocalEnvironment.cs b/src/Microsoft.ML.Data/Utilities/LocalEnvironment.cs index f9643700e0..2423b43a42 100644 --- a/src/Microsoft.ML.Data/Utilities/LocalEnvironment.cs +++ b/src/Microsoft.ML.Data/Utilities/LocalEnvironment.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/Utilities/ModelFileUtils.cs b/src/Microsoft.ML.Data/Utilities/ModelFileUtils.cs index 3f52f603bc..630d516252 100644 --- a/src/Microsoft.ML.Data/Utilities/ModelFileUtils.cs +++ b/src/Microsoft.ML.Data/Utilities/ModelFileUtils.cs @@ -11,6 +11,7 @@ using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Model { diff --git a/src/Microsoft.ML.Data/Utilities/SlotDropper.cs b/src/Microsoft.ML.Data/Utilities/SlotDropper.cs index b720ebf703..f511c05421 100644 --- a/src/Microsoft.ML.Data/Utilities/SlotDropper.cs +++ b/src/Microsoft.ML.Data/Utilities/SlotDropper.cs @@ -6,6 +6,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Internallearn { diff --git a/src/Microsoft.ML.Data/Utilities/TimerScope.cs b/src/Microsoft.ML.Data/Utilities/TimerScope.cs index 663ba669d5..beec232ef1 100644 --- a/src/Microsoft.ML.Data/Utilities/TimerScope.cs +++ b/src/Microsoft.ML.Data/Utilities/TimerScope.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Data/Utilities/TypeParsingUtils.cs b/src/Microsoft.ML.Data/Utilities/TypeParsingUtils.cs index bd460b20bf..c0dfdc9ee9 100644 --- a/src/Microsoft.ML.Data/Utilities/TypeParsingUtils.cs +++ b/src/Microsoft.ML.Data/Utilities/TypeParsingUtils.cs @@ -6,6 +6,7 @@ using System.Text; using Microsoft.Data.DataView; using Microsoft.ML.CommandLine; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML.Data diff --git a/src/Microsoft.ML.Data/Utils/ApiUtils.cs b/src/Microsoft.ML.Data/Utils/ApiUtils.cs index 82674b435b..e674cf31af 100644 --- a/src/Microsoft.ML.Data/Utils/ApiUtils.cs +++ b/src/Microsoft.ML.Data/Utils/ApiUtils.cs @@ -7,6 +7,7 @@ using System.Reflection.Emit; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Data/Utils/LossFunctions.cs b/src/Microsoft.ML.Data/Utils/LossFunctions.cs index 7d32856497..0cee6c54fd 100644 --- a/src/Microsoft.ML.Data/Utils/LossFunctions.cs +++ b/src/Microsoft.ML.Data/Utils/LossFunctions.cs @@ -7,6 +7,8 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; +using Microsoft.ML.Trainers; [assembly: LoadableClass(LogLoss.Summary, typeof(LogLoss), null, typeof(SignatureClassificationLoss), "Log Loss", "LogLoss", "Logistic", "CrossEntropy")] diff --git a/src/Microsoft.ML.Data/Utils/SequencePool.cs b/src/Microsoft.ML.Data/Utils/SequencePool.cs index 989bbd195f..4889925d85 100644 --- a/src/Microsoft.ML.Data/Utils/SequencePool.cs +++ b/src/Microsoft.ML.Data/Utils/SequencePool.cs @@ -4,6 +4,7 @@ using System; using System.IO; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.FastTree/Training/StepSearch.cs b/src/Microsoft.ML.FastTree/Training/StepSearch.cs index 0768108dab..ac2926f2bb 100644 --- a/src/Microsoft.ML.FastTree/Training/StepSearch.cs +++ b/src/Microsoft.ML.FastTree/Training/StepSearch.cs @@ -4,6 +4,7 @@ using System; using System.Linq; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.Transforms/MetricStatistics.cs b/src/Microsoft.ML.Transforms/MetricStatistics.cs index acded1a640..35a5f64937 100644 --- a/src/Microsoft.ML.Transforms/MetricStatistics.cs +++ b/src/Microsoft.ML.Transforms/MetricStatistics.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { From ba598d73a249f49731522fe14606359bf80907ce Mon Sep 17 00:00:00 2001 From: Senja Filipi Date: Thu, 7 Mar 2019 13:57:08 -0800 Subject: [PATCH 3/6] updating the usings to make the solution build, after the IHost changes --- .../Dynamic/DataOperations/BootstrapSample.cs | 1 - .../Dynamic/DataOperations/Cache.cs | 1 - .../DataOperations/DataViewEnumerable.cs | 1 - .../DataOperations/FilterRowsByColumn.cs | 1 - .../FilterRowsByMissingValues.cs | 1 - .../Dynamic/DataOperations/ShuffleRows.cs | 1 - .../Dynamic/DataOperations/SkipRows.cs | 3 - .../Dynamic/DataOperations/TakeRows.cs | 3 - .../Dynamic/FastTreeRegression.cs | 1 - .../Dynamic/OnnxTransform.cs | 1 - .../Dynamic/StopWordRemoverTransform.cs | 1 - .../Dynamic/TensorFlow/TextClassification.cs | 1 - .../Trainers/BinaryClassification/LightGbm.cs | 4 +- .../PriorTrainerSample.cs | 3 +- ...hasticDualCoordinateAscentNonCalibrated.cs | 2 +- .../StochasticGradientDescent.cs | 4 +- .../StochasticGradientDescentNonCalibrated.cs | 6 +- ...GradientDescentNonCalibratedWithOptions.cs | 5 +- .../StochasticGradientDescentWithOptions.cs | 3 +- .../Dynamic/Trainers/Ranking/LightGbm.cs | 4 +- .../Dynamic/Transforms/CopyColumns.cs | 1 - .../Dynamic/Transforms/CustomMappingSample.cs | 2 - .../Dynamic/Transforms/DropColumns.cs | 1 - .../Dynamic/Transforms/SelectColumns.cs | 2 - .../Dynamic/ValueMapping.cs | 2 - .../Dynamic/ValueMappingFloatToString.cs | 2 - .../Dynamic/ValueMappingStringToArray.cs | 1 - .../Dynamic/ValueMappingStringToKeyType.cs | 1 - .../Static/FastTreeBinaryClassification.cs | 1 - .../Static/FastTreeRegression.cs | 1 - .../Static/LightGBMBinaryClassification.cs | 1 - .../LightGBMMulticlassWithInMemoryData.cs | 7 +- .../Static/SDCARegression.cs | 1 - .../CommandLine/ArgumentAttribute.cs | 1 + .../CommandLine/CharCursor.cs | 1 + src/Microsoft.ML.Core/CommandLine/CmdLexer.cs | 289 +++--- .../ComponentModel/LoadableClassAttribute.cs | 1 + src/Microsoft.ML.Core/Data/DataKind.cs | 2 +- src/Microsoft.ML.Core/Data/IEstimator.cs | 1 + src/Microsoft.ML.Core/Data/KeyType.cs | 1 + src/Microsoft.ML.Core/Data/ModelHeader.cs | 1 + src/Microsoft.ML.Core/Data/ModelSaving.cs | 1 + .../Data/ReadOnlyMemoryUtils.cs | 1 + .../Data/RoleMappedSchema.cs | 1 + src/Microsoft.ML.Core/Data/VBuffer.cs | 1 + src/Microsoft.ML.Core/Data/VBufferEditor.cs | 1 + src/Microsoft.ML.Core/Data/VectorType.cs | 1 + src/Microsoft.ML.Core/Data/WrappingRow.cs | 1 + .../EntryPoints/EntryPointModuleAttribute.cs | 1 - .../EntryPoints/ModuleArgs.cs | 1 + .../Environment/TelemetryMessage.cs | 1 + .../Prediction/TrainContext.cs | 1 + src/Microsoft.ML.Core/Utilities/BigArray.cs | 149 +-- src/Microsoft.ML.Core/Utilities/BinFinder.cs | 7 +- src/Microsoft.ML.Core/Utilities/BitUtils.cs | 3 +- .../Utilities/DoubleParser.cs | 163 ++-- .../Utilities/FixedSizeQueue.cs | 3 + src/Microsoft.ML.Core/Utilities/FloatUtils.cs | 1 + src/Microsoft.ML.Core/Utilities/HashArray.cs | 1 + src/Microsoft.ML.Core/Utilities/Hashing.cs | 1 + src/Microsoft.ML.Core/Utilities/Heap.cs | 1 + .../Utilities/HybridMemoryStream.cs | 4 +- src/Microsoft.ML.Core/Utilities/LruCache.cs | 1 + src/Microsoft.ML.Core/Utilities/MathUtils.cs | 3 +- .../Utilities/MatrixTransposeOps.cs | 1 + src/Microsoft.ML.Core/Utilities/MinWaiter.cs | 1 + src/Microsoft.ML.Core/Utilities/NormStr.cs | 1 + .../Utilities/OrderedWaiter.cs | 1 + src/Microsoft.ML.Core/Utilities/PathUtils.cs | 1 + .../Utilities/PlatformUtils.cs | 1 + src/Microsoft.ML.Core/Utilities/Random.cs | 1 + .../Utilities/ReservoirSampler.cs | 5 +- src/Microsoft.ML.Core/Utilities/Stats.cs | 7 +- src/Microsoft.ML.Core/Utilities/Stream.cs | 1 + .../Utilities/SubsetStream.cs | 1 + .../Utilities/SupervisedBinFinder.cs | 1 + .../Utilities/TextReaderStream.cs | 1 + src/Microsoft.ML.Core/Utilities/Tree.cs | 1 + src/Microsoft.ML.Core/Utilities/Utils.cs | 4 +- .../Utilities/VBufferUtils.cs | 7 +- .../Commands/CrossValidationCommand.cs | 2 +- src/Microsoft.ML.Data/DataDebuggerPreview.cs | 1 + .../DataLoadSave/Binary/BinaryLoader.cs | 5 +- .../DataLoadSave/Text/TextLoader.cs | 2 +- .../Dirty/ChooseColumnsByIndexTransform.cs | 1 - .../EntryPoints/EntryPointNode.cs | 1 + .../Evaluators/BinaryClassifierEvaluator.cs | 1 - .../Evaluators/EvaluatorBase.cs | 3 +- .../Evaluators/QuantileRegressionEvaluator.cs | 1 + .../Evaluators/RegressionEvaluator.cs | 3 +- .../Prediction/Calibrator.cs | 8 +- .../Prediction/CalibratorCatalog.cs | 4 +- .../Transforms/ColumnCopying.cs | 2 - .../Transforms/ColumnSelecting.cs | 3 +- .../Transforms/NormalizeColumn.cs | 3 +- .../Transforms/PerGroupTransformBase.cs | 2 +- .../Transforms/RowToRowTransformerBase.cs | 2 - .../Transforms/TrainAndScoreTransformer.cs | 2 +- .../Transforms/TransformsCatalog.cs | 2 +- .../Transforms/TypeConverting.cs | 1 + .../Transforms/ValueMapping.cs | 11 +- .../Transforms/ValueToKeyMappingEstimator.cs | 3 +- .../ValueToKeyMappingTransformer.cs | 2 +- .../ValueToKeyMappingTransformerImpl.cs | 1 + .../AlexNetExtension.cs | 1 + .../ResNet101Extension.cs | 1 + .../ResNet18Extension.cs | 1 + .../ResNet50Extension.cs | 1 + src/Microsoft.ML.Ensemble/Batch.cs | 1 + src/Microsoft.ML.Ensemble/EnsembleUtils.cs | 1 + .../EntryPoints/CreateEnsemble.cs | 1 + .../EntryPoints/DiversityMeasure.cs | 1 + .../EntryPoints/Ensemble.cs | 1 + .../EntryPoints/FeatureSelector.cs | 1 + .../EntryPoints/OutputCombiner.cs | 1 + .../EntryPoints/PipelineEnsemble.cs | 1 + .../EntryPoints/SubModelSelector.cs | 1 + .../FeatureSubsetModel.cs | 1 + .../OutputCombiners/Average.cs | 6 +- .../OutputCombiners/BaseAverager.cs | 2 +- .../OutputCombiners/BaseMultiAverager.cs | 2 +- .../OutputCombiners/BaseMultiCombiner.cs | 2 +- .../OutputCombiners/BaseScalarStacking.cs | 2 +- .../OutputCombiners/BaseStacking.cs | 3 +- .../OutputCombiners/IOutputCombiner.cs | 1 + .../OutputCombiners/Median.cs | 2 +- .../OutputCombiners/MultiAverage.cs | 2 +- .../OutputCombiners/MultiMedian.cs | 2 +- .../OutputCombiners/MultiStacking.cs | 2 +- .../OutputCombiners/MultiVoting.cs | 2 +- .../OutputCombiners/MultiWeightedAverage.cs | 2 +- .../OutputCombiners/RegressionStacking.cs | 2 +- .../OutputCombiners/Stacking.cs | 2 +- .../OutputCombiners/Voting.cs | 2 +- .../OutputCombiners/WeightedAverage.cs | 4 +- src/Microsoft.ML.Ensemble/PipelineEnsemble.cs | 2 +- .../BaseDisagreementDiversityMeasure.cs | 1 + .../FeatureSelector/AllFeatureSelector.cs | 1 + .../FeatureSelector/RandomFeatureSelector.cs | 3 +- .../Selector/IDiversityMeasure.cs | 1 + .../Selector/IFeatureSelector.cs | 1 + .../Selector/ISubModelSelector.cs | 3 +- .../Selector/ISubsetSelector.cs | 1 + .../Selector/SubModelSelector/AllSelector.cs | 1 + .../SubModelSelector/AllSelectorMultiClass.cs | 1 + .../BaseBestPerformanceSelector.cs | 1 + .../SubModelSelector/BaseDiverseSelector.cs | 1 + .../SubModelSelector/BaseSubModelSelector.cs | 1 + .../BestDiverseSelectorBinary.cs | 1 + .../BestDiverseSelectorMultiClass.cs | 1 + .../BestDiverseSelectorRegression.cs | 1 + .../BestPerformanceRegressionSelector.cs | 1 + .../BestPerformanceSelector.cs | 1 + .../BestPerformanceSelectorMultiClass.cs | 1 + .../SubModelSelector/SubModelDataSelector.cs | 1 + .../SubsetSelector/AllInstanceSelector.cs | 1 + .../SubsetSelector/BaseSubsetSelector.cs | 1 + .../SubsetSelector/BootstrapSelector.cs | 1 + .../SubsetSelector/RandomPartitionSelector.cs | 1 + src/Microsoft.ML.Ensemble/Subset.cs | 1 + .../Trainer/Binary/EnsembleTrainer.cs | 1 + .../EnsembleDistributionModelParameters.cs | 2 +- .../Trainer/EnsembleModelParameters.cs | 2 +- .../Trainer/EnsembleModelParametersBase.cs | 2 +- .../Trainer/EnsembleTrainerBase.cs | 2 +- .../EnsembleMultiClassModelParameters.cs | 2 +- .../MulticlassDataPartitionEnsembleTrainer.cs | 1 + .../Regression/RegressionEnsembleTrainer.cs | 1 + src/Microsoft.ML.EntryPoints/CVSplit.cs | 2 +- .../CrossValidationMacro.cs | 1 + .../DataViewReference.cs | 1 + .../FeatureCombiner.cs | 1 + .../ImportTextData.cs | 1 + .../JsonUtils/ExecuteGraphCommand.cs | 1 + .../JsonUtils/GraphRunner.cs | 1 + .../JsonUtils/JsonManifestUtils.cs | 1 + src/Microsoft.ML.EntryPoints/MacroUtils.cs | 1 + .../ModelOperations.cs | 1 + .../OneVersusAllMacro.cs | 1 + .../ScoreColumnSelector.cs | 1 + src/Microsoft.ML.EntryPoints/ScoreModel.cs | 1 + .../TrainTestMacro.cs | 1 + .../TrainTestSplit.cs | 1 + .../BinFile/BinFinder.cs | 1 + .../BinFile/IniFileParserInterface.cs | 1 + src/Microsoft.ML.FastTree/BoostingFastTree.cs | 1 + src/Microsoft.ML.FastTree/Dataset/Dataset.cs | 1 + .../Dataset/DatasetUtils.cs | 10 +- .../Dataset/DenseIntArray.cs | 1 + src/Microsoft.ML.FastTree/Dataset/Feature.cs | 11 +- .../Dataset/FeatureFlock.cs | 1 + .../Dataset/FeatureHistogram.cs | 3 +- src/Microsoft.ML.FastTree/Dataset/IntArray.cs | 1 + .../Dataset/NHotFeatureFlock.cs | 1 + .../Dataset/OneHotFeatureFlock.cs | 1 + .../Dataset/RepeatIntArray.cs | 1 + .../Dataset/SegmentIntArray.cs | 1 + .../Dataset/SingletonFeatureFlock.cs | 1 + .../Dataset/SparseIntArray.cs | 1 + src/Microsoft.ML.FastTree/FastTree.cs | 1 + .../FastTreeArguments.cs | 1 + .../FastTreeClassification.cs | 1 + src/Microsoft.ML.FastTree/FastTreeRanking.cs | 1 + .../FastTreeRegression.cs | 1 + src/Microsoft.ML.FastTree/FastTreeTweedie.cs | 1 + .../GamClassification.cs | 1 + .../GamModelParameters.cs | 1 + src/Microsoft.ML.FastTree/GamRegression.cs | 1 + src/Microsoft.ML.FastTree/GamTrainer.cs | 7 +- src/Microsoft.ML.FastTree/RandomForest.cs | 4 +- .../RandomForestClassification.cs | 1 + .../RandomForestRegression.cs | 1 + src/Microsoft.ML.FastTree/RegressionTree.cs | 1 + .../SumupPerformanceCommand.cs | 1 + .../Applications/ObjectiveFunction.cs | 1 + .../Training/DcgCalculator.cs | 1 + .../Training/DcgPermutationComparer.cs | 7 +- .../Training/DocumentPartitioning.cs | 1 + .../Training/EarlyStoppingCriteria.cs | 1 + .../IEnsembleCompressor.cs | 1 + .../LassoBasedEnsembleCompressor.cs | 1 + .../AcceleratedGradientDescent.cs | 1 + .../ConjugateGradientDescent.cs | 1 + .../OptimizationAlgorithms/GradientDescent.cs | 3 +- .../NoOptimizationAlgorithm.cs | 1 + .../OptimizationAlgorithm.cs | 1 + .../Training/Parallel/IParallelTraining.cs | 1 + .../Training/Parallel/SingleTrainer.cs | 1 + .../Training/ScoreTracker.cs | 1 + src/Microsoft.ML.FastTree/Training/Test.cs | 1 + .../FastForestLeastSquaresTreeLearner.cs | 3 +- .../LeastSquaresRegressionTreeLearner.cs | 1 + .../Training/TreeLearners/TreeLearner.cs | 1 + .../InternalQuantileRegressionTree.cs | 2 +- .../TreeEnsemble/InternalRegressionTree.cs | 22 +- .../TreeEnsemble/InternalTreeEnsemble.cs | 11 +- .../TreeEnsemble/TreeEnsembleCombiner.cs | 3 +- .../TreeEnsembleFeaturizer.cs | 6 +- .../TreeTrainersCatalog.cs | 1 + src/Microsoft.ML.FastTree/Utils/Algorithms.cs | 1 + .../Utils/BufferPoolManager.cs | 1 + .../Utils/FastTreeIniFileUtils.cs | 1 + .../Utils/ThreadTaskManager.cs | 1 + .../EntryPoints/ImageAnalytics.cs | 1 + .../ImageGrayscale.cs | 2 +- .../ImageLoader.cs | 2 +- .../ImagePixelExtractor.cs | 3 +- .../ImageResizer.cs | 3 +- src/Microsoft.ML.ImageAnalytics/ImageType.cs | 1 + .../VectorToImageTransform.cs | 2 +- .../KMeansCatalog.cs | 3 +- .../KMeansModelParameters.cs | 5 +- .../KMeansPlusPlusTrainer.cs | 3 +- .../LightGbmStaticExtensions.cs | 1 + .../LightGbmArguments.cs | 1 + .../LightGbmBinaryTrainer.cs | 1 + src/Microsoft.ML.LightGBM/LightGbmCatalog.cs | 2 +- .../LightGbmMulticlassTrainer.cs | 1 + .../LightGbmRankingTrainer.cs | 2 +- .../LightGbmRegressionTrainer.cs | 2 +- .../LightGbmTrainerBase.cs | 1 + .../Parallel/IParallel.cs | 1 + .../Parallel/SingleTrainer.cs | 1 + .../WrappedLightGbmBooster.cs | 1 + .../WrappedLightGbmDataset.cs | 3 +- .../WrappedLightGbmInterface.cs | 1 + .../WrappedLightGbmTraining.cs | 1 + src/Microsoft.ML.Maml/ChainCommand.cs | 1 + src/Microsoft.ML.Maml/HelpCommand.cs | 1 + src/Microsoft.ML.Maml/MAML.cs | 2 +- src/Microsoft.ML.Maml/VersionCommand.cs | 1 + .../VectorWhiteningStaticExtensions.cs | 1 + .../ComputeLRTrainingStdThroughHal.cs | 1 + .../MklComponentsCatalog.cs | 1 + .../OlsLinearRegression.cs | 1 + .../SymSgdClassificationTrainer.cs | 1 + .../VectorWhitening.cs | 3 +- .../OnnxContextImpl.cs | 3 +- .../OnnxNodeImpl.cs | 1 + src/Microsoft.ML.OnnxConverter/OnnxUtils.cs | 1 + .../SaveOnnxCommand.cs | 5 +- .../DnnImageFeaturizerStaticExtensions.cs | 1 + .../OnnxStaticExtensions.cs | 1 + .../DnnImageFeaturizerTransform.cs | 1 + .../OnnxTransform.cs | 2 +- src/Microsoft.ML.OnnxTransformer/OnnxUtils.cs | 1 + src/Microsoft.ML.PCA/PCACatalog.cs | 1 + src/Microsoft.ML.PCA/PcaTrainer.cs | 9 +- src/Microsoft.ML.PCA/PcaTransformer.cs | 4 +- src/Microsoft.ML.Parquet/ParquetLoader.cs | 8 +- .../PartitionedFileLoader.cs | 5 +- .../PartitionedPathParser.cs | 2 +- .../PartitionedPathUtils.cs | 1 + .../MatrixFactorizationPredictor.cs | 2 +- .../MatrixFactorizationTrainer.cs | 1 + .../RecommenderCatalog.cs | 1 + .../RecommenderUtils.cs | 1 + .../SafeTrainingAndModelBuffer.cs | 2 +- .../ResultProcessor.cs | 1 + .../FactorizationMachineCatalog.cs | 1 + .../FactorizationMachineInterface.cs | 1 + .../FactorizationMachineTrainer.cs | 1 + ...wareFactorizationMachineModelParameters.cs | 1 + .../FieldAwareFactorizationMachineUtils.cs | 1 + .../Optimizer/DifferentiableFunction.cs | 1 + .../Optimizer/L1Optimizer.cs | 9 +- .../Optimizer/LineSearch.cs | 14 +- .../Optimizer/OptimizationMonitor.cs | 1 + .../Optimizer/Optimizer.cs | 15 +- .../Optimizer/SgdOptimizer.cs | 37 +- .../Standard/LinearModelParameters.cs | 1 + .../Standard/LinearPredictorUtils.cs | 1 + .../LogisticRegression/LbfgsPredictorBase.cs | 4 +- .../LogisticRegression/LogisticRegression.cs | 1 + .../MulticlassLogisticRegression.cs | 2 +- .../Standard/ModelStatistics.cs | 2 +- .../MultiClass/MetaMulticlassTrainer.cs | 2 +- .../MultiClass/MultiClassNaiveBayesTrainer.cs | 2 +- .../MultiClass/OneVersusAllTrainer.cs | 5 +- .../MultiClass/PairwiseCouplingTrainer.cs | 2 +- .../Standard/Online/AveragedLinear.cs | 1 + .../Standard/Online/AveragedPerceptron.cs | 1 + .../Standard/Online/LinearSvm.cs | 3 +- .../Standard/Online/OnlineGradientDescent.cs | 1 + .../Standard/Online/OnlineLinear.cs | 1 + .../PoissonRegression/PoissonRegression.cs | 1 + .../Standard/SdcaBinary.cs | 1 + .../Standard/SdcaMultiClass.cs | 1 + .../Standard/SdcaRegression.cs | 1 + .../Standard/Simple/SimpleTrainers.cs | 1 + .../Standard/StochasticTrainerBase.cs | 1 + .../StandardLearnersCatalog.cs | 1 + src/Microsoft.ML.StaticPipe/Attributes.cs | 1 - .../CategoricalHashStaticExtensions.cs | 1 + .../CategoricalStaticExtensions.cs | 1 + .../ConvertStaticExtensions.cs | 1 + .../ConvertStaticExtensions.tt | 1 + src/Microsoft.ML.StaticPipe/DataLoader.cs | 1 + .../DataLoaderEstimator.cs | 1 + src/Microsoft.ML.StaticPipe/DataView.cs | 1 + src/Microsoft.ML.StaticPipe/Estimator.cs | 1 + .../EvaluatorStaticExtensions.cs | 2 + .../FactorizationMachineStatic.cs | 1 + .../ImageStaticPipe.cs | 1 + .../ImageTransformsStatic.cs | 1 + src/Microsoft.ML.StaticPipe/KMeansStatic.cs | 1 + src/Microsoft.ML.StaticPipe/LbfgsStatic.cs | 1 + .../LdaStaticExtensions.cs | 1 + .../LpNormalizerStaticExtensions.cs | 1 + .../MatrixFactorizationStatic.cs | 1 + .../MultiClassNaiveBayesStatic.cs | 1 + .../NormalizerStaticExtensions.cs | 1 + .../OnlineLearnerStatic.cs | 1 + src/Microsoft.ML.StaticPipe/PipelineColumn.cs | 1 + src/Microsoft.ML.StaticPipe/Reconciler.cs | 1 + src/Microsoft.ML.StaticPipe/SchemaBearing.cs | 1 + .../SdcaStaticExtensions.cs | 1 + .../StaticPipeExtensions.cs | 2 +- .../StaticPipeInternalUtils.cs | 1 + .../StaticPipeUtils.cs | 2 +- .../StaticSchemaShape.cs | 1 + .../TermStaticExtensions.cs | 1 + .../TermStaticExtensions.tt | 1 + .../TextLoaderStatic.cs | 1 + .../TextStaticExtensions.cs | 1 + .../TrainerEstimatorReconciler.cs | 1 + .../TrainingStaticExtensions.cs | 1 + src/Microsoft.ML.StaticPipe/Transformer.cs | 1 + .../TransformsStatic.cs | 1 + .../TreeTrainersStatic.cs | 1 + .../WordEmbeddingsStaticExtensions.cs | 1 + src/Microsoft.ML.Sweeper/Algorithms/Grid.cs | 1 + .../Algorithms/KdoSweeper.cs | 1 + .../Algorithms/NelderMead.cs | 237 ++--- src/Microsoft.ML.Sweeper/Algorithms/Random.cs | 1 + .../Algorithms/SmacSweeper.cs | 1 + .../Algorithms/SweeperProbabilityUtils.cs | 1 + src/Microsoft.ML.Sweeper/AsyncSweeper.cs | 2 +- src/Microsoft.ML.Sweeper/ConfigRunner.cs | 4 +- src/Microsoft.ML.Sweeper/ISweeper.cs | 1 + src/Microsoft.ML.Sweeper/Parameters.cs | 1 + src/Microsoft.ML.Sweeper/SweepCommand.cs | 1 + .../SweepResultEvaluator.cs | 1 + src/Microsoft.ML.Sweeper/SynthConfigRunner.cs | 2 +- .../TensorFlowStaticExtensions.cs | 1 + .../TensorFlow/Tensor.cs | 3 +- .../TensorFlow/TensorGeneric.cs | 1 + .../TensorFlow/TensorflowUtils.cs | 2 +- .../TensorFlowModel.cs | 3 +- .../TensorflowTransform.cs | 2 +- .../TimeSeriesStatic.cs | 1 + ...AdaptiveSingularSpectrumSequenceModeler.cs | 2 +- src/Microsoft.ML.TimeSeries/EigenUtils.cs | 1 + .../ExponentialAverageTransform.cs | 3 +- src/Microsoft.ML.TimeSeries/FftUtils.cs | 1 + .../IidAnomalyDetectionBase.cs | 2 +- .../IidChangePointDetector.cs | 3 +- .../IidSpikeDetector.cs | 3 +- .../MovingAverageTransform.cs | 2 +- .../PValueTransform.cs | 3 +- .../PercentileThresholdTransform.cs | 5 +- .../PolynomialUtils.cs | 1 + .../PredictionFunction.cs | 21 +- .../SequenceModelerBase.cs | 1 - ...SequentialAnomalyDetectionTransformBase.cs | 900 +++++++++--------- .../SequentialTransformBase.cs | 3 +- .../SequentialTransformerBase.cs | 4 +- .../SlidingWindowTransform.cs | 2 +- .../SlidingWindowTransformBase.cs | 21 +- .../SsaAnomalyDetectionBase.cs | 26 +- .../SsaChangePointDetector.cs | 3 +- .../SsaSpikeDetector.cs | 3 +- .../TimeSeriesProcessing.cs | 1 + .../TimeSeriesUtils.cs | 1 + .../TrajectoryMatrix.cs | 1 + .../CompositeTransformer.cs | 2 +- .../CountFeatureSelection.cs | 1 + .../CustomMappingFactory.cs | 2 +- .../CustomMappingTransformer.cs | 2 +- .../EntryPoints/SelectFeatures.cs | 1 + .../EntryPoints/TextAnalytics.cs | 1 + .../FourierDistributionSampler.cs | 1 + src/Microsoft.ML.Transforms/GcnTransform.cs | 1 + src/Microsoft.ML.Transforms/GroupTransform.cs | 2 +- .../HashJoiningTransform.cs | 1 + .../KeyToVectorMapping.cs | 1 + .../LambdaTransform.cs | 2 +- .../LearnerFeatureSelection.cs | 2 +- src/Microsoft.ML.Transforms/LoadTransform.cs | 1 + .../MissingValueDroppingTransformer.cs | 3 +- .../MissingValueHandlingTransformer.cs | 2 +- .../MissingValueIndicatorTransform.cs | 2 +- .../MissingValueIndicatorTransformer.cs | 3 +- .../MissingValueReplacing.cs | 7 +- .../MissingValueReplacingUtils.cs | 2 +- .../MutualInformationFeatureSelection.cs | 2 +- src/Microsoft.ML.Transforms/NAHandling.cs | 1 + src/Microsoft.ML.Transforms/OneHotEncoding.cs | 2 +- .../OneHotHashEncoding.cs | 2 +- .../OptionalColumnTransform.cs | 2 +- .../PermutationFeatureImportance.cs | 9 +- .../PermutationFeatureImportanceExtensions.cs | 1 + .../ProduceIdTransform.cs | 2 +- .../RandomFourierFeaturizing.cs | 2 +- .../SerializableLambdaTransform.cs | 2 +- .../StatefulFilterTransform.cs | 1 + .../Text/LdaSingleBox.cs | 1 + .../Text/LdaTransform.cs | 2 +- .../Text/NgramHashingTransformer.cs | 4 +- .../Text/NgramTransform.cs | 3 +- .../Text/NgramUtils.cs | 1 + .../Text/SentimentAnalyzingTransform.cs | 2 +- .../Text/StopWordsRemovingTransformer.cs | 2 +- .../Text/TextCatalog.cs | 2 +- .../Text/TextFeaturizingEstimator.cs | 2 +- .../Text/TextNormalizing.cs | 2 +- .../Text/TokenizingByCharacters.cs | 3 +- .../Text/WordBagTransform.cs | 1 + .../Text/WordEmbeddingsExtractor.cs | 3 +- .../Text/WordHashBagProducingTransform.cs | 3 +- .../Text/WordTokenizing.cs | 3 +- .../Text/WrappedTextTransformers.cs | 3 +- .../UngroupTransform.cs | 2 +- .../BenchmarksTest.cs | 2 - .../CacheDataViewBench.cs | 1 - test/Microsoft.ML.Benchmarks/HashBench.cs | 1 + .../Helpers/CIBenchmark.cs | 1 - .../Helpers/EnvironmentFactory.cs | 1 + .../Helpers/ExecuteMaml.cs | 3 +- .../KMeansAndLogisticRegressionBench.cs | 2 +- .../Numeric/Ranking.cs | 2 +- .../PredictionEngineBench.cs | 1 - .../Text/MultiClassClassification.cs | 2 +- .../Code/ContractsCheckTest.cs | 2 +- .../Code/NameTest.cs | 6 +- .../Helpers/AdditionalMetadataReferences.cs | 1 + .../Resources/BestFriendDeclaration.cs | 2 +- .../BestFriendOnPublicDeclaration.cs | 4 +- .../Resources/BestFriendUser.cs | 2 +- .../Resources/ContractsCheckAfterFix.cs | 4 +- .../Resources/ContractsCheckBeforeFix.cs | 4 +- .../Resources/ContractsCheckResource.cs | 4 +- .../TypeIsSchemaShapeClassResource.cs | 8 +- .../Resources/TypeIsSchemaShapeResource.cs | 6 +- .../TypeIsSchemaShapeResourceChained.cs | 6 +- .../UnitTests/CoreBaseTestClass.cs | 1 + .../UnitTests/TestContracts.cs | 1 + .../UnitTests/TestEntryPoints.cs | 1 + .../UnitTests/TestHosts.cs | 1 + .../UnitTests/TestLoss.cs | 1 + .../UnitTests/TestVBuffer.cs | 1 + .../AvxPerformanceTests.cs | 4 - .../NativePerformanceTests.cs | 5 - .../PerformanceTests.cs | 4 - .../Program.cs | 4 - .../SmallInputCpuMathPerformanceTests.cs | 3 - .../SsePerformanceTests.cs | 4 - test/Microsoft.ML.Functional.Tests/DataIO.cs | 1 - .../Datasets/FeatureContributionOutput.cs | 1 - .../Datasets/TrivialMatrixFactorization.cs | 1 - .../Datasets/TypeTestData.cs | 1 - .../Explainability.cs | 2 - .../OnnxTransformTests.cs | 1 + .../CmdLine/CmdIndenterTest.cs | 1 + .../CmdLine/CmdLine.cs | 1 + .../CmdLine/CmdLineReverseTest.cs | 1 + .../CompareBaselines.cs | 1 + .../TestConcurrency.cs | 2 +- .../TestIniModels.cs | 3 +- .../TestPredictors.cs | 1 + .../TestTransposer.cs | 2 +- .../StaticPipeFakes.cs | 1 + .../StaticPipeTests.cs | 1 - .../Microsoft.ML.Sweeper.Tests/TestSweeper.cs | 1 + ...etCore30OrNotNetCoreAndX64FactAttribute.cs | 1 - ...sThanNetCore30OrNotNetCoreFactAttribute.cs | 1 - .../Attributes/LightGBMFactAttribute.cs | 1 - .../MatrixFactorizationFactAttribute.cs | 1 - .../Attributes/TensorflowFactAttribute.cs | 1 - .../Attributes/X64FactAttribute.cs | 1 - .../BaseTestBaseline.cs | 2 +- .../BaseTestPredictorsMaml.cs | 1 + .../BytesStreamSource.cs | 1 + .../DataPipe/TestDataPipe.cs | 1 + .../DataPipe/TestDataPipeBase.cs | 2 +- .../EnvironmentExtensions.cs | 1 + test/Microsoft.ML.TestFramework/GlobalBase.cs | 1 + test/Microsoft.ML.TestFramework/Learners.cs | 1 + .../SubComponent.cs | 1 + .../TestCommandBase.cs | 1 + .../BinaryLoaderSaverTests.cs | 2 - .../CollectionsDataViewTest.cs | 1 - .../FeatureContributionTests.cs | 1 - test/Microsoft.ML.Tests/ImagesTests.cs | 2 +- test/Microsoft.ML.Tests/OnnxConversionTest.cs | 1 + .../Api/Estimators/MultithreadedPrediction.cs | 1 - .../Api/Estimators/SimpleTrainAndPredict.cs | 1 - .../Scenarios/Api/TestApi.cs | 1 + .../Scenarios/GetColumnTests.cs | 1 + test/Microsoft.ML.Tests/TextLoaderTests.cs | 1 + .../TrainerEstimators/LbfgsTests.cs | 4 +- .../TrainerEstimators/OnlineLinearTests.cs | 2 +- .../SymSgdClassificationTests.cs | 1 + .../TrainerEstimators/TreeEstimators.cs | 1 + .../Transformers/CopyColumnEstimatorTests.cs | 1 + .../Transformers/CustomMappingTests.cs | 1 + .../Transformers/FeatureSelectionTests.cs | 1 - .../Transformers/GroupUngroup.cs | 1 - .../Transformers/NAIndicatorTests.cs | 1 + .../Transformers/NormalizerTests.cs | 1 - .../Transformers/PcaTests.cs | 1 - .../Transformers/TextFeaturizerTests.cs | 1 + .../Transformers/TextNormalizer.cs | 2 - .../Transformers/WordTokenizeTests.cs | 1 - .../RemoteExecutorConsoleApp.cs | 2 - 555 files changed, 1555 insertions(+), 1336 deletions(-) diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/BootstrapSample.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/BootstrapSample.cs index 7e495e37d4..f765cd7729 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/BootstrapSample.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/BootstrapSample.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using Microsoft.ML.Data; namespace Microsoft.ML.Samples.Dynamic { diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/Cache.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/Cache.cs index 87f9bd9338..cab7ab724a 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/Cache.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/Cache.cs @@ -1,6 +1,5 @@ using System; using Microsoft.Data.DataView; -using Microsoft.ML.Data; using Microsoft.ML.SamplesUtils; namespace Microsoft.ML.Samples.Dynamic diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/DataViewEnumerable.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/DataViewEnumerable.cs index 2f2a3172cc..f361762da6 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/DataViewEnumerable.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/DataViewEnumerable.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using Microsoft.Data.DataView; -using Microsoft.ML.Data; using Microsoft.ML.SamplesUtils; namespace Microsoft.ML.Samples.Dynamic diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/FilterRowsByColumn.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/FilterRowsByColumn.cs index c6d75c8097..40a801dda5 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/FilterRowsByColumn.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/FilterRowsByColumn.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using Microsoft.ML.Data; namespace Microsoft.ML.Samples.Dynamic { diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/FilterRowsByMissingValues.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/FilterRowsByMissingValues.cs index 976f4025d8..f1f9c4a21d 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/FilterRowsByMissingValues.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/FilterRowsByMissingValues.cs @@ -1,5 +1,4 @@ using System; -using Microsoft.ML.Data; using Microsoft.ML.SamplesUtils; namespace Microsoft.ML.Samples.Dynamic diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/ShuffleRows.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/ShuffleRows.cs index 92f43c338d..6e88e89cd2 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/ShuffleRows.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/ShuffleRows.cs @@ -1,5 +1,4 @@ using System; -using Microsoft.ML.Data; using Microsoft.ML.SamplesUtils; namespace Microsoft.ML.Samples.Dynamic diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/SkipRows.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/SkipRows.cs index 49f16a50cf..194fff12d1 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/SkipRows.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/SkipRows.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using Microsoft.ML.Data; - namespace Microsoft.ML.Samples.Dynamic { /// diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/TakeRows.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/TakeRows.cs index 2d931ca7af..24b69de0a8 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/TakeRows.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/TakeRows.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using Microsoft.ML.Data; - namespace Microsoft.ML.Samples.Dynamic { /// diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/FastTreeRegression.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/FastTreeRegression.cs index 214435f5d3..49fa66906a 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/FastTreeRegression.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/FastTreeRegression.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using Microsoft.ML.Data; namespace Microsoft.ML.Samples.Dynamic { diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/OnnxTransform.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/OnnxTransform.cs index 7abb12b240..df55942f25 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/OnnxTransform.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/OnnxTransform.cs @@ -2,7 +2,6 @@ using System.Linq; using Microsoft.ML.Data; using Microsoft.ML.OnnxRuntime; -using Microsoft.ML.Transforms; namespace Microsoft.ML.Samples.Dynamic { diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/StopWordRemoverTransform.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/StopWordRemoverTransform.cs index 9eee1ff76e..33a7fc5fd4 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/StopWordRemoverTransform.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/StopWordRemoverTransform.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using Microsoft.ML.Data; -using Microsoft.ML.Transforms.Text; namespace Microsoft.ML.Samples.Dynamic { diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/TensorFlow/TextClassification.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/TensorFlow/TextClassification.cs index 6f2ad0217b..e4f2c36064 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/TensorFlow/TextClassification.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/TensorFlow/TextClassification.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.ML.Data; -using Microsoft.ML.Transforms.TensorFlow; namespace Microsoft.ML.Samples.Dynamic { diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/LightGbm.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/LightGbm.cs index 1d9e485b31..492802e823 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/LightGbm.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/LightGbm.cs @@ -1,6 +1,4 @@ -using Microsoft.ML.Transforms; - -namespace Microsoft.ML.Samples.Dynamic.Trainers.BinaryClassification +namespace Microsoft.ML.Samples.Dynamic.Trainers.BinaryClassification { public class LightGbm { diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/PriorTrainerSample.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/PriorTrainerSample.cs index 1eadee9777..8cb6fa4515 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/PriorTrainerSample.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/PriorTrainerSample.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.ML.Data; +using Microsoft.ML.Data; namespace Microsoft.ML.Samples.Dynamic { diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticDualCoordinateAscentNonCalibrated.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticDualCoordinateAscentNonCalibrated.cs index 814c66a54a..6824892b6c 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticDualCoordinateAscentNonCalibrated.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticDualCoordinateAscentNonCalibrated.cs @@ -1,6 +1,6 @@ using System; using System.Linq; -using Microsoft.ML.Data; +using Microsoft.ML.Trainers; namespace Microsoft.ML.Samples.Dynamic.Trainers.BinaryClassification { diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticGradientDescent.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticGradientDescent.cs index bbebc47d9a..efcf064a2c 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticGradientDescent.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticGradientDescent.cs @@ -1,6 +1,4 @@ -using Microsoft.ML; - -namespace Microsoft.ML.Samples.Dynamic.Trainers.BinaryClassification +namespace Microsoft.ML.Samples.Dynamic.Trainers.BinaryClassification { public static class StochasticGradientDescent { diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticGradientDescentNonCalibrated.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticGradientDescentNonCalibrated.cs index 4c4097ad38..ef2acb80a4 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticGradientDescentNonCalibrated.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticGradientDescentNonCalibrated.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Microsoft.ML.Samples.Dynamic +namespace Microsoft.ML.Samples.Dynamic { public static class StochasticGradientDescentNonCalibrated { diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticGradientDescentNonCalibratedWithOptions.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticGradientDescentNonCalibratedWithOptions.cs index 4703fa87c7..3c799834d1 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticGradientDescentNonCalibratedWithOptions.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticGradientDescentNonCalibratedWithOptions.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Microsoft.ML.Trainers; +using Microsoft.ML.Trainers; namespace Microsoft.ML.Samples.Dynamic { diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticGradientDescentWithOptions.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticGradientDescentWithOptions.cs index 1d74daba1b..e98aa8af17 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticGradientDescentWithOptions.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticGradientDescentWithOptions.cs @@ -1,5 +1,4 @@ -using Microsoft.ML; -using Microsoft.ML.Trainers; +using Microsoft.ML.Trainers; namespace Microsoft.ML.Samples.Dynamic.Trainers.BinaryClassification { diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/Ranking/LightGbm.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/Ranking/LightGbm.cs index 2e616dfee1..475fbe23c2 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/Ranking/LightGbm.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/Ranking/LightGbm.cs @@ -1,6 +1,4 @@ -using Microsoft.ML; - -namespace Microsoft.ML.Samples.Dynamic.Trainers.Ranking +namespace Microsoft.ML.Samples.Dynamic.Trainers.Ranking { public class LightGbm { diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/CopyColumns.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/CopyColumns.cs index dfc4960b5b..5296c5bd78 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/CopyColumns.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/CopyColumns.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using Microsoft.ML.Data; namespace Microsoft.ML.Samples.Dynamic { diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/CustomMappingSample.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/CustomMappingSample.cs index df10d7fda3..d4b5b5904e 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/CustomMappingSample.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/CustomMappingSample.cs @@ -1,6 +1,4 @@ using System; -using Microsoft.ML.Data; - namespace Microsoft.ML.Samples.Dynamic { public static class CustomMapping diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/DropColumns.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/DropColumns.cs index e968dd881a..bcc812bee3 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/DropColumns.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/DropColumns.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using Microsoft.ML.Data; namespace Microsoft.ML.Samples.Dynamic { diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/SelectColumns.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/SelectColumns.cs index 7a80ecb6be..9f365694cc 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/SelectColumns.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/SelectColumns.cs @@ -1,6 +1,4 @@ using System; -using Microsoft.ML.Data; - namespace Microsoft.ML.Samples.Dynamic { public static class SelectColumns diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMapping.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMapping.cs index 4c34ef17b4..88d2e3849e 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMapping.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMapping.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; using Microsoft.Data.DataView; -using Microsoft.ML.Data; - namespace Microsoft.ML.Samples.Dynamic { public static partial class ValueMapping diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingFloatToString.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingFloatToString.cs index 1375b9cf54..368e486890 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingFloatToString.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingFloatToString.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; using Microsoft.Data.DataView; -using Microsoft.ML.Data; - namespace Microsoft.ML.Samples.Dynamic { public static class ValueMappingFloatToString diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingStringToArray.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingStringToArray.cs index b3ede112c4..c1b3fffb15 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingStringToArray.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingStringToArray.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using Microsoft.Data.DataView; - namespace Microsoft.ML.Samples.Dynamic { public static class ValueMappingStringToArray diff --git a/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingStringToKeyType.cs b/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingStringToKeyType.cs index 0c77474670..3024ae0c55 100644 --- a/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingStringToKeyType.cs +++ b/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingStringToKeyType.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using Microsoft.Data.DataView; - namespace Microsoft.ML.Samples.Dynamic { public static class ValueMappingStringToKeyType diff --git a/docs/samples/Microsoft.ML.Samples/Static/FastTreeBinaryClassification.cs b/docs/samples/Microsoft.ML.Samples/Static/FastTreeBinaryClassification.cs index 0480ec5015..c9835cd0ff 100644 --- a/docs/samples/Microsoft.ML.Samples/Static/FastTreeBinaryClassification.cs +++ b/docs/samples/Microsoft.ML.Samples/Static/FastTreeBinaryClassification.cs @@ -1,5 +1,4 @@ using System; -using Microsoft.ML.Data; using Microsoft.ML.StaticPipe; namespace Microsoft.ML.Samples.Static diff --git a/docs/samples/Microsoft.ML.Samples/Static/FastTreeRegression.cs b/docs/samples/Microsoft.ML.Samples/Static/FastTreeRegression.cs index 8be77fae91..b2fc20047d 100644 --- a/docs/samples/Microsoft.ML.Samples/Static/FastTreeRegression.cs +++ b/docs/samples/Microsoft.ML.Samples/Static/FastTreeRegression.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using Microsoft.ML.Data; using Microsoft.ML.StaticPipe; using Microsoft.ML.Trainers.FastTree; diff --git a/docs/samples/Microsoft.ML.Samples/Static/LightGBMBinaryClassification.cs b/docs/samples/Microsoft.ML.Samples/Static/LightGBMBinaryClassification.cs index 5228c356dc..90fa57e933 100644 --- a/docs/samples/Microsoft.ML.Samples/Static/LightGBMBinaryClassification.cs +++ b/docs/samples/Microsoft.ML.Samples/Static/LightGBMBinaryClassification.cs @@ -1,5 +1,4 @@ using System; -using Microsoft.ML.Data; using Microsoft.ML.LightGBM.StaticPipe; using Microsoft.ML.StaticPipe; diff --git a/docs/samples/Microsoft.ML.Samples/Static/LightGBMMulticlassWithInMemoryData.cs b/docs/samples/Microsoft.ML.Samples/Static/LightGBMMulticlassWithInMemoryData.cs index e6415b9e19..67ea5ce8be 100644 --- a/docs/samples/Microsoft.ML.Samples/Static/LightGBMMulticlassWithInMemoryData.cs +++ b/docs/samples/Microsoft.ML.Samples/Static/LightGBMMulticlassWithInMemoryData.cs @@ -1,10 +1,9 @@ -using Microsoft.ML.Data; +using System; +using System.Linq; +using Microsoft.ML.Data; using Microsoft.ML.LightGBM.StaticPipe; using Microsoft.ML.SamplesUtils; using Microsoft.ML.StaticPipe; -using System; -using System.Collections.Generic; -using System.Linq; namespace Microsoft.ML.Samples.Static { diff --git a/docs/samples/Microsoft.ML.Samples/Static/SDCARegression.cs b/docs/samples/Microsoft.ML.Samples/Static/SDCARegression.cs index 602a3a5473..e4c7188d30 100644 --- a/docs/samples/Microsoft.ML.Samples/Static/SDCARegression.cs +++ b/docs/samples/Microsoft.ML.Samples/Static/SDCARegression.cs @@ -1,5 +1,4 @@ using System; -using Microsoft.ML.Data; using Microsoft.ML.StaticPipe; using Microsoft.ML.Trainers; diff --git a/src/Microsoft.ML.Core/CommandLine/ArgumentAttribute.cs b/src/Microsoft.ML.Core/CommandLine/ArgumentAttribute.cs index fdc296d7f8..7cd4f9d178 100644 --- a/src/Microsoft.ML.Core/CommandLine/ArgumentAttribute.cs +++ b/src/Microsoft.ML.Core/CommandLine/ArgumentAttribute.cs @@ -4,6 +4,7 @@ using System; using System.Linq; +using Microsoft.ML.Runtime; namespace Microsoft.ML.CommandLine { diff --git a/src/Microsoft.ML.Core/CommandLine/CharCursor.cs b/src/Microsoft.ML.Core/CommandLine/CharCursor.cs index 85a60a7f36..319cc1b367 100644 --- a/src/Microsoft.ML.Core/CommandLine/CharCursor.cs +++ b/src/Microsoft.ML.Core/CommandLine/CharCursor.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.CommandLine { diff --git a/src/Microsoft.ML.Core/CommandLine/CmdLexer.cs b/src/Microsoft.ML.Core/CommandLine/CmdLexer.cs index ce4d6ef4d3..1ac0dcb4a1 100644 --- a/src/Microsoft.ML.Core/CommandLine/CmdLexer.cs +++ b/src/Microsoft.ML.Core/CommandLine/CmdLexer.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Text; +using Microsoft.ML.Runtime; namespace Microsoft.ML.CommandLine { @@ -39,50 +40,50 @@ public void GetToken(StringBuilder bldr) char ch = _curs.ChCur; switch (ch) { - case '{': - if (bldr.Length == ichDst) - GatherCurlyGroup(bldr); - return; - - case '}': - if (bldr.Length == ichDst) - { - bldr.Append(ch); - _curs.ChNext(); - // Naked } is an error. - _error = true; - } - return; + case '{': + if (bldr.Length == ichDst) + GatherCurlyGroup(bldr); + return; - case '=': - if (bldr.Length == ichDst) - { - bldr.Append(ch); - _curs.ChNext(); - } - return; + case '}': + if (bldr.Length == ichDst) + { + bldr.Append(ch); + _curs.ChNext(); + // Naked } is an error. + _error = true; + } + return; - case '\\': - if (_escapes) - { - GatherSlash(bldr, true); - continue; - } - break; + case '=': + if (bldr.Length == ichDst) + { + bldr.Append(ch); + _curs.ChNext(); + } + return; - case '"': - GatherString(bldr, true); - continue; + case '\\': + if (_escapes) + { + GatherSlash(bldr, true); + continue; + } + break; - case '#': - // Since we skipped comments, we should only get here if we've collected something. - Contracts.Assert(bldr.Length > ichDst); - return; + case '"': + GatherString(bldr, true); + continue; - default: - if (char.IsWhiteSpace(ch)) + case '#': + // Since we skipped comments, we should only get here if we've collected something. + Contracts.Assert(bldr.Length > ichDst); return; - break; + + default: + if (char.IsWhiteSpace(ch)) + return; + break; } bldr.Append(ch); @@ -93,7 +94,7 @@ public void GetToken(StringBuilder bldr) public void SkipWhiteSpace() { // Skip comments and whitespace - for (;;) + for (; ; ) { if (char.IsWhiteSpace(_curs.ChCur)) { @@ -124,32 +125,32 @@ private void GatherCurlyGroup(StringBuilder bldr) char ch = _curs.ChCur; switch (ch) { - case '{': - count++; - break; - - case '}': - Contracts.Assert(count > 0); - bldr.Append(ch); - _curs.ChNext(); - if (--count <= 0) - return; - continue; + case '{': + count++; + break; - case '"': - GatherString(bldr, false); - continue; + case '}': + Contracts.Assert(count > 0); + bldr.Append(ch); + _curs.ChNext(); + if (--count <= 0) + return; + continue; - case '\\': - if (_escapes) - { - GatherSlash(bldr, false); + case '"': + GatherString(bldr, false); continue; - } - break; - default: - break; + case '\\': + if (_escapes) + { + GatherSlash(bldr, false); + continue; + } + break; + + default: + break; } bldr.Append(ch); @@ -173,32 +174,32 @@ internal void GatherCurlyContents(StringBuilder bldr) char ch = _curs.ChCur; switch (ch) { - case '{': - count++; - break; - - case '}': - Contracts.Assert(count >= 0); - _curs.ChNext(); - if (--count < 0) - return; - bldr.Append(ch); - continue; + case '{': + count++; + break; - case '"': - GatherString(bldr, false); - continue; + case '}': + Contracts.Assert(count >= 0); + _curs.ChNext(); + if (--count < 0) + return; + bldr.Append(ch); + continue; - case '\\': - if (_escapes) - { - GatherSlash(bldr, count == 0); + case '"': + GatherString(bldr, false); continue; - } - break; - default: - break; + case '\\': + if (_escapes) + { + GatherSlash(bldr, count == 0); + continue; + } + break; + + default: + break; } bldr.Append(ch); @@ -222,24 +223,24 @@ private void GatherSlash(StringBuilder bldr, bool reduce) // This assumes that slash is escaped iff it preceeds a special character switch (_curs.ChCur) { - case '"': - case '{': - case '}': - case '#': - // The escape case. Only keep half the slashes if we're reducing. - bldr.Append('\\', reduce ? cv / 2 : cv); - - // If there are an odd number of slashes, keep the next char. - if ((cv & 1) != 0) - { - bldr.Append(_curs.ChCur); - _curs.ChNext(); - } - break; + case '"': + case '{': + case '}': + case '#': + // The escape case. Only keep half the slashes if we're reducing. + bldr.Append('\\', reduce ? cv / 2 : cv); + + // If there are an odd number of slashes, keep the next char. + if ((cv & 1) != 0) + { + bldr.Append(_curs.ChCur); + _curs.ChNext(); + } + break; - default: - bldr.Append('\\', cv); - break; + default: + bldr.Append('\\', cv); + break; } } @@ -255,25 +256,25 @@ private void GatherString(StringBuilder bldr, bool reduce) char ch = _curs.ChCur; switch (ch) { - case '"': - if (!reduce) - bldr.Append(_curs.ChCur); - _curs.ChNext(); - return; + case '"': + if (!reduce) + bldr.Append(_curs.ChCur); + _curs.ChNext(); + return; - case '\\': - if (_escapes) - { - GatherSlash(bldr, reduce); - continue; - } - break; + case '\\': + if (_escapes) + { + GatherSlash(bldr, reduce); + continue; + } + break; - case '\x0D': - case '\x0A': - // Hitting end of line is an error. - _error = true; - return; + case '\x0D': + case '\x0A': + // Hitting end of line is an error. + _error = true; + return; } bldr.Append(ch); @@ -488,22 +489,22 @@ private void QuoteValueCore() char ch = _str[_ich++]; switch (ch) { - default: - _sb.Append(ch); - break; + default: + _sb.Append(ch); + break; - // REVIEW: We need a proper grammar for quoting/unquoting! - case '{': - case '}': - case '"': - case '#': - _sb.Append('\\'); - _sb.Append(ch); - break; + // REVIEW: We need a proper grammar for quoting/unquoting! + case '{': + case '}': + case '"': + case '#': + _sb.Append('\\'); + _sb.Append(ch); + break; - case '\\': - HandleSlash(); - break; + case '\\': + HandleSlash(); + break; } } _sb.Append("}"); @@ -530,19 +531,19 @@ private void HandleSlash() switch (_str[_ich]) { - case '{': - case '}': - case '"': - case '#': - // Double the slashes, add one, and digest the special character. - _sb.Append('\\', 2 * count + 1); - _sb.Append(_str[_ich++]); - break; - - default: - // Just preserve the slashes. - _sb.Append('\\', count); - break; + case '{': + case '}': + case '"': + case '#': + // Double the slashes, add one, and digest the special character. + _sb.Append('\\', 2 * count + 1); + _sb.Append(_str[_ich++]); + break; + + default: + // Just preserve the slashes. + _sb.Append('\\', count); + break; } } } diff --git a/src/Microsoft.ML.Core/ComponentModel/LoadableClassAttribute.cs b/src/Microsoft.ML.Core/ComponentModel/LoadableClassAttribute.cs index 7e8ea83e73..f29c8b206e 100644 --- a/src/Microsoft.ML.Core/ComponentModel/LoadableClassAttribute.cs +++ b/src/Microsoft.ML.Core/ComponentModel/LoadableClassAttribute.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Reflection; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Core/Data/DataKind.cs b/src/Microsoft.ML.Core/Data/DataKind.cs index 7830ee744a..039d70936b 100644 --- a/src/Microsoft.ML.Core/Data/DataKind.cs +++ b/src/Microsoft.ML.Core/Data/DataKind.cs @@ -4,7 +4,7 @@ using System; using Microsoft.Data.DataView; - +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { /// diff --git a/src/Microsoft.ML.Core/Data/IEstimator.cs b/src/Microsoft.ML.Core/Data/IEstimator.cs index 8c4d9b85a0..4be506a452 100644 --- a/src/Microsoft.ML.Core/Data/IEstimator.cs +++ b/src/Microsoft.ML.Core/Data/IEstimator.cs @@ -7,6 +7,7 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Core/Data/KeyType.cs b/src/Microsoft.ML.Core/Data/KeyType.cs index 877d2900fc..d70ff261ec 100644 --- a/src/Microsoft.ML.Core/Data/KeyType.cs +++ b/src/Microsoft.ML.Core/Data/KeyType.cs @@ -5,6 +5,7 @@ using System; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Core/Data/ModelHeader.cs b/src/Microsoft.ML.Core/Data/ModelHeader.cs index daabe7b21a..1ca6d4c75b 100644 --- a/src/Microsoft.ML.Core/Data/ModelHeader.cs +++ b/src/Microsoft.ML.Core/Data/ModelHeader.cs @@ -7,6 +7,7 @@ using System.Runtime.InteropServices; using System.Text; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Core/Data/ModelSaving.cs b/src/Microsoft.ML.Core/Data/ModelSaving.cs index 1de0f37640..6023f86bc0 100644 --- a/src/Microsoft.ML.Core/Data/ModelSaving.cs +++ b/src/Microsoft.ML.Core/Data/ModelSaving.cs @@ -5,6 +5,7 @@ using System; using System.IO; using System.Text; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Core/Data/ReadOnlyMemoryUtils.cs b/src/Microsoft.ML.Core/Data/ReadOnlyMemoryUtils.cs index e776701030..5082f106bf 100644 --- a/src/Microsoft.ML.Core/Data/ReadOnlyMemoryUtils.cs +++ b/src/Microsoft.ML.Core/Data/ReadOnlyMemoryUtils.cs @@ -7,6 +7,7 @@ using System.Runtime.InteropServices; using System.Text; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Core/Data/RoleMappedSchema.cs b/src/Microsoft.ML.Core/Data/RoleMappedSchema.cs index 2faecfbd0d..ab239d24ff 100644 --- a/src/Microsoft.ML.Core/Data/RoleMappedSchema.cs +++ b/src/Microsoft.ML.Core/Data/RoleMappedSchema.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Core/Data/VBuffer.cs b/src/Microsoft.ML.Core/Data/VBuffer.cs index 949857bc2b..b0a13479d9 100644 --- a/src/Microsoft.ML.Core/Data/VBuffer.cs +++ b/src/Microsoft.ML.Core/Data/VBuffer.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Core/Data/VBufferEditor.cs b/src/Microsoft.ML.Core/Data/VBufferEditor.cs index 1dafac0fa5..3f5eb5040b 100644 --- a/src/Microsoft.ML.Core/Data/VBufferEditor.cs +++ b/src/Microsoft.ML.Core/Data/VBufferEditor.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Core/Data/VectorType.cs b/src/Microsoft.ML.Core/Data/VectorType.cs index 3643a5b1ff..2963a7bb2e 100644 --- a/src/Microsoft.ML.Core/Data/VectorType.cs +++ b/src/Microsoft.ML.Core/Data/VectorType.cs @@ -8,6 +8,7 @@ using System.Text; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Core/Data/WrappingRow.cs b/src/Microsoft.ML.Core/Data/WrappingRow.cs index ceadf345c2..3e71c7d86f 100644 --- a/src/Microsoft.ML.Core/Data/WrappingRow.cs +++ b/src/Microsoft.ML.Core/Data/WrappingRow.cs @@ -4,6 +4,7 @@ using System; using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Core/EntryPoints/EntryPointModuleAttribute.cs b/src/Microsoft.ML.Core/EntryPoints/EntryPointModuleAttribute.cs index 175e7cb09a..dc3eb7e6ab 100644 --- a/src/Microsoft.ML.Core/EntryPoints/EntryPointModuleAttribute.cs +++ b/src/Microsoft.ML.Core/EntryPoints/EntryPointModuleAttribute.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System; - namespace Microsoft.ML.EntryPoints { /// diff --git a/src/Microsoft.ML.Core/EntryPoints/ModuleArgs.cs b/src/Microsoft.ML.Core/EntryPoints/ModuleArgs.cs index 2019bbd10f..7e6c4c7e72 100644 --- a/src/Microsoft.ML.Core/EntryPoints/ModuleArgs.cs +++ b/src/Microsoft.ML.Core/EntryPoints/ModuleArgs.cs @@ -8,6 +8,7 @@ using System.Text; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.EntryPoints { diff --git a/src/Microsoft.ML.Core/Environment/TelemetryMessage.cs b/src/Microsoft.ML.Core/Environment/TelemetryMessage.cs index 5501a99090..677b26bc64 100644 --- a/src/Microsoft.ML.Core/Environment/TelemetryMessage.cs +++ b/src/Microsoft.ML.Core/Environment/TelemetryMessage.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Core/Prediction/TrainContext.cs b/src/Microsoft.ML.Core/Prediction/TrainContext.cs index 13c619e0d7..8343d21abb 100644 --- a/src/Microsoft.ML.Core/Prediction/TrainContext.cs +++ b/src/Microsoft.ML.Core/Prediction/TrainContext.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Core/Utilities/BigArray.cs b/src/Microsoft.ML.Core/Utilities/BigArray.cs index bda630cbc0..32b56a3eb7 100644 --- a/src/Microsoft.ML.Core/Utilities/BigArray.cs +++ b/src/Microsoft.ML.Core/Utilities/BigArray.cs @@ -5,6 +5,7 @@ using System; using System.Collections; using System.Collections.Generic; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { @@ -331,45 +332,45 @@ public void AddRange(ReadOnlySpan src) Utils.EnsureSize(ref _entries, maMax + 1, BlockSize); switch (maMax - maMin) { - case 0: - // Spans only one subarray, most common case and simplest implementation. - Contracts.Assert(miLim - miMin == src.Length); - Utils.EnsureSize(ref _entries[maMax], maMax >= FullAllocationBeyond ? BlockSize : miLim, BlockSize); - src.CopyTo(_entries[maMax].AsSpan(miMin)); - break; - case 1: - // Spans two subarrays. - Contracts.Assert((BlockSize - miMin) + miLim == src.Length); - Utils.EnsureSize(ref _entries[maMin], BlockSize, BlockSize); - int firstSubArrayCapacity = BlockSize - miMin; - src.Slice(0, firstSubArrayCapacity).CopyTo(_entries[maMin].AsSpan(miMin)); - Contracts.Assert(_entries[maMax] == null); - Utils.EnsureSize(ref _entries[maMax], maMax >= FullAllocationBeyond ? BlockSize : miLim, BlockSize); - src.Slice(firstSubArrayCapacity, miLim).CopyTo(_entries[maMax]); - break; - default: - // Spans three or more subarrays. Very rare. - int miSubMin = miMin; - - // Copy the first segment. - Utils.EnsureSize(ref _entries[maMin], BlockSize, BlockSize); - int srcSoFar = BlockSize - miMin; - src.Slice(0, srcSoFar).CopyTo(_entries[maMin].AsSpan(miMin)); - // Copy the internal segments. - for (int major = maMin + 1; major < maMax; ++major) - { - Contracts.Assert(_entries[major] == null); - _entries[major] = new T[BlockSize]; - src.Slice(srcSoFar, BlockSize).CopyTo(_entries[major]); - srcSoFar += BlockSize; - Contracts.Assert(srcSoFar < src.Length); - } - // Copy the last segment. - Contracts.Assert(src.Length - srcSoFar == miLim); - Contracts.Assert(_entries[maMax] == null); - Utils.EnsureSize(ref _entries[maMax], maMax >= FullAllocationBeyond ? BlockSize : miLim, BlockSize); - src.Slice(srcSoFar, miLim).CopyTo(_entries[maMax]); - break; + case 0: + // Spans only one subarray, most common case and simplest implementation. + Contracts.Assert(miLim - miMin == src.Length); + Utils.EnsureSize(ref _entries[maMax], maMax >= FullAllocationBeyond ? BlockSize : miLim, BlockSize); + src.CopyTo(_entries[maMax].AsSpan(miMin)); + break; + case 1: + // Spans two subarrays. + Contracts.Assert((BlockSize - miMin) + miLim == src.Length); + Utils.EnsureSize(ref _entries[maMin], BlockSize, BlockSize); + int firstSubArrayCapacity = BlockSize - miMin; + src.Slice(0, firstSubArrayCapacity).CopyTo(_entries[maMin].AsSpan(miMin)); + Contracts.Assert(_entries[maMax] == null); + Utils.EnsureSize(ref _entries[maMax], maMax >= FullAllocationBeyond ? BlockSize : miLim, BlockSize); + src.Slice(firstSubArrayCapacity, miLim).CopyTo(_entries[maMax]); + break; + default: + // Spans three or more subarrays. Very rare. + int miSubMin = miMin; + + // Copy the first segment. + Utils.EnsureSize(ref _entries[maMin], BlockSize, BlockSize); + int srcSoFar = BlockSize - miMin; + src.Slice(0, srcSoFar).CopyTo(_entries[maMin].AsSpan(miMin)); + // Copy the internal segments. + for (int major = maMin + 1; major < maMax; ++major) + { + Contracts.Assert(_entries[major] == null); + _entries[major] = new T[BlockSize]; + src.Slice(srcSoFar, BlockSize).CopyTo(_entries[major]); + srcSoFar += BlockSize; + Contracts.Assert(srcSoFar < src.Length); + } + // Copy the last segment. + Contracts.Assert(src.Length - srcSoFar == miLim); + Contracts.Assert(_entries[maMax] == null); + Utils.EnsureSize(ref _entries[maMax], maMax >= FullAllocationBeyond ? BlockSize : miLim, BlockSize); + src.Slice(srcSoFar, miLim).CopyTo(_entries[maMax]); + break; } _length += src.Length; } @@ -400,41 +401,41 @@ public void CopyTo(long idx, Span dst, int length) Contracts.Assert(maMin <= maMax); // Could happen if length == 0, but we already took care of this. switch (maMax - maMin) { - case 0: - // Spans only one subarray, most common case and simplest implementation. - Contracts.Assert(miLim - miMin == length); - Contracts.Assert(miLim <= Utils.Size(_entries[maMax])); - _entries[maMax].AsSpan(miMin, length).CopyTo(dst); - break; - case 1: - // Spans two subarrays. - Contracts.Assert((BlockSize - miMin) + miLim == length); - Contracts.Assert(BlockSize <= Utils.Size(_entries[maMin])); - _entries[maMin].AsSpan(miMin, BlockSize - miMin).CopyTo(dst); - Contracts.Assert(miLim <= Utils.Size(_entries[maMax])); - _entries[maMax].AsSpan(0, miLim).CopyTo(dst.Slice(BlockSize - miMin)); - break; - default: - // Spans three or more subarrays. Very rare. - int miSubMin = miMin; - - // Copy the first segment. - Contracts.Assert(BlockSize <= Utils.Size(_entries[maMin])); - int dstSoFar = BlockSize - miMin; - _entries[maMin].AsSpan(miMin, dstSoFar).CopyTo(dst); - // Copy the internal segments. - for (int major = maMin + 1; major < maMax; ++major) - { - Contracts.Assert(BlockSize <= Utils.Size(_entries[major])); - _entries[major].AsSpan(0, BlockSize).CopyTo(dst.Slice(dstSoFar)); - dstSoFar += BlockSize; - Contracts.Assert(dstSoFar < length); - } - // Copy the last segment. - Contracts.Assert(length - dstSoFar == miLim); - Contracts.Assert(miLim <= Utils.Size(_entries[maMax])); - _entries[maMax].AsSpan(0, miLim).CopyTo(dst.Slice(dstSoFar)); - break; + case 0: + // Spans only one subarray, most common case and simplest implementation. + Contracts.Assert(miLim - miMin == length); + Contracts.Assert(miLim <= Utils.Size(_entries[maMax])); + _entries[maMax].AsSpan(miMin, length).CopyTo(dst); + break; + case 1: + // Spans two subarrays. + Contracts.Assert((BlockSize - miMin) + miLim == length); + Contracts.Assert(BlockSize <= Utils.Size(_entries[maMin])); + _entries[maMin].AsSpan(miMin, BlockSize - miMin).CopyTo(dst); + Contracts.Assert(miLim <= Utils.Size(_entries[maMax])); + _entries[maMax].AsSpan(0, miLim).CopyTo(dst.Slice(BlockSize - miMin)); + break; + default: + // Spans three or more subarrays. Very rare. + int miSubMin = miMin; + + // Copy the first segment. + Contracts.Assert(BlockSize <= Utils.Size(_entries[maMin])); + int dstSoFar = BlockSize - miMin; + _entries[maMin].AsSpan(miMin, dstSoFar).CopyTo(dst); + // Copy the internal segments. + for (int major = maMin + 1; major < maMax; ++major) + { + Contracts.Assert(BlockSize <= Utils.Size(_entries[major])); + _entries[major].AsSpan(0, BlockSize).CopyTo(dst.Slice(dstSoFar)); + dstSoFar += BlockSize; + Contracts.Assert(dstSoFar < length); + } + // Copy the last segment. + Contracts.Assert(length - dstSoFar == miLim); + Contracts.Assert(miLim <= Utils.Size(_entries[maMax])); + _entries[maMax].AsSpan(0, miLim).CopyTo(dst.Slice(dstSoFar)); + break; } } diff --git a/src/Microsoft.ML.Core/Utilities/BinFinder.cs b/src/Microsoft.ML.Core/Utilities/BinFinder.cs index 2120b503e3..81b1d01dc8 100644 --- a/src/Microsoft.ML.Core/Utilities/BinFinder.cs +++ b/src/Microsoft.ML.Core/Utilities/BinFinder.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { @@ -598,7 +599,7 @@ protected override void FindBinsCore(List counts, int[] path) // Row zero is special. EnergyType bestWorst = EnergyType.MaxValue; - for (int col = width; --col >= 0; ) + for (int col = width; --col >= 0;) { _energies[col] = Square(_accum[1 + col]); EnergyType worst; @@ -625,7 +626,7 @@ protected override void FindBinsCore(List counts, int[] path) for (int row = 1; row < height; row++) { Contracts.Assert(ivBase == (row - 1) * width); - for (int col = width; --col >= colMin; ) + for (int col = width; --col >= colMin;) { int accum = _accum[row + 1 + col]; eBest = EnergyType.MaxValue; @@ -696,7 +697,7 @@ protected override void FindBinsCore(List counts, int[] path) // Fill in the rest of the path. ivBase = (height - 1) * width; - for (int row = height; --row > 0; ) + for (int row = height; --row > 0;) { // Recall that the _pathInfo table doesn't have row zero. ivBase -= width; diff --git a/src/Microsoft.ML.Core/Utilities/BitUtils.cs b/src/Microsoft.ML.Core/Utilities/BitUtils.cs index d1633ec236..e138d1f148 100644 --- a/src/Microsoft.ML.Core/Utilities/BitUtils.cs +++ b/src/Microsoft.ML.Core/Utilities/BitUtils.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Runtime.CompilerServices; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { @@ -21,7 +22,7 @@ public static ulong MakeUlong(uint uHi, uint uLo) [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint GetLo(ulong uu) { - return (uint)uu; + return (uint)uu; } [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/Microsoft.ML.Core/Utilities/DoubleParser.cs b/src/Microsoft.ML.Core/Utilities/DoubleParser.cs index 695c1981be..bad57cdd3c 100644 --- a/src/Microsoft.ML.Core/Utilities/DoubleParser.cs +++ b/src/Microsoft.ML.Core/Utilities/DoubleParser.cs @@ -5,6 +5,7 @@ #undef COMPARE_BCL using System; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { @@ -468,50 +469,50 @@ private static bool TryParseSpecial(ReadOnlySpan span, ref int ich, out Si { switch (span[ich]) { - case '?': - // We also interpret ? to mean NaN. - value = Single.NaN; - ich += 1; - return true; - - case 'N': - if (ich + 3 <= span.Length && span[ich + 1] == 'a' && span[ich + 2] == 'N') - { + case '?': + // We also interpret ? to mean NaN. value = Single.NaN; - ich += 3; + ich += 1; return true; - } - break; - case 'I': - if (ich + 8 <= span.Length && span[ich + 1] == 'n' && span[ich + 2] == 'f' && span[ich + 3] == 'i' && span[ich + 4] == 'n' && span[ich + 5] == 'i' && span[ich + 6] == 't' && span[ich + 7] == 'y') - { + case 'N': + if (ich + 3 <= span.Length && span[ich + 1] == 'a' && span[ich + 2] == 'N') + { + value = Single.NaN; + ich += 3; + return true; + } + break; + + case 'I': + if (ich + 8 <= span.Length && span[ich + 1] == 'n' && span[ich + 2] == 'f' && span[ich + 3] == 'i' && span[ich + 4] == 'n' && span[ich + 5] == 'i' && span[ich + 6] == 't' && span[ich + 7] == 'y') + { + value = Single.PositiveInfinity; + ich += 8; + return true; + } + break; + + case '-': + if (ich + 2 <= span.Length && span[ich + 1] == InfinitySymbol) + { + value = Single.NegativeInfinity; + ich += 2; + return true; + } + + if (ich + 9 <= span.Length && span[ich + 1] == 'I' && span[ich + 2] == 'n' && span[ich + 3] == 'f' && span[ich + 4] == 'i' && span[ich + 5] == 'n' && span[ich + 6] == 'i' && span[ich + 7] == 't' && span[ich + 8] == 'y') + { + value = Single.NegativeInfinity; + ich += 9; + return true; + } + break; + + case InfinitySymbol: value = Single.PositiveInfinity; - ich += 8; + ich += 1; return true; - } - break; - - case '-': - if (ich + 2 <= span.Length && span[ich + 1] == InfinitySymbol) - { - value = Single.NegativeInfinity; - ich += 2; - return true; - } - - if (ich + 9 <= span.Length && span[ich + 1] == 'I' && span[ich + 2] == 'n' && span[ich + 3] == 'f' && span[ich + 4] == 'i' && span[ich + 5] == 'n' && span[ich + 6] == 'i' && span[ich + 7] == 't' && span[ich + 8] == 'y') - { - value = Single.NegativeInfinity; - ich += 9; - return true; - } - break; - - case InfinitySymbol: - value = Single.PositiveInfinity; - ich += 1; - return true; } } @@ -539,35 +540,35 @@ private static bool TryParseCore(ReadOnlySpan span, ref int ich, ref bool int i = ich; switch (span[i]) { - default: - return false; - - case '-': - if (++i >= span.Length) + default: return false; - neg = true; - break; - case '+': - if (++i >= span.Length) - return false; - break; + case '-': + if (++i >= span.Length) + return false; + neg = true; + break; - case '.': - goto LPoint; + case '+': + if (++i >= span.Length) + return false; + break; - // The common cases. - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - break; + case '.': + goto LPoint; + + // The common cases. + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + break; } // Get digits before '.' @@ -595,7 +596,7 @@ private static bool TryParseCore(ReadOnlySpan span, ref int ich, ref bool if (span[i] != '.') goto LAfterDigits; - LPoint: + LPoint: Contracts.Assert(i < span.Length); Contracts.Assert(span[i] == '.'); @@ -632,14 +633,14 @@ private static bool TryParseCore(ReadOnlySpan span, ref int ich, ref bool // Check for an exponent. switch (span[i]) { - default: - return true; - - case 'e': - case 'E': - if (++i >= span.Length) + default: return true; - break; + + case 'e': + case 'E': + if (++i >= span.Length) + return true; + break; } // Handle the exponent sign. @@ -647,15 +648,15 @@ private static bool TryParseCore(ReadOnlySpan span, ref int ich, ref bool Contracts.Assert(i < span.Length); switch (span[i]) { - case '-': - if (++i >= span.Length) - return true; - expNeg = true; - break; - case '+': - if (++i >= span.Length) - return true; - break; + case '-': + if (++i >= span.Length) + return true; + expNeg = true; + break; + case '+': + if (++i >= span.Length) + return true; + break; } // If the exponent exceeds this, the result will be infinite or zero diff --git a/src/Microsoft.ML.Core/Utilities/FixedSizeQueue.cs b/src/Microsoft.ML.Core/Utilities/FixedSizeQueue.cs index ab2d938d22..f63594afd1 100644 --- a/src/Microsoft.ML.Core/Utilities/FixedSizeQueue.cs +++ b/src/Microsoft.ML.Core/Utilities/FixedSizeQueue.cs @@ -2,8 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using Microsoft.ML.Runtime; + namespace Microsoft.ML.Internal.Utilities { + using Conditional = System.Diagnostics.ConditionalAttribute; /// diff --git a/src/Microsoft.ML.Core/Utilities/FloatUtils.cs b/src/Microsoft.ML.Core/Utilities/FloatUtils.cs index b93541eb3e..eaf36000fe 100644 --- a/src/Microsoft.ML.Core/Utilities/FloatUtils.cs +++ b/src/Microsoft.ML.Core/Utilities/FloatUtils.cs @@ -5,6 +5,7 @@ using System; using System.Globalization; using System.Runtime.InteropServices; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Core/Utilities/HashArray.cs b/src/Microsoft.ML.Core/Utilities/HashArray.cs index c9f31b5361..492e2c3a4a 100644 --- a/src/Microsoft.ML.Core/Utilities/HashArray.cs +++ b/src/Microsoft.ML.Core/Utilities/HashArray.cs @@ -5,6 +5,7 @@ //#define DUMP_STATS using System; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Core/Utilities/Hashing.cs b/src/Microsoft.ML.Core/Utilities/Hashing.cs index ff64fbb222..4438293317 100644 --- a/src/Microsoft.ML.Core/Utilities/Hashing.cs +++ b/src/Microsoft.ML.Core/Utilities/Hashing.cs @@ -5,6 +5,7 @@ using System; using System.Runtime.CompilerServices; using System.Text; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Core/Utilities/Heap.cs b/src/Microsoft.ML.Core/Utilities/Heap.cs index fe1178abd3..3d54f7fda3 100644 --- a/src/Microsoft.ML.Core/Utilities/Heap.cs +++ b/src/Microsoft.ML.Core/Utilities/Heap.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Core/Utilities/HybridMemoryStream.cs b/src/Microsoft.ML.Core/Utilities/HybridMemoryStream.cs index c1db619510..8e5c2ede92 100644 --- a/src/Microsoft.ML.Core/Utilities/HybridMemoryStream.cs +++ b/src/Microsoft.ML.Core/Utilities/HybridMemoryStream.cs @@ -4,6 +4,7 @@ using System; using System.IO; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { @@ -29,7 +30,8 @@ internal sealed class HybridMemoryStream : Stream private bool IsMemory => _memStream != null; - public override long Position { + public override long Position + { get => MyStream.Position; set => Seek(value, SeekOrigin.Begin); } diff --git a/src/Microsoft.ML.Core/Utilities/LruCache.cs b/src/Microsoft.ML.Core/Utilities/LruCache.cs index ad874b60c1..1660f93598 100644 --- a/src/Microsoft.ML.Core/Utilities/LruCache.cs +++ b/src/Microsoft.ML.Core/Utilities/LruCache.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Core/Utilities/MathUtils.cs b/src/Microsoft.ML.Core/Utilities/MathUtils.cs index 9dce866bb4..258f9db212 100644 --- a/src/Microsoft.ML.Core/Utilities/MathUtils.cs +++ b/src/Microsoft.ML.Core/Utilities/MathUtils.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { @@ -511,7 +512,7 @@ public static float SigmoidSlow(float x) else { var ex = ExpSlow(x); - return ex / (1 + ex); + return ex / (1 + ex); } } diff --git a/src/Microsoft.ML.Core/Utilities/MatrixTransposeOps.cs b/src/Microsoft.ML.Core/Utilities/MatrixTransposeOps.cs index 2e25599c1d..bb69f9a38e 100644 --- a/src/Microsoft.ML.Core/Utilities/MatrixTransposeOps.cs +++ b/src/Microsoft.ML.Core/Utilities/MatrixTransposeOps.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Core/Utilities/MinWaiter.cs b/src/Microsoft.ML.Core/Utilities/MinWaiter.cs index 8a671ab817..e45e5a27f9 100644 --- a/src/Microsoft.ML.Core/Utilities/MinWaiter.cs +++ b/src/Microsoft.ML.Core/Utilities/MinWaiter.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Threading; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Core/Utilities/NormStr.cs b/src/Microsoft.ML.Core/Utilities/NormStr.cs index 9859ea2724..2d18b1673e 100644 --- a/src/Microsoft.ML.Core/Utilities/NormStr.cs +++ b/src/Microsoft.ML.Core/Utilities/NormStr.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Core/Utilities/OrderedWaiter.cs b/src/Microsoft.ML.Core/Utilities/OrderedWaiter.cs index 5a71c6205d..8dad114a89 100644 --- a/src/Microsoft.ML.Core/Utilities/OrderedWaiter.cs +++ b/src/Microsoft.ML.Core/Utilities/OrderedWaiter.cs @@ -4,6 +4,7 @@ using System; using System.Threading; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Core/Utilities/PathUtils.cs b/src/Microsoft.ML.Core/Utilities/PathUtils.cs index 0ffd5bfd3e..8711548fb7 100644 --- a/src/Microsoft.ML.Core/Utilities/PathUtils.cs +++ b/src/Microsoft.ML.Core/Utilities/PathUtils.cs @@ -5,6 +5,7 @@ using System; using System.IO; using System.Threading; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Core/Utilities/PlatformUtils.cs b/src/Microsoft.ML.Core/Utilities/PlatformUtils.cs index 16cadbdb5b..5b9237fc24 100644 --- a/src/Microsoft.ML.Core/Utilities/PlatformUtils.cs +++ b/src/Microsoft.ML.Core/Utilities/PlatformUtils.cs @@ -5,6 +5,7 @@ using System; using System.Collections.ObjectModel; using System.Reflection; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Core/Utilities/Random.cs b/src/Microsoft.ML.Core/Utilities/Random.cs index c79a22426b..ceff4eab4f 100644 --- a/src/Microsoft.ML.Core/Utilities/Random.cs +++ b/src/Microsoft.ML.Core/Utilities/Random.cs @@ -5,6 +5,7 @@ using System; using System.IO; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Core/Utilities/ReservoirSampler.cs b/src/Microsoft.ML.Core/Utilities/ReservoirSampler.cs index 6a1e974f92..fa6b0f5e16 100644 --- a/src/Microsoft.ML.Core/Utilities/ReservoirSampler.cs +++ b/src/Microsoft.ML.Core/Utilities/ReservoirSampler.cs @@ -6,8 +6,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Data.DataView; -using Microsoft.ML.Data; - +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { /// @@ -204,7 +203,7 @@ public void Sample() _counts[_reservoir[ind]]++; _getter(ref _cache[_reservoir[ind]]); - for (int j = 1; j < k; ) + for (int j = 1; j < k;) { var next = _rnd.Next(_reservoir.Length); if (_reservoir[next] == _reservoir[ind]) diff --git a/src/Microsoft.ML.Core/Utilities/Stats.cs b/src/Microsoft.ML.Core/Utilities/Stats.cs index 35b21d8cf0..a717e9a5b0 100644 --- a/src/Microsoft.ML.Core/Utilities/Stats.cs +++ b/src/Microsoft.ML.Core/Utilities/Stats.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { @@ -41,7 +42,7 @@ public static long SampleLong(long rangeSize, Random rand) return result; } - private static double _vScale = 2 * Math.Sqrt(2 / Math.E); + private static readonly double _vScale = 2 * Math.Sqrt(2 / Math.E); /// /// Returns a number sampled from a zero-mean, unit variance Gaussian @@ -291,7 +292,7 @@ private static int InvTransform(int n, double p, Random rn) double r = p / q; double a = (n + 1) * r; - for (;;) + for (; ; ) { if (u <= s) break; @@ -329,7 +330,7 @@ private static int GenerateLarge(int n, double p, Random rn) double h = double.NaN; // Step 1 - for (;;) + for (; ; ) { double v = rn.NextDouble(); double u; diff --git a/src/Microsoft.ML.Core/Utilities/Stream.cs b/src/Microsoft.ML.Core/Utilities/Stream.cs index 633ee672f7..f3803d6454 100644 --- a/src/Microsoft.ML.Core/Utilities/Stream.cs +++ b/src/Microsoft.ML.Core/Utilities/Stream.cs @@ -8,6 +8,7 @@ using System.IO; using System.Text; using System.Threading; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Core/Utilities/SubsetStream.cs b/src/Microsoft.ML.Core/Utilities/SubsetStream.cs index 022ca28cb1..9b33ba182e 100644 --- a/src/Microsoft.ML.Core/Utilities/SubsetStream.cs +++ b/src/Microsoft.ML.Core/Utilities/SubsetStream.cs @@ -4,6 +4,7 @@ using System; using System.IO; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Core/Utilities/SupervisedBinFinder.cs b/src/Microsoft.ML.Core/Utilities/SupervisedBinFinder.cs index f640043009..5abef48357 100644 --- a/src/Microsoft.ML.Core/Utilities/SupervisedBinFinder.cs +++ b/src/Microsoft.ML.Core/Utilities/SupervisedBinFinder.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Core/Utilities/TextReaderStream.cs b/src/Microsoft.ML.Core/Utilities/TextReaderStream.cs index 691876c0c7..8a828b8f57 100644 --- a/src/Microsoft.ML.Core/Utilities/TextReaderStream.cs +++ b/src/Microsoft.ML.Core/Utilities/TextReaderStream.cs @@ -5,6 +5,7 @@ using System; using System.IO; using System.Text; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Core/Utilities/Tree.cs b/src/Microsoft.ML.Core/Utilities/Tree.cs index cbec20fe8e..14c3c4f901 100644 --- a/src/Microsoft.ML.Core/Utilities/Tree.cs +++ b/src/Microsoft.ML.Core/Utilities/Tree.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { diff --git a/src/Microsoft.ML.Core/Utilities/Utils.cs b/src/Microsoft.ML.Core/Utilities/Utils.cs index 5f0b47a36b..024724f5a7 100644 --- a/src/Microsoft.ML.Core/Utilities/Utils.cs +++ b/src/Microsoft.ML.Core/Utilities/Utils.cs @@ -12,7 +12,7 @@ using System.Text.RegularExpressions; using System.Threading; using Microsoft.Data.DataView; - +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { @@ -758,7 +758,7 @@ public static bool[] BuildArray(int length, IEnumerable c var result = new bool[length]; foreach (var col in columnsNeeded) { - if(col.Index < result.Length) + if (col.Index < result.Length) result[col.Index] = true; } diff --git a/src/Microsoft.ML.Core/Utilities/VBufferUtils.cs b/src/Microsoft.ML.Core/Utilities/VBufferUtils.cs index 9120ccbedd..747f2abdc9 100644 --- a/src/Microsoft.ML.Core/Utilities/VBufferUtils.cs +++ b/src/Microsoft.ML.Core/Utilities/VBufferUtils.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Internal.Utilities { @@ -437,7 +438,7 @@ public static void Densify(ref VBuffer dst) if (!editor.CreatedNewValues) { // Densify in place. - for (int i = values.Length; --i >= 0; ) + for (int i = values.Length; --i >= 0;) { Contracts.Assert(i <= indices[i]); editor.Values[indices[i]] = values[i]; @@ -505,7 +506,7 @@ public static void DensifyFirst(ref VBuffer dst, int denseCount) editor.Values.Slice(lim, sliceLength).CopyTo(editor.Values.Slice(denseCount)); editor.Indices.Slice(lim, sliceLength).CopyTo(editor.Indices.Slice(denseCount)); int i = lim - 1; - for (int ii = denseCount; --ii >= 0; ) + for (int ii = denseCount; --ii >= 0;) { editor.Values[ii] = i >= 0 && dstIndices[i] == ii ? dstValues[i--] : default(T); editor.Indices[ii] = ii; @@ -828,7 +829,7 @@ private static void ApplyWithCore(in VBuffer src, ref VBuffer< // Go from the end, so that even if we're writing over dst's vectors in // place, we do not corrupt the data as we are reorganizing it. - for (int i = newCount; --i >= 0; ) + for (int i = newCount; --i >= 0;) { if (sIndex < dIndex) { diff --git a/src/Microsoft.ML.Data/Commands/CrossValidationCommand.cs b/src/Microsoft.ML.Data/Commands/CrossValidationCommand.cs index 0c2c36f3f2..718c5ed686 100644 --- a/src/Microsoft.ML.Data/Commands/CrossValidationCommand.cs +++ b/src/Microsoft.ML.Data/Commands/CrossValidationCommand.cs @@ -14,8 +14,8 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Transforms; using Microsoft.ML.Runtime; +using Microsoft.ML.Transforms; [assembly: LoadableClass(typeof(CrossValidationCommand), typeof(CrossValidationCommand.Arguments), typeof(SignatureCommand), "Cross Validation", CrossValidationCommand.LoadName)] diff --git a/src/Microsoft.ML.Data/DataDebuggerPreview.cs b/src/Microsoft.ML.Data/DataDebuggerPreview.cs index 80fc82bfbd..b012d48a5f 100644 --- a/src/Microsoft.ML.Data/DataDebuggerPreview.cs +++ b/src/Microsoft.ML.Data/DataDebuggerPreview.cs @@ -8,6 +8,7 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Data/DataLoadSave/Binary/BinaryLoader.cs b/src/Microsoft.ML.Data/DataLoadSave/Binary/BinaryLoader.cs index 066e21ec3c..5795c214d3 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/Binary/BinaryLoader.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/Binary/BinaryLoader.cs @@ -19,7 +19,6 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; @@ -644,7 +643,7 @@ private DataViewSchema ComputeOutputSchema() { var schemaBuilder = new DataViewSchema.Builder(); - for(int i = 0; i < _aliveColumns.Length; ++i) + for (int i = 0; i < _aliveColumns.Length; ++i) { // Informaiton of a column loaded from a binary file. var loadedColumn = _aliveColumns[i]; @@ -655,7 +654,7 @@ private DataViewSchema ComputeOutputSchema() { // We got some metadata fields here. var metadataBuilder = new DataViewSchema.Annotations.Builder(); - foreach(var loadedMetadataColumn in metadataArray) + foreach (var loadedMetadataColumn in metadataArray) { var metadataGetter = loadedMetadataColumn.GetGetter(); if (metadataGetter == null) diff --git a/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoader.cs b/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoader.cs index fa20833639..8438b2e13b 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoader.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoader.cs @@ -729,7 +729,7 @@ public Bindings(TextLoader parent, Column[] cols, IMultiStreamSource headerFile, } else { - kind = col.Type == default? InternalDataKind.R4 : col.Type; + kind = col.Type == default ? InternalDataKind.R4 : col.Type; ch.CheckUserArg(Enum.IsDefined(typeof(InternalDataKind), kind), nameof(Column.Type), "Bad item type"); itemType = ColumnTypeExtensions.PrimitiveTypeFromKind(kind); } diff --git a/src/Microsoft.ML.Data/Dirty/ChooseColumnsByIndexTransform.cs b/src/Microsoft.ML.Data/Dirty/ChooseColumnsByIndexTransform.cs index 5ff26170bf..cccf446124 100644 --- a/src/Microsoft.ML.Data/Dirty/ChooseColumnsByIndexTransform.cs +++ b/src/Microsoft.ML.Data/Dirty/ChooseColumnsByIndexTransform.cs @@ -10,7 +10,6 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(ChooseColumnsByIndexTransform), typeof(ChooseColumnsByIndexTransform.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Data/EntryPoints/EntryPointNode.cs b/src/Microsoft.ML.Data/EntryPoints/EntryPointNode.cs index 0780612e31..c00cf0747e 100644 --- a/src/Microsoft.ML.Data/EntryPoints/EntryPointNode.cs +++ b/src/Microsoft.ML.Data/EntryPoints/EntryPointNode.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Text.RegularExpressions; using Microsoft.Data.DataView; +using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Runtime; using Newtonsoft.Json; diff --git a/src/Microsoft.ML.Data/Evaluators/BinaryClassifierEvaluator.cs b/src/Microsoft.ML.Data/Evaluators/BinaryClassifierEvaluator.cs index 5d7ac8770e..0e5ace0149 100644 --- a/src/Microsoft.ML.Data/Evaluators/BinaryClassifierEvaluator.cs +++ b/src/Microsoft.ML.Data/Evaluators/BinaryClassifierEvaluator.cs @@ -11,7 +11,6 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; diff --git a/src/Microsoft.ML.Data/Evaluators/EvaluatorBase.cs b/src/Microsoft.ML.Data/Evaluators/EvaluatorBase.cs index 54f7b3b363..6fa652fde7 100644 --- a/src/Microsoft.ML.Data/Evaluators/EvaluatorBase.cs +++ b/src/Microsoft.ML.Data/Evaluators/EvaluatorBase.cs @@ -7,7 +7,6 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Runtime; namespace Microsoft.ML.Data @@ -493,7 +492,7 @@ protected PerInstanceEvaluatorBase(IHostEnvironment env, DataViewSchema schema, throw Host.ExceptSchemaMismatch(nameof(schema), "score", ScoreCol); } - protected PerInstanceEvaluatorBase(IHostEnvironment env, ModelLoadContext ctx, DataViewSchema schema) + protected PerInstanceEvaluatorBase(IHostEnvironment env, ModelLoadContext ctx, DataViewSchema schema) { Host = env.Register("PerInstanceRowMapper"); diff --git a/src/Microsoft.ML.Data/Evaluators/QuantileRegressionEvaluator.cs b/src/Microsoft.ML.Data/Evaluators/QuantileRegressionEvaluator.cs index f3e6bec099..b7994a300b 100644 --- a/src/Microsoft.ML.Data/Evaluators/QuantileRegressionEvaluator.cs +++ b/src/Microsoft.ML.Data/Evaluators/QuantileRegressionEvaluator.cs @@ -11,6 +11,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Runtime; +using Microsoft.ML.Trainers; [assembly: LoadableClass(typeof(QuantileRegressionEvaluator), typeof(QuantileRegressionEvaluator), typeof(QuantileRegressionEvaluator.Arguments), typeof(SignatureEvaluator), "Quantile Regression Evaluator", QuantileRegressionEvaluator.LoadName, "QuantileRegression")] diff --git a/src/Microsoft.ML.Data/Evaluators/RegressionEvaluator.cs b/src/Microsoft.ML.Data/Evaluators/RegressionEvaluator.cs index 46bc68d560..0ddbb63908 100644 --- a/src/Microsoft.ML.Data/Evaluators/RegressionEvaluator.cs +++ b/src/Microsoft.ML.Data/Evaluators/RegressionEvaluator.cs @@ -9,7 +9,6 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; -using Microsoft.ML.Model; using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; @@ -319,7 +318,7 @@ private void CheckInputColumnTypes(DataViewSchema schema) Host.AssertNonEmpty(ScoreCol); Host.AssertNonEmpty(LabelCol); - var t = schema[(int) LabelIndex].Type; + var t = schema[(int)LabelIndex].Type; if (t != NumberDataViewType.Single) throw Host.ExceptSchemaMismatch(nameof(schema), "label", LabelCol, "float", t.ToString()); diff --git a/src/Microsoft.ML.Data/Prediction/Calibrator.cs b/src/Microsoft.ML.Data/Prediction/Calibrator.cs index 26db83e11b..1504149501 100644 --- a/src/Microsoft.ML.Data/Prediction/Calibrator.cs +++ b/src/Microsoft.ML.Data/Prediction/Calibrator.cs @@ -472,7 +472,7 @@ private FeatureWeightsCalibratedModelParameters(IHostEnvironment env, ModelLoadC : base(env, RegistrationName, GetPredictor(env, ctx), GetCalibrator(env, ctx)) { Host.Check(SubModel is IPredictorWithFeatureWeights, "Predictor does not implement " + nameof(IPredictorWithFeatureWeights)); - _featureWeights = (IPredictorWithFeatureWeights)SubModel; + _featureWeights = SubModel; } private static FeatureWeightsCalibratedModelParameters Create(IHostEnvironment env, ModelLoadContext ctx) @@ -1630,13 +1630,13 @@ private void SaveCore(ModelSaveContext ctx) if (ctx.InRepository) { - ctx.SaveTextStream("Calibrator.txt", (Action)(writer => + ctx.SaveTextStream("Calibrator.txt", writer => { writer.WriteLine("Platt calibrator"); writer.WriteLine("P(y=1|x) = 1/1+exp(A*x + B)"); - writer.WriteLine("A={0:R}", (object)Slope); + writer.WriteLine("A={0:R}", Slope); writer.WriteLine("B={0:R}", Offset); - })); + }); } } diff --git a/src/Microsoft.ML.Data/Prediction/CalibratorCatalog.cs b/src/Microsoft.ML.Data/Prediction/CalibratorCatalog.cs index 503f7a9476..9529b98291 100644 --- a/src/Microsoft.ML.Data/Prediction/CalibratorCatalog.cs +++ b/src/Microsoft.ML.Data/Prediction/CalibratorCatalog.cs @@ -143,7 +143,7 @@ public CalibratorTransformer Fit(IDataView input) public abstract class CalibratorTransformer : RowToRowTransformerBase, ISingleFeaturePredictionTransformer where TICalibrator : class, ICalibrator { - private TICalibrator _calibrator; + private readonly TICalibrator _calibrator; private readonly string _loaderSignature; private protected CalibratorTransformer(IHostEnvironment env, TICalibrator calibrator, string loaderSignature) @@ -203,7 +203,7 @@ private sealed class Mapper : MapperBase where TCalibrator : class, ICalibrator { private TCalibrator _calibrator; - private int _scoreColIndex; + private readonly int _scoreColIndex; private CalibratorTransformer _parent; internal Mapper(CalibratorTransformer parent, TCalibrator calibrator, DataViewSchema inputSchema) : diff --git a/src/Microsoft.ML.Data/Transforms/ColumnCopying.cs b/src/Microsoft.ML.Data/Transforms/ColumnCopying.cs index ee06f819c2..0e61fe54e5 100644 --- a/src/Microsoft.ML.Data/Transforms/ColumnCopying.cs +++ b/src/Microsoft.ML.Data/Transforms/ColumnCopying.cs @@ -10,9 +10,7 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; diff --git a/src/Microsoft.ML.Data/Transforms/ColumnSelecting.cs b/src/Microsoft.ML.Data/Transforms/ColumnSelecting.cs index 1598ae955e..624074c870 100644 --- a/src/Microsoft.ML.Data/Transforms/ColumnSelecting.cs +++ b/src/Microsoft.ML.Data/Transforms/ColumnSelecting.cs @@ -10,7 +10,6 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; @@ -693,7 +692,7 @@ public DataViewRowCursor[] GetRowCursorSet(IEnumerable co { var active = new bool[_mapper.InputSchema.Count]; foreach (var column in columns) - active[_mapper.GetInputIndex(column.Index)] = true; + active[_mapper.GetInputIndex(column.Index)] = true; return _mapper.InputSchema.Where(col => col.Index < active.Length && active[col.Index]); } diff --git a/src/Microsoft.ML.Data/Transforms/NormalizeColumn.cs b/src/Microsoft.ML.Data/Transforms/NormalizeColumn.cs index f2320edcb0..6cd4fc42b9 100644 --- a/src/Microsoft.ML.Data/Transforms/NormalizeColumn.cs +++ b/src/Microsoft.ML.Data/Transforms/NormalizeColumn.cs @@ -11,7 +11,6 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; @@ -472,7 +471,7 @@ private void OffsetMetadataGetter(int col, ref VBuffer dst) } public override NormalizingTransformer.NormalizerModelParametersBase GetNormalizerModelParams() - => new NormalizingTransformer.AffineNormalizerModelParameters> (ImmutableArray.Create(Scale), ImmutableArray.Create(Offset)); + => new NormalizingTransformer.AffineNormalizerModelParameters>(ImmutableArray.Create(Scale), ImmutableArray.Create(Offset)); } } diff --git a/src/Microsoft.ML.Data/Transforms/PerGroupTransformBase.cs b/src/Microsoft.ML.Data/Transforms/PerGroupTransformBase.cs index 0faf9f8bcc..34d22a750c 100644 --- a/src/Microsoft.ML.Data/Transforms/PerGroupTransformBase.cs +++ b/src/Microsoft.ML.Data/Transforms/PerGroupTransformBase.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Data.DataView; - +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { /// diff --git a/src/Microsoft.ML.Data/Transforms/RowToRowTransformerBase.cs b/src/Microsoft.ML.Data/Transforms/RowToRowTransformerBase.cs index c7fae8777c..2ba82cc44c 100644 --- a/src/Microsoft.ML.Data/Transforms/RowToRowTransformerBase.cs +++ b/src/Microsoft.ML.Data/Transforms/RowToRowTransformerBase.cs @@ -5,9 +5,7 @@ using System; using System.Linq; using Microsoft.Data.DataView; -using Microsoft.ML.Model; using Microsoft.ML.Runtime; - namespace Microsoft.ML.Data { /// diff --git a/src/Microsoft.ML.Data/Transforms/TrainAndScoreTransformer.cs b/src/Microsoft.ML.Data/Transforms/TrainAndScoreTransformer.cs index d5730b27d3..b1816513b9 100644 --- a/src/Microsoft.ML.Data/Transforms/TrainAndScoreTransformer.cs +++ b/src/Microsoft.ML.Data/Transforms/TrainAndScoreTransformer.cs @@ -8,8 +8,8 @@ using Microsoft.ML.Calibrators; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(ScoringTransformer.Summary, typeof(IDataTransform), typeof(ScoringTransformer), typeof(ScoringTransformer.Arguments), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Data/Transforms/TransformsCatalog.cs b/src/Microsoft.ML.Data/Transforms/TransformsCatalog.cs index ff0ede4730..109b90d5f2 100644 --- a/src/Microsoft.ML.Data/Transforms/TransformsCatalog.cs +++ b/src/Microsoft.ML.Data/Transforms/TransformsCatalog.cs @@ -1,8 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. - using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Data/Transforms/TypeConverting.cs b/src/Microsoft.ML.Data/Transforms/TypeConverting.cs index 8dcdfaf7f1..f1d0b9c226 100644 --- a/src/Microsoft.ML.Data/Transforms/TypeConverting.cs +++ b/src/Microsoft.ML.Data/Transforms/TypeConverting.cs @@ -13,6 +13,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model.OnnxConverter; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(TypeConvertingTransformer.Summary, typeof(IDataTransform), typeof(TypeConvertingTransformer), typeof(TypeConvertingTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Data/Transforms/ValueMapping.cs b/src/Microsoft.ML.Data/Transforms/ValueMapping.cs index 3122f4f327..a64f02dec4 100644 --- a/src/Microsoft.ML.Data/Transforms/ValueMapping.cs +++ b/src/Microsoft.ML.Data/Transforms/ValueMapping.cs @@ -13,6 +13,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(ValueMappingTransformer.Summary, typeof(IDataTransform), typeof(ValueMappingTransformer), @@ -67,7 +68,7 @@ public sealed override SchemaShape GetOutputSchema(SchemaShape inputSchema) if (Transformer.ValueColumnType is VectorType) { vectorKind = SchemaShape.Column.VectorKind.Vector; - if(Transformer.ValueColumnType.GetVectorSize() == 0) + if (Transformer.ValueColumnType.GetVectorSize() == 0) vectorKind = SchemaShape.Column.VectorKind.VariableVector; } @@ -195,7 +196,7 @@ private static ValueGetter>> GetKeyValueGetter(ArrayDataViewBuilder builder, string columnName, PrimitiveDataViewType primitiveType, T[] values) { if (typeof(T) == typeof(string)) - builder.AddColumn(columnName, values.Select(x=>x.ToString()).ToArray()); + builder.AddColumn(columnName, values.Select(x => x.ToString()).ToArray()); else builder.AddColumn(columnName, primitiveType, values); } @@ -208,7 +209,7 @@ internal static void AddColumnWrapper(ArrayDataViewBuilder builder, string co if (typeof(T) == typeof(string)) { var convertedValues = new List[]>(); - foreach(var value in values) + foreach (var value in values) { var converted = value.Select(x => x.ToString().AsMemory()); convertedValues.Add(converted.ToArray()); @@ -327,7 +328,7 @@ public class ValueMappingTransformer : OneToOneTransformerBase internal static string KeyColumnName = "Key"; internal static string ValueColumnName = "Value"; private ValueMap _valueMap; - private byte[] _dataView; + private readonly byte[] _dataView; internal DataViewType ValueColumnType => _valueMap.ValueType; internal DataViewSchema.Annotations ValueColumnMetadata { get; } @@ -788,7 +789,7 @@ private class ValueMap : ValueMap { private Dictionary _mapping; private TValue _missingValue; - private DataViewSchema.Annotations _valueMetadata; + private readonly DataViewSchema.Annotations _valueMetadata; private Dictionary CreateDictionary() { diff --git a/src/Microsoft.ML.Data/Transforms/ValueToKeyMappingEstimator.cs b/src/Microsoft.ML.Data/Transforms/ValueToKeyMappingEstimator.cs index a563b2e6fb..19fb09522e 100644 --- a/src/Microsoft.ML.Data/Transforms/ValueToKeyMappingEstimator.cs +++ b/src/Microsoft.ML.Data/Transforms/ValueToKeyMappingEstimator.cs @@ -6,6 +6,7 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms { @@ -99,7 +100,7 @@ public ColumnOptions(string outputColumnName, string inputColumnName = null, /// How items should be ordered when vectorized. If choosen they will be in the order encountered. /// If , items are sorted according to their default comparison, for example, text sorting will be case sensitive (for example, 'A' then 'Z' then 'a'). internal ValueToKeyMappingEstimator(IHostEnvironment env, string outputColumnName, string inputColumnName = null, int maxNumKeys = Defaults.MaxNumKeys, SortOrder sort = Defaults.Sort) : - this(env, new [] { new ColumnOptions(outputColumnName, inputColumnName ?? outputColumnName, maxNumKeys, sort) }) + this(env, new[] { new ColumnOptions(outputColumnName, inputColumnName ?? outputColumnName, maxNumKeys, sort) }) { } diff --git a/src/Microsoft.ML.Data/Transforms/ValueToKeyMappingTransformer.cs b/src/Microsoft.ML.Data/Transforms/ValueToKeyMappingTransformer.cs index 44d7a6781b..87f6c83a93 100644 --- a/src/Microsoft.ML.Data/Transforms/ValueToKeyMappingTransformer.cs +++ b/src/Microsoft.ML.Data/Transforms/ValueToKeyMappingTransformer.cs @@ -13,10 +13,10 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Data.IO; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; using Newtonsoft.Json.Linq; diff --git a/src/Microsoft.ML.Data/Transforms/ValueToKeyMappingTransformerImpl.cs b/src/Microsoft.ML.Data/Transforms/ValueToKeyMappingTransformerImpl.cs index 6df64bc82d..178d192220 100644 --- a/src/Microsoft.ML.Data/Transforms/ValueToKeyMappingTransformerImpl.cs +++ b/src/Microsoft.ML.Data/Transforms/ValueToKeyMappingTransformerImpl.cs @@ -9,6 +9,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms { diff --git a/src/Microsoft.ML.DnnImageFeaturizer.AlexNet/AlexNetExtension.cs b/src/Microsoft.ML.DnnImageFeaturizer.AlexNet/AlexNetExtension.cs index 4f39e18320..6e28f1f233 100644 --- a/src/Microsoft.ML.DnnImageFeaturizer.AlexNet/AlexNetExtension.cs +++ b/src/Microsoft.ML.DnnImageFeaturizer.AlexNet/AlexNetExtension.cs @@ -5,6 +5,7 @@ using System; using System.IO; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms { diff --git a/src/Microsoft.ML.DnnImageFeaturizer.ResNet101/ResNet101Extension.cs b/src/Microsoft.ML.DnnImageFeaturizer.ResNet101/ResNet101Extension.cs index b993229c43..2d676220f7 100644 --- a/src/Microsoft.ML.DnnImageFeaturizer.ResNet101/ResNet101Extension.cs +++ b/src/Microsoft.ML.DnnImageFeaturizer.ResNet101/ResNet101Extension.cs @@ -5,6 +5,7 @@ using System; using System.IO; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms { diff --git a/src/Microsoft.ML.DnnImageFeaturizer.ResNet18/ResNet18Extension.cs b/src/Microsoft.ML.DnnImageFeaturizer.ResNet18/ResNet18Extension.cs index 17e26eb875..58e70dc1a8 100644 --- a/src/Microsoft.ML.DnnImageFeaturizer.ResNet18/ResNet18Extension.cs +++ b/src/Microsoft.ML.DnnImageFeaturizer.ResNet18/ResNet18Extension.cs @@ -5,6 +5,7 @@ using System; using System.IO; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms { diff --git a/src/Microsoft.ML.DnnImageFeaturizer.ResNet50/ResNet50Extension.cs b/src/Microsoft.ML.DnnImageFeaturizer.ResNet50/ResNet50Extension.cs index 1a217fbe8d..4f2884e07a 100644 --- a/src/Microsoft.ML.DnnImageFeaturizer.ResNet50/ResNet50Extension.cs +++ b/src/Microsoft.ML.DnnImageFeaturizer.ResNet50/ResNet50Extension.cs @@ -5,6 +5,7 @@ using System; using System.IO; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms { diff --git a/src/Microsoft.ML.Ensemble/Batch.cs b/src/Microsoft.ML.Ensemble/Batch.cs index 756b095c72..35624b30a4 100644 --- a/src/Microsoft.ML.Ensemble/Batch.cs +++ b/src/Microsoft.ML.Ensemble/Batch.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/EnsembleUtils.cs b/src/Microsoft.ML.Ensemble/EnsembleUtils.cs index 342a33b9bd..9740464090 100644 --- a/src/Microsoft.ML.Ensemble/EnsembleUtils.cs +++ b/src/Microsoft.ML.Ensemble/EnsembleUtils.cs @@ -6,6 +6,7 @@ using System.Collections; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/EntryPoints/CreateEnsemble.cs b/src/Microsoft.ML.Ensemble/EntryPoints/CreateEnsemble.cs index 2c889fe4e7..da390fe79f 100644 --- a/src/Microsoft.ML.Ensemble/EntryPoints/CreateEnsemble.cs +++ b/src/Microsoft.ML.Ensemble/EntryPoints/CreateEnsemble.cs @@ -12,6 +12,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(void), typeof(EnsembleCreator), null, typeof(SignatureEntryPointModule), "CreateEnsemble")] diff --git a/src/Microsoft.ML.Ensemble/EntryPoints/DiversityMeasure.cs b/src/Microsoft.ML.Ensemble/EntryPoints/DiversityMeasure.cs index 9b1bd10976..ae0f51b9e6 100644 --- a/src/Microsoft.ML.Ensemble/EntryPoints/DiversityMeasure.cs +++ b/src/Microsoft.ML.Ensemble/EntryPoints/DiversityMeasure.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: EntryPointModule(typeof(DisagreementDiversityFactory))] diff --git a/src/Microsoft.ML.Ensemble/EntryPoints/Ensemble.cs b/src/Microsoft.ML.Ensemble/EntryPoints/Ensemble.cs index fab5ecfe2c..f649705b2d 100644 --- a/src/Microsoft.ML.Ensemble/EntryPoints/Ensemble.cs +++ b/src/Microsoft.ML.Ensemble/EntryPoints/Ensemble.cs @@ -4,6 +4,7 @@ using Microsoft.ML; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(void), typeof(Ensemble), null, typeof(SignatureEntryPointModule), "TrainEnsemble")] diff --git a/src/Microsoft.ML.Ensemble/EntryPoints/FeatureSelector.cs b/src/Microsoft.ML.Ensemble/EntryPoints/FeatureSelector.cs index 6200585b3b..fc9bbb23b9 100644 --- a/src/Microsoft.ML.Ensemble/EntryPoints/FeatureSelector.cs +++ b/src/Microsoft.ML.Ensemble/EntryPoints/FeatureSelector.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: EntryPointModule(typeof(AllFeatureSelectorFactory))] diff --git a/src/Microsoft.ML.Ensemble/EntryPoints/OutputCombiner.cs b/src/Microsoft.ML.Ensemble/EntryPoints/OutputCombiner.cs index 633722574e..543a088d8b 100644 --- a/src/Microsoft.ML.Ensemble/EntryPoints/OutputCombiner.cs +++ b/src/Microsoft.ML.Ensemble/EntryPoints/OutputCombiner.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: EntryPointModule(typeof(AverageFactory))] diff --git a/src/Microsoft.ML.Ensemble/EntryPoints/PipelineEnsemble.cs b/src/Microsoft.ML.Ensemble/EntryPoints/PipelineEnsemble.cs index fe65254366..11aebe2322 100644 --- a/src/Microsoft.ML.Ensemble/EntryPoints/PipelineEnsemble.cs +++ b/src/Microsoft.ML.Ensemble/EntryPoints/PipelineEnsemble.cs @@ -6,6 +6,7 @@ using Microsoft.ML.Calibrators; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: EntryPointModule(typeof(PipelineEnsemble))] diff --git a/src/Microsoft.ML.Ensemble/EntryPoints/SubModelSelector.cs b/src/Microsoft.ML.Ensemble/EntryPoints/SubModelSelector.cs index 4e947cd690..53ce5f4b53 100644 --- a/src/Microsoft.ML.Ensemble/EntryPoints/SubModelSelector.cs +++ b/src/Microsoft.ML.Ensemble/EntryPoints/SubModelSelector.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: EntryPointModule(typeof(AllSelectorFactory))] diff --git a/src/Microsoft.ML.Ensemble/FeatureSubsetModel.cs b/src/Microsoft.ML.Ensemble/FeatureSubsetModel.cs index d583a1b125..34d7ddb20e 100644 --- a/src/Microsoft.ML.Ensemble/FeatureSubsetModel.cs +++ b/src/Microsoft.ML.Ensemble/FeatureSubsetModel.cs @@ -5,6 +5,7 @@ using System.Collections; using System.Collections.Generic; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/OutputCombiners/Average.cs b/src/Microsoft.ML.Ensemble/OutputCombiners/Average.cs index 798221c55a..5171c0e778 100644 --- a/src/Microsoft.ML.Ensemble/OutputCombiners/Average.cs +++ b/src/Microsoft.ML.Ensemble/OutputCombiners/Average.cs @@ -4,7 +4,7 @@ using System; using Microsoft.ML; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(Average), null, typeof(SignatureCombiner), Average.UserName)] @@ -56,8 +56,8 @@ protected override void SaveCore(ModelSaveContext ctx) public override Combiner GetCombiner() { // Force the weights to null. - return(ref Single dst, Single[] src, Single[] weights) => - CombineCore(ref dst, src, null); + return (ref Single dst, Single[] src, Single[] weights) => + CombineCore(ref dst, src, null); } } } diff --git a/src/Microsoft.ML.Ensemble/OutputCombiners/BaseAverager.cs b/src/Microsoft.ML.Ensemble/OutputCombiners/BaseAverager.cs index aa5349d741..54ec2d8ebd 100644 --- a/src/Microsoft.ML.Ensemble/OutputCombiners/BaseAverager.cs +++ b/src/Microsoft.ML.Ensemble/OutputCombiners/BaseAverager.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for more information. using System; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/OutputCombiners/BaseMultiAverager.cs b/src/Microsoft.ML.Ensemble/OutputCombiners/BaseMultiAverager.cs index 56dcc6e0c0..34f10b9a1a 100644 --- a/src/Microsoft.ML.Ensemble/OutputCombiners/BaseMultiAverager.cs +++ b/src/Microsoft.ML.Ensemble/OutputCombiners/BaseMultiAverager.cs @@ -5,8 +5,8 @@ using System; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/OutputCombiners/BaseMultiCombiner.cs b/src/Microsoft.ML.Ensemble/OutputCombiners/BaseMultiCombiner.cs index a6d4e65abe..a8e8b3441b 100644 --- a/src/Microsoft.ML.Ensemble/OutputCombiners/BaseMultiCombiner.cs +++ b/src/Microsoft.ML.Ensemble/OutputCombiners/BaseMultiCombiner.cs @@ -6,8 +6,8 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/OutputCombiners/BaseScalarStacking.cs b/src/Microsoft.ML.Ensemble/OutputCombiners/BaseScalarStacking.cs index 59700cb18c..f45474c8de 100644 --- a/src/Microsoft.ML.Ensemble/OutputCombiners/BaseScalarStacking.cs +++ b/src/Microsoft.ML.Ensemble/OutputCombiners/BaseScalarStacking.cs @@ -5,7 +5,7 @@ using System; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/OutputCombiners/BaseStacking.cs b/src/Microsoft.ML.Ensemble/OutputCombiners/BaseStacking.cs index d256d1bc7b..4f93bff48f 100644 --- a/src/Microsoft.ML.Ensemble/OutputCombiners/BaseStacking.cs +++ b/src/Microsoft.ML.Ensemble/OutputCombiners/BaseStacking.cs @@ -10,8 +10,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; -using Microsoft.ML.Trainers; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/OutputCombiners/IOutputCombiner.cs b/src/Microsoft.ML.Ensemble/OutputCombiners/IOutputCombiner.cs index 89e577c3e8..624191934d 100644 --- a/src/Microsoft.ML.Ensemble/OutputCombiners/IOutputCombiner.cs +++ b/src/Microsoft.ML.Ensemble/OutputCombiners/IOutputCombiner.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/OutputCombiners/Median.cs b/src/Microsoft.ML.Ensemble/OutputCombiners/Median.cs index ffc5c27adc..302ac79dbd 100644 --- a/src/Microsoft.ML.Ensemble/OutputCombiners/Median.cs +++ b/src/Microsoft.ML.Ensemble/OutputCombiners/Median.cs @@ -5,7 +5,7 @@ using System; using Microsoft.ML; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(Median), null, typeof(SignatureCombiner), Median.UserName, Median.LoadName)] diff --git a/src/Microsoft.ML.Ensemble/OutputCombiners/MultiAverage.cs b/src/Microsoft.ML.Ensemble/OutputCombiners/MultiAverage.cs index 6306e83efb..0bc9ee410e 100644 --- a/src/Microsoft.ML.Ensemble/OutputCombiners/MultiAverage.cs +++ b/src/Microsoft.ML.Ensemble/OutputCombiners/MultiAverage.cs @@ -6,7 +6,7 @@ using Microsoft.ML; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(MultiAverage), typeof(MultiAverage.Options), typeof(SignatureCombiner), diff --git a/src/Microsoft.ML.Ensemble/OutputCombiners/MultiMedian.cs b/src/Microsoft.ML.Ensemble/OutputCombiners/MultiMedian.cs index 4075590384..d9899aa433 100644 --- a/src/Microsoft.ML.Ensemble/OutputCombiners/MultiMedian.cs +++ b/src/Microsoft.ML.Ensemble/OutputCombiners/MultiMedian.cs @@ -7,7 +7,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(MultiMedian), typeof(MultiMedian.Options), typeof(SignatureCombiner), diff --git a/src/Microsoft.ML.Ensemble/OutputCombiners/MultiStacking.cs b/src/Microsoft.ML.Ensemble/OutputCombiners/MultiStacking.cs index 01011a99d4..512bbbbdbf 100644 --- a/src/Microsoft.ML.Ensemble/OutputCombiners/MultiStacking.cs +++ b/src/Microsoft.ML.Ensemble/OutputCombiners/MultiStacking.cs @@ -8,7 +8,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(MultiStacking), typeof(MultiStacking.Arguments), typeof(SignatureCombiner), diff --git a/src/Microsoft.ML.Ensemble/OutputCombiners/MultiVoting.cs b/src/Microsoft.ML.Ensemble/OutputCombiners/MultiVoting.cs index 7e66f80b66..f27760806f 100644 --- a/src/Microsoft.ML.Ensemble/OutputCombiners/MultiVoting.cs +++ b/src/Microsoft.ML.Ensemble/OutputCombiners/MultiVoting.cs @@ -6,8 +6,8 @@ using Microsoft.ML; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(MultiVoting), null, typeof(SignatureCombiner), Voting.UserName, MultiVoting.LoadName)] diff --git a/src/Microsoft.ML.Ensemble/OutputCombiners/MultiWeightedAverage.cs b/src/Microsoft.ML.Ensemble/OutputCombiners/MultiWeightedAverage.cs index fb8b619c06..d0c92f38bb 100644 --- a/src/Microsoft.ML.Ensemble/OutputCombiners/MultiWeightedAverage.cs +++ b/src/Microsoft.ML.Ensemble/OutputCombiners/MultiWeightedAverage.cs @@ -8,7 +8,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(MultiWeightedAverage), typeof(MultiWeightedAverage.Options), typeof(SignatureCombiner), diff --git a/src/Microsoft.ML.Ensemble/OutputCombiners/RegressionStacking.cs b/src/Microsoft.ML.Ensemble/OutputCombiners/RegressionStacking.cs index ae9ef67db8..c42b488d7e 100644 --- a/src/Microsoft.ML.Ensemble/OutputCombiners/RegressionStacking.cs +++ b/src/Microsoft.ML.Ensemble/OutputCombiners/RegressionStacking.cs @@ -6,7 +6,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(RegressionStacking), typeof(RegressionStacking.Arguments), typeof(SignatureCombiner), diff --git a/src/Microsoft.ML.Ensemble/OutputCombiners/Stacking.cs b/src/Microsoft.ML.Ensemble/OutputCombiners/Stacking.cs index 93fe1d3240..686aed36f4 100644 --- a/src/Microsoft.ML.Ensemble/OutputCombiners/Stacking.cs +++ b/src/Microsoft.ML.Ensemble/OutputCombiners/Stacking.cs @@ -7,7 +7,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(Stacking), typeof(Stacking.Arguments), typeof(SignatureCombiner), Stacking.UserName, Stacking.LoadName)] diff --git a/src/Microsoft.ML.Ensemble/OutputCombiners/Voting.cs b/src/Microsoft.ML.Ensemble/OutputCombiners/Voting.cs index 1b2c97e8a1..ecc2633d79 100644 --- a/src/Microsoft.ML.Ensemble/OutputCombiners/Voting.cs +++ b/src/Microsoft.ML.Ensemble/OutputCombiners/Voting.cs @@ -5,7 +5,7 @@ using System; using Microsoft.ML; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(Voting), null, typeof(SignatureCombiner), Voting.UserName, Voting.LoadName)] diff --git a/src/Microsoft.ML.Ensemble/OutputCombiners/WeightedAverage.cs b/src/Microsoft.ML.Ensemble/OutputCombiners/WeightedAverage.cs index def04f1fcf..35bd79b141 100644 --- a/src/Microsoft.ML.Ensemble/OutputCombiners/WeightedAverage.cs +++ b/src/Microsoft.ML.Ensemble/OutputCombiners/WeightedAverage.cs @@ -8,7 +8,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(WeightedAverage), typeof(WeightedAverage.Options), typeof(SignatureCombiner), @@ -37,7 +37,7 @@ private static VersionInfo GetVersionInfo() } [TlcModule.Component(Name = LoadName, FriendlyName = UserName)] - public sealed class Options: ISupportBinaryOutputCombinerFactory + public sealed class Options : ISupportBinaryOutputCombinerFactory { [Argument(ArgumentType.AtMostOnce, HelpText = "The metric type to be used to find the weights for each model", ShortName = "wn", SortOrder = 50)] [TGUI(Label = "Weightage Name", Description = "The weights are calculated according to the selected metric")] diff --git a/src/Microsoft.ML.Ensemble/PipelineEnsemble.cs b/src/Microsoft.ML.Ensemble/PipelineEnsemble.cs index 9ae406dcfb..a24ba16bcc 100644 --- a/src/Microsoft.ML.Ensemble/PipelineEnsemble.cs +++ b/src/Microsoft.ML.Ensemble/PipelineEnsemble.cs @@ -12,9 +12,9 @@ using Microsoft.ML.Calibrators; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; -using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(SchemaBindablePipelineEnsembleBase), null, typeof(SignatureLoadModel), diff --git a/src/Microsoft.ML.Ensemble/Selector/DiversityMeasure/BaseDisagreementDiversityMeasure.cs b/src/Microsoft.ML.Ensemble/Selector/DiversityMeasure/BaseDisagreementDiversityMeasure.cs index 037ec34693..0e9e645aa2 100644 --- a/src/Microsoft.ML.Ensemble/Selector/DiversityMeasure/BaseDisagreementDiversityMeasure.cs +++ b/src/Microsoft.ML.Ensemble/Selector/DiversityMeasure/BaseDisagreementDiversityMeasure.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/Selector/FeatureSelector/AllFeatureSelector.cs b/src/Microsoft.ML.Ensemble/Selector/FeatureSelector/AllFeatureSelector.cs index 3aba8970e4..2b1faac85f 100644 --- a/src/Microsoft.ML.Ensemble/Selector/FeatureSelector/AllFeatureSelector.cs +++ b/src/Microsoft.ML.Ensemble/Selector/FeatureSelector/AllFeatureSelector.cs @@ -5,6 +5,7 @@ using System; using Microsoft.ML; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(AllFeatureSelector), null, typeof(SignatureEnsembleFeatureSelector), diff --git a/src/Microsoft.ML.Ensemble/Selector/FeatureSelector/RandomFeatureSelector.cs b/src/Microsoft.ML.Ensemble/Selector/FeatureSelector/RandomFeatureSelector.cs index 0596cf0e50..728acb079a 100644 --- a/src/Microsoft.ML.Ensemble/Selector/FeatureSelector/RandomFeatureSelector.cs +++ b/src/Microsoft.ML.Ensemble/Selector/FeatureSelector/RandomFeatureSelector.cs @@ -8,6 +8,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(RandomFeatureSelector), typeof(RandomFeatureSelector.Arguments), @@ -21,7 +22,7 @@ internal class RandomFeatureSelector : IFeatureSelector public const string LoadName = "RandomFeatureSelector"; [TlcModule.Component(Name = LoadName, FriendlyName = UserName)] - public sealed class Arguments: ISupportFeatureSelectorFactory + public sealed class Arguments : ISupportFeatureSelectorFactory { [Argument(ArgumentType.AtMostOnce, HelpText = "The proportion of features to be selected. The range is 0.0-1.0", ShortName = "fp", SortOrder = 50)] public Single FeaturesSelectionProportion = 0.8f; diff --git a/src/Microsoft.ML.Ensemble/Selector/IDiversityMeasure.cs b/src/Microsoft.ML.Ensemble/Selector/IDiversityMeasure.cs index fcb627f81d..5303598dea 100644 --- a/src/Microsoft.ML.Ensemble/Selector/IDiversityMeasure.cs +++ b/src/Microsoft.ML.Ensemble/Selector/IDiversityMeasure.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/Selector/IFeatureSelector.cs b/src/Microsoft.ML.Ensemble/Selector/IFeatureSelector.cs index bdf4809b93..5643627308 100644 --- a/src/Microsoft.ML.Ensemble/Selector/IFeatureSelector.cs +++ b/src/Microsoft.ML.Ensemble/Selector/IFeatureSelector.cs @@ -5,6 +5,7 @@ using System; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/Selector/ISubModelSelector.cs b/src/Microsoft.ML.Ensemble/Selector/ISubModelSelector.cs index 6f910f6a44..52da774cee 100644 --- a/src/Microsoft.ML.Ensemble/Selector/ISubModelSelector.cs +++ b/src/Microsoft.ML.Ensemble/Selector/ISubModelSelector.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { @@ -39,7 +40,7 @@ internal interface ISupportMulticlassSubModelSelectorFactory : IComponentFactory } [TlcModule.ComponentKind("EnsembleBinarySubModelSelector")] - internal interface ISupportBinarySubModelSelectorFactory: IComponentFactory + internal interface ISupportBinarySubModelSelectorFactory : IComponentFactory { } diff --git a/src/Microsoft.ML.Ensemble/Selector/ISubsetSelector.cs b/src/Microsoft.ML.Ensemble/Selector/ISubsetSelector.cs index 7653b66526..c099b46339 100644 --- a/src/Microsoft.ML.Ensemble/Selector/ISubsetSelector.cs +++ b/src/Microsoft.ML.Ensemble/Selector/ISubsetSelector.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/AllSelector.cs b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/AllSelector.cs index d22171b935..6a0e678cf3 100644 --- a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/AllSelector.cs +++ b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/AllSelector.cs @@ -4,6 +4,7 @@ using System; using Microsoft.ML; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(AllSelector), null, typeof(SignatureEnsembleSubModelSelector), AllSelector.UserName, AllSelector.LoadName)] diff --git a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/AllSelectorMultiClass.cs b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/AllSelectorMultiClass.cs index 1caee7c7d5..672090073e 100644 --- a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/AllSelectorMultiClass.cs +++ b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/AllSelectorMultiClass.cs @@ -5,6 +5,7 @@ using System; using Microsoft.ML; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(AllSelectorMultiClass), null, typeof(SignatureEnsembleSubModelSelector), diff --git a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BaseBestPerformanceSelector.cs b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BaseBestPerformanceSelector.cs index 5726d6a01d..68c83579ee 100644 --- a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BaseBestPerformanceSelector.cs +++ b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BaseBestPerformanceSelector.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Reflection; using Microsoft.ML.CommandLine; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BaseDiverseSelector.cs b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BaseDiverseSelector.cs index 898912906f..d82629b950 100644 --- a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BaseDiverseSelector.cs +++ b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BaseDiverseSelector.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BaseSubModelSelector.cs b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BaseSubModelSelector.cs index 3449d78255..a32fd6733a 100644 --- a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BaseSubModelSelector.cs +++ b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BaseSubModelSelector.cs @@ -7,6 +7,7 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestDiverseSelectorBinary.cs b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestDiverseSelectorBinary.cs index a6a7a86684..91312c9f0b 100644 --- a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestDiverseSelectorBinary.cs +++ b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestDiverseSelectorBinary.cs @@ -9,6 +9,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(BestDiverseSelectorBinary), typeof(BestDiverseSelectorBinary.Arguments), diff --git a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestDiverseSelectorMultiClass.cs b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestDiverseSelectorMultiClass.cs index 48c2b60119..21cce5f428 100644 --- a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestDiverseSelectorMultiClass.cs +++ b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestDiverseSelectorMultiClass.cs @@ -10,6 +10,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(BestDiverseSelectorMultiClass), typeof(BestDiverseSelectorMultiClass.Arguments), diff --git a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestDiverseSelectorRegression.cs b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestDiverseSelectorRegression.cs index aab2bc5c5d..ec245c9649 100644 --- a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestDiverseSelectorRegression.cs +++ b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestDiverseSelectorRegression.cs @@ -9,6 +9,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(BestDiverseSelectorRegression), typeof(BestDiverseSelectorRegression.Arguments), diff --git a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestPerformanceRegressionSelector.cs b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestPerformanceRegressionSelector.cs index 523c149d42..87608322fd 100644 --- a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestPerformanceRegressionSelector.cs +++ b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestPerformanceRegressionSelector.cs @@ -8,6 +8,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(BestPerformanceRegressionSelector), typeof(BestPerformanceRegressionSelector.Arguments), diff --git a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestPerformanceSelector.cs b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestPerformanceSelector.cs index b13fffd49a..f3aa31d839 100644 --- a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestPerformanceSelector.cs +++ b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestPerformanceSelector.cs @@ -8,6 +8,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(BestPerformanceSelector), typeof(BestPerformanceSelector.Arguments), diff --git a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestPerformanceSelectorMultiClass.cs b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestPerformanceSelectorMultiClass.cs index aae6525cf4..acdef8118d 100644 --- a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestPerformanceSelectorMultiClass.cs +++ b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/BestPerformanceSelectorMultiClass.cs @@ -8,6 +8,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(BestPerformanceSelectorMultiClass), typeof(BestPerformanceSelectorMultiClass.Arguments), diff --git a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/SubModelDataSelector.cs b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/SubModelDataSelector.cs index 29d5bec6a4..704a2fb7bc 100644 --- a/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/SubModelDataSelector.cs +++ b/src/Microsoft.ML.Ensemble/Selector/SubModelSelector/SubModelDataSelector.cs @@ -5,6 +5,7 @@ using System; using Microsoft.ML.CommandLine; using Microsoft.ML.Internal.Internallearn; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/Selector/SubsetSelector/AllInstanceSelector.cs b/src/Microsoft.ML.Ensemble/Selector/SubsetSelector/AllInstanceSelector.cs index 1c1c15c3cd..e223c165f0 100644 --- a/src/Microsoft.ML.Ensemble/Selector/SubsetSelector/AllInstanceSelector.cs +++ b/src/Microsoft.ML.Ensemble/Selector/SubsetSelector/AllInstanceSelector.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using Microsoft.ML; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; using Microsoft.ML.Trainers.Ensemble.SubsetSelector; diff --git a/src/Microsoft.ML.Ensemble/Selector/SubsetSelector/BaseSubsetSelector.cs b/src/Microsoft.ML.Ensemble/Selector/SubsetSelector/BaseSubsetSelector.cs index cf19364daa..172cac2005 100644 --- a/src/Microsoft.ML.Ensemble/Selector/SubsetSelector/BaseSubsetSelector.cs +++ b/src/Microsoft.ML.Ensemble/Selector/SubsetSelector/BaseSubsetSelector.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML.Trainers.Ensemble.SubsetSelector diff --git a/src/Microsoft.ML.Ensemble/Selector/SubsetSelector/BootstrapSelector.cs b/src/Microsoft.ML.Ensemble/Selector/SubsetSelector/BootstrapSelector.cs index 8006ba2195..04b2dd4ccb 100644 --- a/src/Microsoft.ML.Ensemble/Selector/SubsetSelector/BootstrapSelector.cs +++ b/src/Microsoft.ML.Ensemble/Selector/SubsetSelector/BootstrapSelector.cs @@ -7,6 +7,7 @@ using Microsoft.ML; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; using Microsoft.ML.Trainers.Ensemble.SubsetSelector; using Microsoft.ML.Transforms; diff --git a/src/Microsoft.ML.Ensemble/Selector/SubsetSelector/RandomPartitionSelector.cs b/src/Microsoft.ML.Ensemble/Selector/SubsetSelector/RandomPartitionSelector.cs index a7f52e6b7b..0af63e6952 100644 --- a/src/Microsoft.ML.Ensemble/Selector/SubsetSelector/RandomPartitionSelector.cs +++ b/src/Microsoft.ML.Ensemble/Selector/SubsetSelector/RandomPartitionSelector.cs @@ -7,6 +7,7 @@ using Microsoft.ML; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; using Microsoft.ML.Trainers.Ensemble.SubsetSelector; using Microsoft.ML.Transforms; diff --git a/src/Microsoft.ML.Ensemble/Subset.cs b/src/Microsoft.ML.Ensemble/Subset.cs index e1e579fd7b..f55f32d336 100644 --- a/src/Microsoft.ML.Ensemble/Subset.cs +++ b/src/Microsoft.ML.Ensemble/Subset.cs @@ -4,6 +4,7 @@ using System.Collections; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/Trainer/Binary/EnsembleTrainer.cs b/src/Microsoft.ML.Ensemble/Trainer/Binary/EnsembleTrainer.cs index 9d7826c606..92c3b2e21b 100644 --- a/src/Microsoft.ML.Ensemble/Trainer/Binary/EnsembleTrainer.cs +++ b/src/Microsoft.ML.Ensemble/Trainer/Binary/EnsembleTrainer.cs @@ -9,6 +9,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Internallearn; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(EnsembleTrainer.Summary, typeof(EnsembleTrainer), typeof(EnsembleTrainer.Arguments), diff --git a/src/Microsoft.ML.Ensemble/Trainer/EnsembleDistributionModelParameters.cs b/src/Microsoft.ML.Ensemble/Trainer/EnsembleDistributionModelParameters.cs index 983ed44871..95f3f52116 100644 --- a/src/Microsoft.ML.Ensemble/Trainer/EnsembleDistributionModelParameters.cs +++ b/src/Microsoft.ML.Ensemble/Trainer/EnsembleDistributionModelParameters.cs @@ -10,7 +10,7 @@ using Microsoft.ML; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; // These are for deserialization from a model repository. diff --git a/src/Microsoft.ML.Ensemble/Trainer/EnsembleModelParameters.cs b/src/Microsoft.ML.Ensemble/Trainer/EnsembleModelParameters.cs index c58189266a..dc3cd16a70 100644 --- a/src/Microsoft.ML.Ensemble/Trainer/EnsembleModelParameters.cs +++ b/src/Microsoft.ML.Ensemble/Trainer/EnsembleModelParameters.cs @@ -8,7 +8,7 @@ using Microsoft.ML; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(EnsembleModelParameters), null, typeof(SignatureLoadModel), EnsembleModelParameters.UserName, diff --git a/src/Microsoft.ML.Ensemble/Trainer/EnsembleModelParametersBase.cs b/src/Microsoft.ML.Ensemble/Trainer/EnsembleModelParametersBase.cs index e99d520825..eb5708bfa3 100644 --- a/src/Microsoft.ML.Ensemble/Trainer/EnsembleModelParametersBase.cs +++ b/src/Microsoft.ML.Ensemble/Trainer/EnsembleModelParametersBase.cs @@ -9,7 +9,7 @@ using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; -using Microsoft.ML.Trainers.Ensemble; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.Ensemble { diff --git a/src/Microsoft.ML.Ensemble/Trainer/EnsembleTrainerBase.cs b/src/Microsoft.ML.Ensemble/Trainer/EnsembleTrainerBase.cs index f650bb296e..3ab77000bc 100644 --- a/src/Microsoft.ML.Ensemble/Trainer/EnsembleTrainerBase.cs +++ b/src/Microsoft.ML.Ensemble/Trainer/EnsembleTrainerBase.cs @@ -8,9 +8,9 @@ using System.Threading.Tasks; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble.SubsetSelector; namespace Microsoft.ML.Trainers.Ensemble diff --git a/src/Microsoft.ML.Ensemble/Trainer/Multiclass/EnsembleMultiClassModelParameters.cs b/src/Microsoft.ML.Ensemble/Trainer/Multiclass/EnsembleMultiClassModelParameters.cs index 98f00a5163..813d54a60a 100644 --- a/src/Microsoft.ML.Ensemble/Trainer/Multiclass/EnsembleMultiClassModelParameters.cs +++ b/src/Microsoft.ML.Ensemble/Trainer/Multiclass/EnsembleMultiClassModelParameters.cs @@ -7,7 +7,7 @@ using Microsoft.Data.DataView; using Microsoft.ML; using Microsoft.ML.Data; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(EnsembleMultiClassModelParameters), null, typeof(SignatureLoadModel), diff --git a/src/Microsoft.ML.Ensemble/Trainer/Multiclass/MulticlassDataPartitionEnsembleTrainer.cs b/src/Microsoft.ML.Ensemble/Trainer/Multiclass/MulticlassDataPartitionEnsembleTrainer.cs index 3d44c3d30f..63ecef2e1e 100644 --- a/src/Microsoft.ML.Ensemble/Trainer/Multiclass/MulticlassDataPartitionEnsembleTrainer.cs +++ b/src/Microsoft.ML.Ensemble/Trainer/Multiclass/MulticlassDataPartitionEnsembleTrainer.cs @@ -9,6 +9,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Internallearn; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(MulticlassDataPartitionEnsembleTrainer.Summary, typeof(MulticlassDataPartitionEnsembleTrainer), diff --git a/src/Microsoft.ML.Ensemble/Trainer/Regression/RegressionEnsembleTrainer.cs b/src/Microsoft.ML.Ensemble/Trainer/Regression/RegressionEnsembleTrainer.cs index 2f2bfa555e..ab17f5f28e 100644 --- a/src/Microsoft.ML.Ensemble/Trainer/Regression/RegressionEnsembleTrainer.cs +++ b/src/Microsoft.ML.Ensemble/Trainer/Regression/RegressionEnsembleTrainer.cs @@ -9,6 +9,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Internallearn; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Ensemble; [assembly: LoadableClass(typeof(RegressionEnsembleTrainer), typeof(RegressionEnsembleTrainer.Arguments), diff --git a/src/Microsoft.ML.EntryPoints/CVSplit.cs b/src/Microsoft.ML.EntryPoints/CVSplit.cs index 53fc29aeb2..050af68fae 100644 --- a/src/Microsoft.ML.EntryPoints/CVSplit.cs +++ b/src/Microsoft.ML.EntryPoints/CVSplit.cs @@ -5,8 +5,8 @@ using Microsoft.Data.DataView; using Microsoft.ML; using Microsoft.ML.CommandLine; -using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(typeof(void), typeof(CVSplit), null, typeof(SignatureEntryPointModule), "CVSplit")] diff --git a/src/Microsoft.ML.EntryPoints/CrossValidationMacro.cs b/src/Microsoft.ML.EntryPoints/CrossValidationMacro.cs index fa4e4ee734..9486c1cb03 100644 --- a/src/Microsoft.ML.EntryPoints/CrossValidationMacro.cs +++ b/src/Microsoft.ML.EntryPoints/CrossValidationMacro.cs @@ -11,6 +11,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Newtonsoft.Json.Linq; [assembly: LoadableClass(typeof(void), typeof(CrossValidationMacro), null, typeof(SignatureEntryPointModule), "CrossValidationMacro")] diff --git a/src/Microsoft.ML.EntryPoints/DataViewReference.cs b/src/Microsoft.ML.EntryPoints/DataViewReference.cs index 493df4a782..e827825628 100644 --- a/src/Microsoft.ML.EntryPoints/DataViewReference.cs +++ b/src/Microsoft.ML.EntryPoints/DataViewReference.cs @@ -6,6 +6,7 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(void), typeof(DataViewReference), null, typeof(SignatureEntryPointModule), "DataViewReference")] diff --git a/src/Microsoft.ML.EntryPoints/FeatureCombiner.cs b/src/Microsoft.ML.EntryPoints/FeatureCombiner.cs index 8b409da8c5..fd087f347c 100644 --- a/src/Microsoft.ML.EntryPoints/FeatureCombiner.cs +++ b/src/Microsoft.ML.EntryPoints/FeatureCombiner.cs @@ -12,6 +12,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(typeof(void), typeof(FeatureCombiner), null, typeof(SignatureEntryPointModule), "FeatureCombiner")] diff --git a/src/Microsoft.ML.EntryPoints/ImportTextData.cs b/src/Microsoft.ML.EntryPoints/ImportTextData.cs index 50544ce16d..2c17a79345 100644 --- a/src/Microsoft.ML.EntryPoints/ImportTextData.cs +++ b/src/Microsoft.ML.EntryPoints/ImportTextData.cs @@ -7,6 +7,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(void), typeof(ImportTextData), null, typeof(SignatureEntryPointModule), "ImportTextData")] diff --git a/src/Microsoft.ML.EntryPoints/JsonUtils/ExecuteGraphCommand.cs b/src/Microsoft.ML.EntryPoints/JsonUtils/ExecuteGraphCommand.cs index 169db8e86e..5b29087159 100644 --- a/src/Microsoft.ML.EntryPoints/JsonUtils/ExecuteGraphCommand.cs +++ b/src/Microsoft.ML.EntryPoints/JsonUtils/ExecuteGraphCommand.cs @@ -12,6 +12,7 @@ using Microsoft.ML.Data.IO; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Newtonsoft.Json; using Newtonsoft.Json.Linq; diff --git a/src/Microsoft.ML.EntryPoints/JsonUtils/GraphRunner.cs b/src/Microsoft.ML.EntryPoints/JsonUtils/GraphRunner.cs index 1841a7f332..963b8cb524 100644 --- a/src/Microsoft.ML.EntryPoints/JsonUtils/GraphRunner.cs +++ b/src/Microsoft.ML.EntryPoints/JsonUtils/GraphRunner.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Linq; +using Microsoft.ML.Runtime; using Newtonsoft.Json.Linq; namespace Microsoft.ML.EntryPoints diff --git a/src/Microsoft.ML.EntryPoints/JsonUtils/JsonManifestUtils.cs b/src/Microsoft.ML.EntryPoints/JsonUtils/JsonManifestUtils.cs index 4c32d23bfa..093b8bf5d6 100644 --- a/src/Microsoft.ML.EntryPoints/JsonUtils/JsonManifestUtils.cs +++ b/src/Microsoft.ML.EntryPoints/JsonUtils/JsonManifestUtils.cs @@ -8,6 +8,7 @@ using System.Reflection; using Microsoft.ML.CommandLine; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Newtonsoft.Json.Linq; namespace Microsoft.ML.EntryPoints diff --git a/src/Microsoft.ML.EntryPoints/MacroUtils.cs b/src/Microsoft.ML.EntryPoints/MacroUtils.cs index c2eba81c23..87a8cd7b22 100644 --- a/src/Microsoft.ML.EntryPoints/MacroUtils.cs +++ b/src/Microsoft.ML.EntryPoints/MacroUtils.cs @@ -7,6 +7,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; [assembly: EntryPointModule(typeof(MacroUtils))] diff --git a/src/Microsoft.ML.EntryPoints/ModelOperations.cs b/src/Microsoft.ML.EntryPoints/ModelOperations.cs index c67091a364..d32b593dc1 100644 --- a/src/Microsoft.ML.EntryPoints/ModelOperations.cs +++ b/src/Microsoft.ML.EntryPoints/ModelOperations.cs @@ -8,6 +8,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Microsoft.ML.Transforms; diff --git a/src/Microsoft.ML.EntryPoints/OneVersusAllMacro.cs b/src/Microsoft.ML.EntryPoints/OneVersusAllMacro.cs index 4fb062cced..e4867ec74d 100644 --- a/src/Microsoft.ML.EntryPoints/OneVersusAllMacro.cs +++ b/src/Microsoft.ML.EntryPoints/OneVersusAllMacro.cs @@ -9,6 +9,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Microsoft.ML.Transforms; using Newtonsoft.Json.Linq; diff --git a/src/Microsoft.ML.EntryPoints/ScoreColumnSelector.cs b/src/Microsoft.ML.EntryPoints/ScoreColumnSelector.cs index ea08fdf1cb..77cdc53ae3 100644 --- a/src/Microsoft.ML.EntryPoints/ScoreColumnSelector.cs +++ b/src/Microsoft.ML.EntryPoints/ScoreColumnSelector.cs @@ -8,6 +8,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML.EntryPoints diff --git a/src/Microsoft.ML.EntryPoints/ScoreModel.cs b/src/Microsoft.ML.EntryPoints/ScoreModel.cs index 3a8083e3a2..0dd75a8e08 100644 --- a/src/Microsoft.ML.EntryPoints/ScoreModel.cs +++ b/src/Microsoft.ML.EntryPoints/ScoreModel.cs @@ -7,6 +7,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(void), typeof(ScoreModel), null, typeof(SignatureEntryPointModule), "ScoreModel")] diff --git a/src/Microsoft.ML.EntryPoints/TrainTestMacro.cs b/src/Microsoft.ML.EntryPoints/TrainTestMacro.cs index f95eb19dc3..1a7b3f3951 100644 --- a/src/Microsoft.ML.EntryPoints/TrainTestMacro.cs +++ b/src/Microsoft.ML.EntryPoints/TrainTestMacro.cs @@ -9,6 +9,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Newtonsoft.Json.Linq; [assembly: LoadableClass(typeof(void), typeof(TrainTestMacro), null, typeof(SignatureEntryPointModule), "TrainTestMacro")] diff --git a/src/Microsoft.ML.EntryPoints/TrainTestSplit.cs b/src/Microsoft.ML.EntryPoints/TrainTestSplit.cs index 844c462ff2..35b52e3f7d 100644 --- a/src/Microsoft.ML.EntryPoints/TrainTestSplit.cs +++ b/src/Microsoft.ML.EntryPoints/TrainTestSplit.cs @@ -7,6 +7,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(typeof(void), typeof(TrainTestSplit), null, typeof(SignatureEntryPointModule), "TrainTestSplit")] diff --git a/src/Microsoft.ML.FastTree/BinFile/BinFinder.cs b/src/Microsoft.ML.FastTree/BinFile/BinFinder.cs index 7df57005b7..55b37e92ac 100644 --- a/src/Microsoft.ML.FastTree/BinFile/BinFinder.cs +++ b/src/Microsoft.ML.FastTree/BinFile/BinFinder.cs @@ -6,6 +6,7 @@ using System.Threading; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/BinFile/IniFileParserInterface.cs b/src/Microsoft.ML.FastTree/BinFile/IniFileParserInterface.cs index 5488adca16..b7cdcbe2bc 100644 --- a/src/Microsoft.ML.FastTree/BinFile/IniFileParserInterface.cs +++ b/src/Microsoft.ML.FastTree/BinFile/IniFileParserInterface.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Runtime.InteropServices; using System.Text; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/BoostingFastTree.cs b/src/Microsoft.ML.FastTree/BoostingFastTree.cs index e994629ba1..f211a87cb9 100644 --- a/src/Microsoft.ML.FastTree/BoostingFastTree.cs +++ b/src/Microsoft.ML.FastTree/BoostingFastTree.cs @@ -4,6 +4,7 @@ using System; using System.Linq; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Dataset/Dataset.cs b/src/Microsoft.ML.FastTree/Dataset/Dataset.cs index c89ed7a237..2006be7103 100644 --- a/src/Microsoft.ML.FastTree/Dataset/Dataset.cs +++ b/src/Microsoft.ML.FastTree/Dataset/Dataset.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Dataset/DatasetUtils.cs b/src/Microsoft.ML.FastTree/Dataset/DatasetUtils.cs index 6a9136e42a..4a1bf2440c 100644 --- a/src/Microsoft.ML.FastTree/Dataset/DatasetUtils.cs +++ b/src/Microsoft.ML.FastTree/Dataset/DatasetUtils.cs @@ -31,10 +31,10 @@ public static TsvFeature CreateFeatureFromRatings(short[] ratings) // 1 -> 6 // 0 -> 5 // invalid -> 0 - short maxLab = ratings.Length > 0 ? ratings.Max() : (short) 0; + short maxLab = ratings.Length > 0 ? ratings.Max() : (short)0; IntArray ratingAsFeature = IntArray.New( - ratings.Length, IntArrayType.Dense, IntArrayBits.Bits8, ratings.Select(x => (int) x)); - uint[] valueMap = Enumerable.Range(0, ((int) maxLab) + 1).Select(x => (uint) x + 5).ToArray(); + ratings.Length, IntArrayType.Dense, IntArrayBits.Bits8, ratings.Select(x => (int)x)); + uint[] valueMap = Enumerable.Range(0, ((int)maxLab) + 1).Select(x => (uint)x + 5).ToArray(); return new TsvFeature(ratingAsFeature, valueMap, "m:Rating"); } @@ -46,14 +46,14 @@ public static TsvFeature CreateFeatureFromRatings(short[] ratings) public static TsvFeature CreateFeatureFromQueryId(Dataset.DatasetSkeleton skel) { Dictionary uvalToOrder = new Dictionary(); - foreach (uint uintQid in skel.QueryIds.Select(qid => (uint) qid).Distinct().OrderBy(x => x)) + foreach (uint uintQid in skel.QueryIds.Select(qid => (uint)qid).Distinct().OrderBy(x => x)) { uvalToOrder[uintQid] = uvalToOrder.Count; } IntArray bins = IntArray.New( skel.NumDocs, IntArrayType.Dense, IntArray.NumBitsNeeded(uvalToOrder.Count), skel.QueryIds.SelectMany((qid, i) => - Enumerable.Repeat(uvalToOrder[(uint) qid], skel.Boundaries[i + 1] - skel.Boundaries[i]))); + Enumerable.Repeat(uvalToOrder[(uint)qid], skel.Boundaries[i + 1] - skel.Boundaries[i]))); uint[] valueMap = uvalToOrder.Keys.OrderBy(x => x).ToArray(uvalToOrder.Count); return new TsvFeature(bins, valueMap, "m:QueryId"); } diff --git a/src/Microsoft.ML.FastTree/Dataset/DenseIntArray.cs b/src/Microsoft.ML.FastTree/Dataset/DenseIntArray.cs index b72d1d2604..a228ebb8b2 100644 --- a/src/Microsoft.ML.FastTree/Dataset/DenseIntArray.cs +++ b/src/Microsoft.ML.FastTree/Dataset/DenseIntArray.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Runtime.InteropServices; using System.Security; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Dataset/Feature.cs b/src/Microsoft.ML.FastTree/Dataset/Feature.cs index fb8ced8c5e..8ca713f3f5 100644 --- a/src/Microsoft.ML.FastTree/Dataset/Feature.cs +++ b/src/Microsoft.ML.FastTree/Dataset/Feature.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Linq; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { @@ -78,14 +79,14 @@ public static Feature New(byte[] buffer, ref int position) switch (type) { - case FeatureType.Raw: - TsvFeature tf = new TsvFeature(buffer, ref position); + case FeatureType.Raw: + TsvFeature tf = new TsvFeature(buffer, ref position); #if !NO_STORE tf.BinsCache = FileObjectStore.GetDefaultInstance(); #endif - return tf; - default: - throw Contracts.Except("Impossible!"); + return tf; + default: + throw Contracts.Except("Impossible!"); } } } diff --git a/src/Microsoft.ML.FastTree/Dataset/FeatureFlock.cs b/src/Microsoft.ML.FastTree/Dataset/FeatureFlock.cs index 57bbf7922e..05975cef6a 100644 --- a/src/Microsoft.ML.FastTree/Dataset/FeatureFlock.cs +++ b/src/Microsoft.ML.FastTree/Dataset/FeatureFlock.cs @@ -14,6 +14,7 @@ using System.Runtime.CompilerServices; using Microsoft.ML.Internal.CpuMath; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Dataset/FeatureHistogram.cs b/src/Microsoft.ML.FastTree/Dataset/FeatureHistogram.cs index 9ef99a2a5c..eb701b9334 100644 --- a/src/Microsoft.ML.FastTree/Dataset/FeatureHistogram.cs +++ b/src/Microsoft.ML.FastTree/Dataset/FeatureHistogram.cs @@ -4,6 +4,7 @@ using System; using System.Linq; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { @@ -56,7 +57,7 @@ public static int EstimateMemoryUsedForFeatureHistogram(int numBins, bool hasWei { return sizeof(int) // NumberFeatureValues + sizeof(int) // the IsSplittable boolean value. Although sizeof(bool) is 1, - // but we just estimate it as 4 for alignment + // but we just estimate it as 4 for alignment + 8 // size of reference to _feature in 64 bit machines. + sizeof(int) * numBins // CountByBin + sizeof(FloatType) * numBins // SumTargetsByBin diff --git a/src/Microsoft.ML.FastTree/Dataset/IntArray.cs b/src/Microsoft.ML.FastTree/Dataset/IntArray.cs index 0f22d7291d..a980b760b6 100644 --- a/src/Microsoft.ML.FastTree/Dataset/IntArray.cs +++ b/src/Microsoft.ML.FastTree/Dataset/IntArray.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Dataset/NHotFeatureFlock.cs b/src/Microsoft.ML.FastTree/Dataset/NHotFeatureFlock.cs index 43eacf22f0..25f91c5b0f 100644 --- a/src/Microsoft.ML.FastTree/Dataset/NHotFeatureFlock.cs +++ b/src/Microsoft.ML.FastTree/Dataset/NHotFeatureFlock.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Dataset/OneHotFeatureFlock.cs b/src/Microsoft.ML.FastTree/Dataset/OneHotFeatureFlock.cs index 605d912328..60df87aa83 100644 --- a/src/Microsoft.ML.FastTree/Dataset/OneHotFeatureFlock.cs +++ b/src/Microsoft.ML.FastTree/Dataset/OneHotFeatureFlock.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Linq; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Dataset/RepeatIntArray.cs b/src/Microsoft.ML.FastTree/Dataset/RepeatIntArray.cs index 007b56b05c..5acdee452a 100644 --- a/src/Microsoft.ML.FastTree/Dataset/RepeatIntArray.cs +++ b/src/Microsoft.ML.FastTree/Dataset/RepeatIntArray.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Dataset/SegmentIntArray.cs b/src/Microsoft.ML.FastTree/Dataset/SegmentIntArray.cs index f0cbddd41f..642c157f6b 100644 --- a/src/Microsoft.ML.FastTree/Dataset/SegmentIntArray.cs +++ b/src/Microsoft.ML.FastTree/Dataset/SegmentIntArray.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Runtime.InteropServices; using System.Security; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Dataset/SingletonFeatureFlock.cs b/src/Microsoft.ML.FastTree/Dataset/SingletonFeatureFlock.cs index 30f609faa4..424cf50faf 100644 --- a/src/Microsoft.ML.FastTree/Dataset/SingletonFeatureFlock.cs +++ b/src/Microsoft.ML.FastTree/Dataset/SingletonFeatureFlock.cs @@ -4,6 +4,7 @@ using System.Linq; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Dataset/SparseIntArray.cs b/src/Microsoft.ML.FastTree/Dataset/SparseIntArray.cs index be4f53e69e..d8bad602ef 100644 --- a/src/Microsoft.ML.FastTree/Dataset/SparseIntArray.cs +++ b/src/Microsoft.ML.FastTree/Dataset/SparseIntArray.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Runtime.InteropServices; using System.Security; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/FastTree.cs b/src/Microsoft.ML.FastTree/FastTree.cs index bdbfb67341..3230d96691 100644 --- a/src/Microsoft.ML.FastTree/FastTree.cs +++ b/src/Microsoft.ML.FastTree/FastTree.cs @@ -20,6 +20,7 @@ using Microsoft.ML.Model; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; using Microsoft.ML.TreePredictor; using Newtonsoft.Json.Linq; diff --git a/src/Microsoft.ML.FastTree/FastTreeArguments.cs b/src/Microsoft.ML.FastTree/FastTreeArguments.cs index 767c706ece..6d64e40ca5 100644 --- a/src/Microsoft.ML.FastTree/FastTreeArguments.cs +++ b/src/Microsoft.ML.FastTree/FastTreeArguments.cs @@ -6,6 +6,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; [assembly: EntryPointModule(typeof(FastTreeBinaryClassificationTrainer.Options))] diff --git a/src/Microsoft.ML.FastTree/FastTreeClassification.cs b/src/Microsoft.ML.FastTree/FastTreeClassification.cs index c7a54428f7..03fea0ee6c 100644 --- a/src/Microsoft.ML.FastTree/FastTreeClassification.cs +++ b/src/Microsoft.ML.FastTree/FastTreeClassification.cs @@ -11,6 +11,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; [assembly: LoadableClass(FastTreeBinaryClassificationTrainer.Summary, typeof(FastTreeBinaryClassificationTrainer), typeof(FastTreeBinaryClassificationTrainer.Options), diff --git a/src/Microsoft.ML.FastTree/FastTreeRanking.cs b/src/Microsoft.ML.FastTree/FastTreeRanking.cs index 9279772227..d1a9aa426a 100644 --- a/src/Microsoft.ML.FastTree/FastTreeRanking.cs +++ b/src/Microsoft.ML.FastTree/FastTreeRanking.cs @@ -14,6 +14,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; // REVIEW: Do we really need all these names? diff --git a/src/Microsoft.ML.FastTree/FastTreeRegression.cs b/src/Microsoft.ML.FastTree/FastTreeRegression.cs index e02d5ec257..a5cbaa3ae4 100644 --- a/src/Microsoft.ML.FastTree/FastTreeRegression.cs +++ b/src/Microsoft.ML.FastTree/FastTreeRegression.cs @@ -9,6 +9,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; [assembly: LoadableClass(FastTreeRegressionTrainer.Summary, typeof(FastTreeRegressionTrainer), typeof(FastTreeRegressionTrainer.Options), diff --git a/src/Microsoft.ML.FastTree/FastTreeTweedie.cs b/src/Microsoft.ML.FastTree/FastTreeTweedie.cs index f68e67476f..fa2e455d01 100644 --- a/src/Microsoft.ML.FastTree/FastTreeTweedie.cs +++ b/src/Microsoft.ML.FastTree/FastTreeTweedie.cs @@ -11,6 +11,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; [assembly: LoadableClass(FastTreeTweedieTrainer.Summary, typeof(FastTreeTweedieTrainer), typeof(FastTreeTweedieTrainer.Options), diff --git a/src/Microsoft.ML.FastTree/GamClassification.cs b/src/Microsoft.ML.FastTree/GamClassification.cs index 980c6916a5..8a67f448ed 100644 --- a/src/Microsoft.ML.FastTree/GamClassification.cs +++ b/src/Microsoft.ML.FastTree/GamClassification.cs @@ -11,6 +11,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; [assembly: LoadableClass(BinaryClassificationGamTrainer.Summary, diff --git a/src/Microsoft.ML.FastTree/GamModelParameters.cs b/src/Microsoft.ML.FastTree/GamModelParameters.cs index 61052acd43..83cc398e6a 100644 --- a/src/Microsoft.ML.FastTree/GamModelParameters.cs +++ b/src/Microsoft.ML.FastTree/GamModelParameters.cs @@ -15,6 +15,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; using Microsoft.ML.Transforms; diff --git a/src/Microsoft.ML.FastTree/GamRegression.cs b/src/Microsoft.ML.FastTree/GamRegression.cs index ca0b127bf3..7ad930c3c1 100644 --- a/src/Microsoft.ML.FastTree/GamRegression.cs +++ b/src/Microsoft.ML.FastTree/GamRegression.cs @@ -8,6 +8,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; [assembly: LoadableClass(RegressionGamTrainer.Summary, diff --git a/src/Microsoft.ML.FastTree/GamTrainer.cs b/src/Microsoft.ML.FastTree/GamTrainer.cs index 9474a9f64f..4c607c2f1c 100644 --- a/src/Microsoft.ML.FastTree/GamTrainer.cs +++ b/src/Microsoft.ML.FastTree/GamTrainer.cs @@ -12,6 +12,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.CpuMath; using Microsoft.ML.Internal.Internallearn; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; [assembly: LoadableClass(typeof(void), typeof(Gam), null, typeof(SignatureEntryPointModule), "GAM")] @@ -49,7 +50,7 @@ namespace Microsoft.ML.Trainers.FastTree /// /// public abstract partial class GamTrainerBase : TrainerEstimatorBase - where TTransformer: ISingleFeaturePredictionTransformer + where TTransformer : ISingleFeaturePredictionTransformer where TOptions : GamTrainerBase.OptionsBase, new() where TPredictor : class { @@ -510,7 +511,7 @@ private void CenterGraph() // Shift the mean from the bins into the intercept MeanEffect += meanEffects[featureIndex]; - for (int bin=0; bin < BinEffects[featureIndex].Length; ++bin) + for (int bin = 0; bin < BinEffects[featureIndex].Length; ++bin) BinEffects[featureIndex][bin] -= meanEffects[featureIndex]; } } @@ -636,7 +637,7 @@ private struct SubGraph public SubGraph(int numFeatures, int numIterations) { Splits = new Stump[numFeatures][]; - for (int i =0; i < numFeatures; ++i) + for (int i = 0; i < numFeatures; ++i) { Splits[i] = new Stump[numIterations]; for (int j = 0; j < numIterations; j++) diff --git a/src/Microsoft.ML.FastTree/RandomForest.cs b/src/Microsoft.ML.FastTree/RandomForest.cs index 488f4eee5f..d4ddc3b1a9 100644 --- a/src/Microsoft.ML.FastTree/RandomForest.cs +++ b/src/Microsoft.ML.FastTree/RandomForest.cs @@ -2,12 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using Microsoft.ML.Runtime; + namespace Microsoft.ML.Trainers.FastTree { public abstract class RandomForestTrainerBase : FastTreeTrainerBase where TOptions : FastForestOptionsBase, new() where TModel : class - where TTransformer: ISingleFeaturePredictionTransformer + where TTransformer : ISingleFeaturePredictionTransformer { private readonly bool _quantileEnabled; diff --git a/src/Microsoft.ML.FastTree/RandomForestClassification.cs b/src/Microsoft.ML.FastTree/RandomForestClassification.cs index bde7bf5052..a00b39df04 100644 --- a/src/Microsoft.ML.FastTree/RandomForestClassification.cs +++ b/src/Microsoft.ML.FastTree/RandomForestClassification.cs @@ -11,6 +11,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; [assembly: LoadableClass(FastForestClassification.Summary, typeof(FastForestClassification), typeof(FastForestClassification.Options), diff --git a/src/Microsoft.ML.FastTree/RandomForestRegression.cs b/src/Microsoft.ML.FastTree/RandomForestRegression.cs index 3eee18666c..9ee741b37f 100644 --- a/src/Microsoft.ML.FastTree/RandomForestRegression.cs +++ b/src/Microsoft.ML.FastTree/RandomForestRegression.cs @@ -10,6 +10,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; [assembly: LoadableClass(FastForestRegression.Summary, typeof(FastForestRegression), typeof(FastForestRegression.Options), diff --git a/src/Microsoft.ML.FastTree/RegressionTree.cs b/src/Microsoft.ML.FastTree/RegressionTree.cs index 0645a9f57f..2e9d1bd0fd 100644 --- a/src/Microsoft.ML.FastTree/RegressionTree.cs +++ b/src/Microsoft.ML.FastTree/RegressionTree.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Collections.Immutable; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/SumupPerformanceCommand.cs b/src/Microsoft.ML.FastTree/SumupPerformanceCommand.cs index 98ce552d3d..e3ff03cff0 100644 --- a/src/Microsoft.ML.FastTree/SumupPerformanceCommand.cs +++ b/src/Microsoft.ML.FastTree/SumupPerformanceCommand.cs @@ -16,6 +16,7 @@ using Microsoft.ML.Command; using Microsoft.ML.CommandLine; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; [assembly: LoadableClass(typeof(SumupPerformanceCommand), typeof(SumupPerformanceCommand.Arguments), typeof(SignatureCommand), diff --git a/src/Microsoft.ML.FastTree/Training/Applications/ObjectiveFunction.cs b/src/Microsoft.ML.FastTree/Training/Applications/ObjectiveFunction.cs index 5500f2c022..e131400dc4 100644 --- a/src/Microsoft.ML.FastTree/Training/Applications/ObjectiveFunction.cs +++ b/src/Microsoft.ML.FastTree/Training/Applications/ObjectiveFunction.cs @@ -6,6 +6,7 @@ using System.Collections.Concurrent; using System.Linq; using System.Threading.Tasks; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Training/DcgCalculator.cs b/src/Microsoft.ML.FastTree/Training/DcgCalculator.cs index 5edb3ce7b8..59dfc88297 100644 --- a/src/Microsoft.ML.FastTree/Training/DcgCalculator.cs +++ b/src/Microsoft.ML.FastTree/Training/DcgCalculator.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Training/DcgPermutationComparer.cs b/src/Microsoft.ML.FastTree/Training/DcgPermutationComparer.cs index 054d9d3993..9633fe21b2 100644 --- a/src/Microsoft.ML.FastTree/Training/DcgPermutationComparer.cs +++ b/src/Microsoft.ML.FastTree/Training/DcgPermutationComparer.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { @@ -49,11 +50,13 @@ internal class DescendingStablePessimisticPermutationComparer : DescendingStable protected int _labelsOffset; #pragma warning restore MSML_GeneralName - public override short[] Labels { + public override short[] Labels + { set { _labels = value; } } - public override int LabelsOffset { + public override int LabelsOffset + { set { _labelsOffset = value; } } diff --git a/src/Microsoft.ML.FastTree/Training/DocumentPartitioning.cs b/src/Microsoft.ML.FastTree/Training/DocumentPartitioning.cs index c01422e91c..ba69cec24d 100644 --- a/src/Microsoft.ML.FastTree/Training/DocumentPartitioning.cs +++ b/src/Microsoft.ML.FastTree/Training/DocumentPartitioning.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Training/EarlyStoppingCriteria.cs b/src/Microsoft.ML.FastTree/Training/EarlyStoppingCriteria.cs index e0241379d6..de56d546a2 100644 --- a/src/Microsoft.ML.FastTree/Training/EarlyStoppingCriteria.cs +++ b/src/Microsoft.ML.FastTree/Training/EarlyStoppingCriteria.cs @@ -6,6 +6,7 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; [assembly: LoadableClass(typeof(TolerantEarlyStoppingRule), typeof(TolerantEarlyStoppingRule.Options), typeof(SignatureEarlyStoppingCriterion), "Tolerant (TR)", "tr")] diff --git a/src/Microsoft.ML.FastTree/Training/EnsembleCompression/IEnsembleCompressor.cs b/src/Microsoft.ML.FastTree/Training/EnsembleCompression/IEnsembleCompressor.cs index fb87ab95f2..a26845ac32 100644 --- a/src/Microsoft.ML.FastTree/Training/EnsembleCompression/IEnsembleCompressor.cs +++ b/src/Microsoft.ML.FastTree/Training/EnsembleCompression/IEnsembleCompressor.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Training/EnsembleCompression/LassoBasedEnsembleCompressor.cs b/src/Microsoft.ML.FastTree/Training/EnsembleCompression/LassoBasedEnsembleCompressor.cs index 69b2acd798..eb64e93889 100644 --- a/src/Microsoft.ML.FastTree/Training/EnsembleCompression/LassoBasedEnsembleCompressor.cs +++ b/src/Microsoft.ML.FastTree/Training/EnsembleCompression/LassoBasedEnsembleCompressor.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/AcceleratedGradientDescent.cs b/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/AcceleratedGradientDescent.cs index 72cf5af52c..f9469b2044 100644 --- a/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/AcceleratedGradientDescent.cs +++ b/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/AcceleratedGradientDescent.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/ConjugateGradientDescent.cs b/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/ConjugateGradientDescent.cs index bde9917c53..5955408a8c 100644 --- a/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/ConjugateGradientDescent.cs +++ b/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/ConjugateGradientDescent.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/GradientDescent.cs b/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/GradientDescent.cs index 0d810c4807..e2884dd78e 100644 --- a/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/GradientDescent.cs +++ b/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/GradientDescent.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { @@ -75,7 +76,7 @@ private protected virtual double[] GetGradient(IChannel ch) } else return ObjectiveFunction.GetGradient(ch, TrainingScores.Scores); - } + } protected virtual double[] AdjustTargetsAndSetWeights(IChannel ch) { diff --git a/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/NoOptimizationAlgorithm.cs b/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/NoOptimizationAlgorithm.cs index 9e53353316..e19f96dc9a 100644 --- a/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/NoOptimizationAlgorithm.cs +++ b/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/NoOptimizationAlgorithm.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/OptimizationAlgorithm.cs b/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/OptimizationAlgorithm.cs index 8df60b14d5..ba85172fdb 100644 --- a/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/OptimizationAlgorithm.cs +++ b/src/Microsoft.ML.FastTree/Training/OptimizationAlgorithms/OptimizationAlgorithm.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Training/Parallel/IParallelTraining.cs b/src/Microsoft.ML.FastTree/Training/Parallel/IParallelTraining.cs index 965026556c..90d4553ab4 100644 --- a/src/Microsoft.ML.FastTree/Training/Parallel/IParallelTraining.cs +++ b/src/Microsoft.ML.FastTree/Training/Parallel/IParallelTraining.cs @@ -4,6 +4,7 @@ using System; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Training/Parallel/SingleTrainer.cs b/src/Microsoft.ML.FastTree/Training/Parallel/SingleTrainer.cs index 52adef9a50..213e6722e7 100644 --- a/src/Microsoft.ML.FastTree/Training/Parallel/SingleTrainer.cs +++ b/src/Microsoft.ML.FastTree/Training/Parallel/SingleTrainer.cs @@ -6,6 +6,7 @@ using Microsoft.ML; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; [assembly: LoadableClass(typeof(SingleTrainer), diff --git a/src/Microsoft.ML.FastTree/Training/ScoreTracker.cs b/src/Microsoft.ML.FastTree/Training/ScoreTracker.cs index dffe32d3b8..0245fabd31 100644 --- a/src/Microsoft.ML.FastTree/Training/ScoreTracker.cs +++ b/src/Microsoft.ML.FastTree/Training/ScoreTracker.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Training/Test.cs b/src/Microsoft.ML.FastTree/Training/Test.cs index 85b6386725..d931e0ea7d 100644 --- a/src/Microsoft.ML.FastTree/Training/Test.cs +++ b/src/Microsoft.ML.FastTree/Training/Test.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Training/TreeLearners/FastForestLeastSquaresTreeLearner.cs b/src/Microsoft.ML.FastTree/Training/TreeLearners/FastForestLeastSquaresTreeLearner.cs index ae7f2a3b2f..81c4063729 100644 --- a/src/Microsoft.ML.FastTree/Training/TreeLearners/FastForestLeastSquaresTreeLearner.cs +++ b/src/Microsoft.ML.FastTree/Training/TreeLearners/FastForestLeastSquaresTreeLearner.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { @@ -16,7 +17,7 @@ public RandomForestLeastSquaresTreeLearner(Dataset trainData, int numLeaves, int Double gainConfidenceLevel, int maxCategoricalGroupsPerNode, int maxCategoricalSplitPointsPerNode, bool quantileEnabled, int quantileSampleCount, IParallelTraining parallelTraining, double minDocsPercentageForCategoricalSplit, Bundle bundling, int minDocsForCategoricalSplit, double bias) : base(trainData, numLeaves, minDocsInLeaf, entropyCoefficient, featureFirstUsePenalty, featureReusePenalty, softmaxTemperature, histogramPoolSize, - randomSeed, splitFraction, false, allowEmptyTrees, gainConfidenceLevel, maxCategoricalGroupsPerNode, maxCategoricalSplitPointsPerNode, - 1, parallelTraining, + randomSeed, splitFraction, false, allowEmptyTrees, gainConfidenceLevel, maxCategoricalGroupsPerNode, maxCategoricalSplitPointsPerNode, -1, parallelTraining, minDocsPercentageForCategoricalSplit, bundling, minDocsForCategoricalSplit, bias) { _quantileSampleCount = quantileSampleCount; diff --git a/src/Microsoft.ML.FastTree/Training/TreeLearners/LeastSquaresRegressionTreeLearner.cs b/src/Microsoft.ML.FastTree/Training/TreeLearners/LeastSquaresRegressionTreeLearner.cs index 2cf8f44a75..cf382ee46f 100644 --- a/src/Microsoft.ML.FastTree/Training/TreeLearners/LeastSquaresRegressionTreeLearner.cs +++ b/src/Microsoft.ML.FastTree/Training/TreeLearners/LeastSquaresRegressionTreeLearner.cs @@ -8,6 +8,7 @@ using System.Threading.Tasks; using Microsoft.ML.Internal.CpuMath; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Training/TreeLearners/TreeLearner.cs b/src/Microsoft.ML.FastTree/Training/TreeLearners/TreeLearner.cs index 93dd45ca60..20cbc714b9 100644 --- a/src/Microsoft.ML.FastTree/Training/TreeLearners/TreeLearner.cs +++ b/src/Microsoft.ML.FastTree/Training/TreeLearners/TreeLearner.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/TreeEnsemble/InternalQuantileRegressionTree.cs b/src/Microsoft.ML.FastTree/TreeEnsemble/InternalQuantileRegressionTree.cs index 73c308be8f..c967098dca 100644 --- a/src/Microsoft.ML.FastTree/TreeEnsemble/InternalQuantileRegressionTree.cs +++ b/src/Microsoft.ML.FastTree/TreeEnsemble/InternalQuantileRegressionTree.cs @@ -4,7 +4,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/TreeEnsemble/InternalRegressionTree.cs b/src/Microsoft.ML.FastTree/TreeEnsemble/InternalRegressionTree.cs index d1e8cf094b..3a8fdd590c 100644 --- a/src/Microsoft.ML.FastTree/TreeEnsemble/InternalRegressionTree.cs +++ b/src/Microsoft.ML.FastTree/TreeEnsemble/InternalRegressionTree.cs @@ -11,8 +11,8 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Newtonsoft.Json.Linq; namespace Microsoft.ML.Trainers.FastTree @@ -419,16 +419,16 @@ public static InternalRegressionTree Load(ModelLoadContext ctx, bool usingDefaul TreeType code = (TreeType)ctx.Reader.ReadByte(); switch (code) { - case TreeType.Regression: - return new InternalRegressionTree(ctx, usingDefaultValues, categoricalSplits); - case TreeType.Affine: - // Affine regression trees do not actually work, nor is it clear how they ever - // could have worked within TLC, so the chance of this happening seems remote. - throw Contracts.ExceptNotSupp("Affine regression trees unsupported"); - case TreeType.FastForest: - return new InternalQuantileRegressionTree(ctx, usingDefaultValues, categoricalSplits); - default: - throw Contracts.ExceptDecode(); + case TreeType.Regression: + return new InternalRegressionTree(ctx, usingDefaultValues, categoricalSplits); + case TreeType.Affine: + // Affine regression trees do not actually work, nor is it clear how they ever + // could have worked within TLC, so the chance of this happening seems remote. + throw Contracts.ExceptNotSupp("Affine regression trees unsupported"); + case TreeType.FastForest: + return new InternalQuantileRegressionTree(ctx, usingDefaultValues, categoricalSplits); + default: + throw Contracts.ExceptDecode(); } } diff --git a/src/Microsoft.ML.FastTree/TreeEnsemble/InternalTreeEnsemble.cs b/src/Microsoft.ML.FastTree/TreeEnsemble/InternalTreeEnsemble.cs index 97d9b21b65..1be64c82fb 100644 --- a/src/Microsoft.ML.FastTree/TreeEnsemble/InternalTreeEnsemble.cs +++ b/src/Microsoft.ML.FastTree/TreeEnsemble/InternalTreeEnsemble.cs @@ -10,8 +10,8 @@ using System.Threading.Tasks; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Newtonsoft.Json.Linq; namespace Microsoft.ML.Trainers.FastTree @@ -383,12 +383,15 @@ internal class FeatureToGainMap : Dictionary { public FeatureToGainMap() { } // Override default Dictionary to return 0.0 for non-eisting keys - public new double this[int key] { - get { + public new double this[int key] + { + get + { TryGetValue(key, out double retval); return retval; } - set { + set + { base[key] = value; } } diff --git a/src/Microsoft.ML.FastTree/TreeEnsemble/TreeEnsembleCombiner.cs b/src/Microsoft.ML.FastTree/TreeEnsemble/TreeEnsembleCombiner.cs index 8643058684..6d847c4edc 100644 --- a/src/Microsoft.ML.FastTree/TreeEnsemble/TreeEnsembleCombiner.cs +++ b/src/Microsoft.ML.FastTree/TreeEnsemble/TreeEnsembleCombiner.cs @@ -6,6 +6,7 @@ using Microsoft.ML; using Microsoft.ML.Calibrators; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; [assembly: LoadableClass(typeof(TreeEnsembleCombiner), null, typeof(SignatureModelCombiner), "Fast Tree Model Combiner", "FastTreeCombiner")] @@ -104,7 +105,7 @@ IPredictor IModelCombiner.CombineModels(IEnumerable models) var cali = new PlattCalibrator(_host, -1, 0); var fastTreeModel = new FastTreeBinaryModelParameters(_host, ensemble, featureCount, null); - return new FeatureWeightsCalibratedModelParameters(_host, fastTreeModel, cali); + return new FeatureWeightsCalibratedModelParameters(_host, fastTreeModel, cali); case PredictionKind.Regression: return new FastTreeRegressionModelParameters(_host, ensemble, featureCount, null); case PredictionKind.Ranking: diff --git a/src/Microsoft.ML.FastTree/TreeEnsembleFeaturizer.cs b/src/Microsoft.ML.FastTree/TreeEnsembleFeaturizer.cs index 19322d9c86..b250fb5e1d 100644 --- a/src/Microsoft.ML.FastTree/TreeEnsembleFeaturizer.cs +++ b/src/Microsoft.ML.FastTree/TreeEnsembleFeaturizer.cs @@ -15,6 +15,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; using Microsoft.ML.Transforms; using Microsoft.ML.TreePredictor; @@ -202,7 +203,6 @@ private sealed class State private VBuffer _src; private ValueGetter> _featureGetter; - private long _cachedPosition; private readonly int[] _leafIds; private readonly List[] _pathIds; @@ -697,7 +697,7 @@ private static IDataView AppendFloatMapper(IHostEnvironment env, IChanne return; } converter(in src, ref temp); - dst = (Single)(temp - 1); + dst = temp - 1; }; } else @@ -713,7 +713,7 @@ private static IDataView AppendFloatMapper(IHostEnvironment env, IChanne return; } converter(in src, ref temp); - dst = (Single)permutation[(int)(temp - 1)]; + dst = permutation[(int)(temp - 1)]; }; } diff --git a/src/Microsoft.ML.FastTree/TreeTrainersCatalog.cs b/src/Microsoft.ML.FastTree/TreeTrainersCatalog.cs index f2ab847fea..ee86489335 100644 --- a/src/Microsoft.ML.FastTree/TreeTrainersCatalog.cs +++ b/src/Microsoft.ML.FastTree/TreeTrainersCatalog.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; namespace Microsoft.ML diff --git a/src/Microsoft.ML.FastTree/Utils/Algorithms.cs b/src/Microsoft.ML.FastTree/Utils/Algorithms.cs index 2a084c55b1..4f21980553 100644 --- a/src/Microsoft.ML.FastTree/Utils/Algorithms.cs +++ b/src/Microsoft.ML.FastTree/Utils/Algorithms.cs @@ -4,6 +4,7 @@ using System; using System.Linq; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Utils/BufferPoolManager.cs b/src/Microsoft.ML.FastTree/Utils/BufferPoolManager.cs index 5c12da8dca..f978651f65 100644 --- a/src/Microsoft.ML.FastTree/Utils/BufferPoolManager.cs +++ b/src/Microsoft.ML.FastTree/Utils/BufferPoolManager.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Utils/FastTreeIniFileUtils.cs b/src/Microsoft.ML.FastTree/Utils/FastTreeIniFileUtils.cs index 0d0d895637..e8a40442ac 100644 --- a/src/Microsoft.ML.FastTree/Utils/FastTreeIniFileUtils.cs +++ b/src/Microsoft.ML.FastTree/Utils/FastTreeIniFileUtils.cs @@ -6,6 +6,7 @@ using Microsoft.ML.Calibrators; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.FastTree/Utils/ThreadTaskManager.cs b/src/Microsoft.ML.FastTree/Utils/ThreadTaskManager.cs index fe4bcf57e6..4bc1c6c8a5 100644 --- a/src/Microsoft.ML.FastTree/Utils/ThreadTaskManager.cs +++ b/src/Microsoft.ML.FastTree/Utils/ThreadTaskManager.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers.FastTree { diff --git a/src/Microsoft.ML.ImageAnalytics/EntryPoints/ImageAnalytics.cs b/src/Microsoft.ML.ImageAnalytics/EntryPoints/ImageAnalytics.cs index 9302e8df26..c612c9ed66 100644 --- a/src/Microsoft.ML.ImageAnalytics/EntryPoints/ImageAnalytics.cs +++ b/src/Microsoft.ML.ImageAnalytics/EntryPoints/ImageAnalytics.cs @@ -5,6 +5,7 @@ using Microsoft.ML; using Microsoft.ML.EntryPoints; using Microsoft.ML.ImageAnalytics; +using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(void), typeof(ImageAnalyticsEntryPoints), null, typeof(SignatureEntryPointModule), "ImageAnalytics")] namespace Microsoft.ML.ImageAnalytics diff --git a/src/Microsoft.ML.ImageAnalytics/ImageGrayscale.cs b/src/Microsoft.ML.ImageAnalytics/ImageGrayscale.cs index 4fbf766453..33dadd369a 100644 --- a/src/Microsoft.ML.ImageAnalytics/ImageGrayscale.cs +++ b/src/Microsoft.ML.ImageAnalytics/ImageGrayscale.cs @@ -14,7 +14,7 @@ using Microsoft.ML.Data; using Microsoft.ML.ImageAnalytics; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(ImageGrayscalingTransformer.Summary, typeof(IDataTransform), typeof(ImageGrayscalingTransformer), typeof(ImageGrayscalingTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.ImageAnalytics/ImageLoader.cs b/src/Microsoft.ML.ImageAnalytics/ImageLoader.cs index 1ea180a1a0..1808bcc738 100644 --- a/src/Microsoft.ML.ImageAnalytics/ImageLoader.cs +++ b/src/Microsoft.ML.ImageAnalytics/ImageLoader.cs @@ -14,7 +14,7 @@ using Microsoft.ML.Data; using Microsoft.ML.ImageAnalytics; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(ImageLoadingTransformer.Summary, typeof(IDataTransform), typeof(ImageLoadingTransformer), typeof(ImageLoadingTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.ImageAnalytics/ImagePixelExtractor.cs b/src/Microsoft.ML.ImageAnalytics/ImagePixelExtractor.cs index ac5425561e..a56d1298b2 100644 --- a/src/Microsoft.ML.ImageAnalytics/ImagePixelExtractor.cs +++ b/src/Microsoft.ML.ImageAnalytics/ImagePixelExtractor.cs @@ -12,10 +12,9 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.ImageAnalytics; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(ImagePixelExtractingTransformer.Summary, typeof(IDataTransform), typeof(ImagePixelExtractingTransformer), typeof(ImagePixelExtractingTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.ImageAnalytics/ImageResizer.cs b/src/Microsoft.ML.ImageAnalytics/ImageResizer.cs index 336824b679..134acc4463 100644 --- a/src/Microsoft.ML.ImageAnalytics/ImageResizer.cs +++ b/src/Microsoft.ML.ImageAnalytics/ImageResizer.cs @@ -11,11 +11,10 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.ImageAnalytics; using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(ImageResizingTransformer.Summary, typeof(IDataTransform), typeof(ImageResizingTransformer), typeof(ImageResizingTransformer.Arguments), diff --git a/src/Microsoft.ML.ImageAnalytics/ImageType.cs b/src/Microsoft.ML.ImageAnalytics/ImageType.cs index 0e5a4aed3a..c985741ec5 100644 --- a/src/Microsoft.ML.ImageAnalytics/ImageType.cs +++ b/src/Microsoft.ML.ImageAnalytics/ImageType.cs @@ -5,6 +5,7 @@ using System.Drawing; using Microsoft.Data.DataView; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.ImageAnalytics { diff --git a/src/Microsoft.ML.ImageAnalytics/VectorToImageTransform.cs b/src/Microsoft.ML.ImageAnalytics/VectorToImageTransform.cs index 539317aab9..777cb8b95e 100644 --- a/src/Microsoft.ML.ImageAnalytics/VectorToImageTransform.cs +++ b/src/Microsoft.ML.ImageAnalytics/VectorToImageTransform.cs @@ -13,7 +13,7 @@ using Microsoft.ML.Data; using Microsoft.ML.ImageAnalytics; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(VectorToImageConvertingTransformer.Summary, typeof(IDataTransform), typeof(VectorToImageConvertingTransformer), typeof(VectorToImageConvertingTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.KMeansClustering/KMeansCatalog.cs b/src/Microsoft.ML.KMeansClustering/KMeansCatalog.cs index df6d5091e9..49431d4365 100644 --- a/src/Microsoft.ML.KMeansClustering/KMeansCatalog.cs +++ b/src/Microsoft.ML.KMeansClustering/KMeansCatalog.cs @@ -2,9 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; namespace Microsoft.ML diff --git a/src/Microsoft.ML.KMeansClustering/KMeansModelParameters.cs b/src/Microsoft.ML.KMeansClustering/KMeansModelParameters.cs index b5231e3ca9..fad0f631d9 100644 --- a/src/Microsoft.ML.KMeansClustering/KMeansModelParameters.cs +++ b/src/Microsoft.ML.KMeansClustering/KMeansModelParameters.cs @@ -12,6 +12,7 @@ using Microsoft.ML.Model; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; [assembly: LoadableClass(typeof(KMeansModelParameters), null, typeof(SignatureLoadModel), @@ -331,14 +332,14 @@ bool ISingleCanSaveOnnx.SaveAsOnnx(OnnxContext ctx, string[] outputNames, string var nameX = featureColumn; // Compute X^2 from X - var nameX2 = ctx.AddIntermediateVariable(null , "X2", true); + var nameX2 = ctx.AddIntermediateVariable(null, "X2", true); var reduceNodeX2 = ctx.CreateNode("ReduceSumSquare", nameX, nameX2, ctx.GetNodeName("ReduceSumSquare"), ""); // Compute -2XC^T. Note that Gemm always takes three inputs. Since we only have two here, // a dummy one, named zero, is created. var zeroName = ctx.AddInitializer(new float[] { 0f }, null, "zero"); var nameXC2 = ctx.AddIntermediateVariable(null, "XC2", true); - var gemmNodeXC2 = ctx.CreateNode("Gemm", new[] { nameX, nameC, zeroName}, new[] { nameXC2 }, ctx.GetNodeName("Gemm"), ""); + var gemmNodeXC2 = ctx.CreateNode("Gemm", new[] { nameX, nameC, zeroName }, new[] { nameXC2 }, ctx.GetNodeName("Gemm"), ""); gemmNodeXC2.AddAttribute("alpha", -2f); gemmNodeXC2.AddAttribute("transB", 1); diff --git a/src/Microsoft.ML.KMeansClustering/KMeansPlusPlusTrainer.cs b/src/Microsoft.ML.KMeansClustering/KMeansPlusPlusTrainer.cs index e285568868..99f1630c45 100644 --- a/src/Microsoft.ML.KMeansClustering/KMeansPlusPlusTrainer.cs +++ b/src/Microsoft.ML.KMeansClustering/KMeansPlusPlusTrainer.cs @@ -14,6 +14,7 @@ using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; [assembly: LoadableClass(KMeansPlusPlusTrainer.Summary, typeof(KMeansPlusPlusTrainer), typeof(KMeansPlusPlusTrainer.Options), @@ -25,7 +26,7 @@ [assembly: LoadableClass(typeof(void), typeof(KMeansPlusPlusTrainer), null, typeof(SignatureEntryPointModule), "KMeans")] namespace Microsoft.ML.Trainers - { +{ /// public class KMeansPlusPlusTrainer : TrainerEstimatorBase, KMeansModelParameters> { diff --git a/src/Microsoft.ML.LightGBM.StaticPipe/LightGbmStaticExtensions.cs b/src/Microsoft.ML.LightGBM.StaticPipe/LightGbmStaticExtensions.cs index fb84489ff0..6e4ac7000e 100644 --- a/src/Microsoft.ML.LightGBM.StaticPipe/LightGbmStaticExtensions.cs +++ b/src/Microsoft.ML.LightGBM.StaticPipe/LightGbmStaticExtensions.cs @@ -4,6 +4,7 @@ using System; using Microsoft.ML.Calibrators; +using Microsoft.ML.Runtime; using Microsoft.ML.StaticPipe; using Microsoft.ML.Trainers; diff --git a/src/Microsoft.ML.LightGBM/LightGbmArguments.cs b/src/Microsoft.ML.LightGBM/LightGbmArguments.cs index 21dbb0753f..c243e23f2b 100644 --- a/src/Microsoft.ML.LightGBM/LightGbmArguments.cs +++ b/src/Microsoft.ML.LightGBM/LightGbmArguments.cs @@ -10,6 +10,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.LightGBM; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; [assembly: LoadableClass(typeof(Options.TreeBooster), typeof(Options.TreeBooster.Options), diff --git a/src/Microsoft.ML.LightGBM/LightGbmBinaryTrainer.cs b/src/Microsoft.ML.LightGBM/LightGbmBinaryTrainer.cs index 66f28f98b1..7259e25d54 100644 --- a/src/Microsoft.ML.LightGBM/LightGbmBinaryTrainer.cs +++ b/src/Microsoft.ML.LightGBM/LightGbmBinaryTrainer.cs @@ -8,6 +8,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.LightGBM; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Microsoft.ML.Trainers.FastTree; diff --git a/src/Microsoft.ML.LightGBM/LightGbmCatalog.cs b/src/Microsoft.ML.LightGBM/LightGbmCatalog.cs index ce610af9b2..1c3877625d 100644 --- a/src/Microsoft.ML.LightGBM/LightGbmCatalog.cs +++ b/src/Microsoft.ML.LightGBM/LightGbmCatalog.cs @@ -2,9 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using Microsoft.ML.Data; using Microsoft.ML.LightGBM; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.LightGBM/LightGbmMulticlassTrainer.cs b/src/Microsoft.ML.LightGBM/LightGbmMulticlassTrainer.cs index 6e01c37c7d..c149f38818 100644 --- a/src/Microsoft.ML.LightGBM/LightGbmMulticlassTrainer.cs +++ b/src/Microsoft.ML.LightGBM/LightGbmMulticlassTrainer.cs @@ -10,6 +10,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.LightGBM; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Microsoft.ML.Trainers.FastTree; diff --git a/src/Microsoft.ML.LightGBM/LightGbmRankingTrainer.cs b/src/Microsoft.ML.LightGBM/LightGbmRankingTrainer.cs index 5e1cfe311d..6dc5d048cc 100644 --- a/src/Microsoft.ML.LightGBM/LightGbmRankingTrainer.cs +++ b/src/Microsoft.ML.LightGBM/LightGbmRankingTrainer.cs @@ -8,7 +8,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.LightGBM; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Microsoft.ML.Trainers.FastTree; diff --git a/src/Microsoft.ML.LightGBM/LightGbmRegressionTrainer.cs b/src/Microsoft.ML.LightGBM/LightGbmRegressionTrainer.cs index b1981250e3..2932b1e6ab 100644 --- a/src/Microsoft.ML.LightGBM/LightGbmRegressionTrainer.cs +++ b/src/Microsoft.ML.LightGBM/LightGbmRegressionTrainer.cs @@ -7,7 +7,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.LightGBM; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Microsoft.ML.Trainers.FastTree; diff --git a/src/Microsoft.ML.LightGBM/LightGbmTrainerBase.cs b/src/Microsoft.ML.LightGBM/LightGbmTrainerBase.cs index 5d4504add7..a5e2a096bf 100644 --- a/src/Microsoft.ML.LightGBM/LightGbmTrainerBase.cs +++ b/src/Microsoft.ML.LightGBM/LightGbmTrainerBase.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Microsoft.ML.Trainers.FastTree; diff --git a/src/Microsoft.ML.LightGBM/Parallel/IParallel.cs b/src/Microsoft.ML.LightGBM/Parallel/IParallel.cs index 9948d1bb06..45cf6f0f6d 100644 --- a/src/Microsoft.ML.LightGBM/Parallel/IParallel.cs +++ b/src/Microsoft.ML.LightGBM/Parallel/IParallel.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; namespace Microsoft.ML.LightGBM { diff --git a/src/Microsoft.ML.LightGBM/Parallel/SingleTrainer.cs b/src/Microsoft.ML.LightGBM/Parallel/SingleTrainer.cs index 096e2277ef..88c82ec101 100644 --- a/src/Microsoft.ML.LightGBM/Parallel/SingleTrainer.cs +++ b/src/Microsoft.ML.LightGBM/Parallel/SingleTrainer.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using Microsoft.ML; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; [assembly: LoadableClass(typeof(Microsoft.ML.LightGBM.SingleTrainer), null, typeof(Microsoft.ML.LightGBM.SignatureParallelTrainer), "single")] diff --git a/src/Microsoft.ML.LightGBM/WrappedLightGbmBooster.cs b/src/Microsoft.ML.LightGBM/WrappedLightGbmBooster.cs index 21c3eb4a13..8e974a43ec 100644 --- a/src/Microsoft.ML.LightGBM/WrappedLightGbmBooster.cs +++ b/src/Microsoft.ML.LightGBM/WrappedLightGbmBooster.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; namespace Microsoft.ML.LightGBM diff --git a/src/Microsoft.ML.LightGBM/WrappedLightGbmDataset.cs b/src/Microsoft.ML.LightGBM/WrappedLightGbmDataset.cs index 2580dee492..7c60d54565 100644 --- a/src/Microsoft.ML.LightGBM/WrappedLightGbmDataset.cs +++ b/src/Microsoft.ML.LightGBM/WrappedLightGbmDataset.cs @@ -4,6 +4,7 @@ using System; using System.Runtime.InteropServices; +using Microsoft.ML.Runtime; namespace Microsoft.ML.LightGBM { @@ -54,7 +55,7 @@ public unsafe Dataset(double[][] sampleValuePerColumn, { double*[] ptrArrayValues = new double*[numCol]; int*[] ptrArrayIndices = new int*[numCol]; - for(int i = 0; i < numCol; i++) + for (int i = 0; i < numCol; i++) { gcValues[i] = GCHandle.Alloc(sampleValuePerColumn[i], GCHandleType.Pinned); ptrArrayValues[i] = (double*)gcValues[i].AddrOfPinnedObject().ToPointer(); diff --git a/src/Microsoft.ML.LightGBM/WrappedLightGbmInterface.cs b/src/Microsoft.ML.LightGBM/WrappedLightGbmInterface.cs index 48128a84f8..835d1456db 100644 --- a/src/Microsoft.ML.LightGBM/WrappedLightGbmInterface.cs +++ b/src/Microsoft.ML.LightGBM/WrappedLightGbmInterface.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Globalization; using System.Runtime.InteropServices; +using Microsoft.ML.Runtime; namespace Microsoft.ML.LightGBM { diff --git a/src/Microsoft.ML.LightGBM/WrappedLightGbmTraining.cs b/src/Microsoft.ML.LightGBM/WrappedLightGbmTraining.cs index 79b0b96660..fc55141992 100644 --- a/src/Microsoft.ML.LightGBM/WrappedLightGbmTraining.cs +++ b/src/Microsoft.ML.LightGBM/WrappedLightGbmTraining.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; +using Microsoft.ML.Runtime; namespace Microsoft.ML.LightGBM { diff --git a/src/Microsoft.ML.Maml/ChainCommand.cs b/src/Microsoft.ML.Maml/ChainCommand.cs index b9068a92b9..15a353d356 100644 --- a/src/Microsoft.ML.Maml/ChainCommand.cs +++ b/src/Microsoft.ML.Maml/ChainCommand.cs @@ -6,6 +6,7 @@ using Microsoft.ML; using Microsoft.ML.Command; using Microsoft.ML.CommandLine; +using Microsoft.ML.Runtime; using Microsoft.ML.Tools; [assembly: LoadableClass(ChainCommand.Summary, typeof(ChainCommand), typeof(ChainCommand.Arguments), typeof(SignatureCommand), diff --git a/src/Microsoft.ML.Maml/HelpCommand.cs b/src/Microsoft.ML.Maml/HelpCommand.cs index b8d4833d80..1fa8cd3e30 100644 --- a/src/Microsoft.ML.Maml/HelpCommand.cs +++ b/src/Microsoft.ML.Maml/HelpCommand.cs @@ -14,6 +14,7 @@ using Microsoft.ML.Command; using Microsoft.ML.CommandLine; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Tools; [assembly: LoadableClass(HelpCommand.Summary, typeof(HelpCommand), typeof(HelpCommand.Arguments), typeof(SignatureCommand), diff --git a/src/Microsoft.ML.Maml/MAML.cs b/src/Microsoft.ML.Maml/MAML.cs index 7fdf21eb5d..6f65a7b867 100644 --- a/src/Microsoft.ML.Maml/MAML.cs +++ b/src/Microsoft.ML.Maml/MAML.cs @@ -11,7 +11,7 @@ using System.Threading.Tasks; using Microsoft.ML.Command; using Microsoft.ML.CommandLine; -using Microsoft.ML.Data; +using Microsoft.ML.Runtime; #if CORECLR #endif diff --git a/src/Microsoft.ML.Maml/VersionCommand.cs b/src/Microsoft.ML.Maml/VersionCommand.cs index 292df51e42..c69a938f46 100644 --- a/src/Microsoft.ML.Maml/VersionCommand.cs +++ b/src/Microsoft.ML.Maml/VersionCommand.cs @@ -5,6 +5,7 @@ using System.Reflection; using Microsoft.ML; using Microsoft.ML.Command; +using Microsoft.ML.Runtime; using Microsoft.ML.Tools; [assembly: LoadableClass(VersionCommand.Summary, typeof(VersionCommand), null, typeof(SignatureCommand), diff --git a/src/Microsoft.ML.Mkl.Components.StaticPipe/VectorWhiteningStaticExtensions.cs b/src/Microsoft.ML.Mkl.Components.StaticPipe/VectorWhiteningStaticExtensions.cs index 636f79fb53..62c29ddc20 100644 --- a/src/Microsoft.ML.Mkl.Components.StaticPipe/VectorWhiteningStaticExtensions.cs +++ b/src/Microsoft.ML.Mkl.Components.StaticPipe/VectorWhiteningStaticExtensions.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; +using Microsoft.ML.Runtime; using Microsoft.ML.StaticPipe; using Microsoft.ML.Transforms; diff --git a/src/Microsoft.ML.Mkl.Components/ComputeLRTrainingStdThroughHal.cs b/src/Microsoft.ML.Mkl.Components/ComputeLRTrainingStdThroughHal.cs index 12e8fe1894..02bc7e11d2 100644 --- a/src/Microsoft.ML.Mkl.Components/ComputeLRTrainingStdThroughHal.cs +++ b/src/Microsoft.ML.Mkl.Components/ComputeLRTrainingStdThroughHal.cs @@ -5,6 +5,7 @@ using System; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; namespace Microsoft.ML.Trainers diff --git a/src/Microsoft.ML.Mkl.Components/MklComponentsCatalog.cs b/src/Microsoft.ML.Mkl.Components/MklComponentsCatalog.cs index cba93bb038..b6b1fbc43c 100644 --- a/src/Microsoft.ML.Mkl.Components/MklComponentsCatalog.cs +++ b/src/Microsoft.ML.Mkl.Components/MklComponentsCatalog.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Microsoft.ML.Transforms; diff --git a/src/Microsoft.ML.Mkl.Components/OlsLinearRegression.cs b/src/Microsoft.ML.Mkl.Components/OlsLinearRegression.cs index da645f1c44..2e94bea742 100644 --- a/src/Microsoft.ML.Mkl.Components/OlsLinearRegression.cs +++ b/src/Microsoft.ML.Mkl.Components/OlsLinearRegression.cs @@ -15,6 +15,7 @@ using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; [assembly: LoadableClass(OrdinaryLeastSquaresRegressionTrainer.Summary, typeof(OrdinaryLeastSquaresRegressionTrainer), typeof(OrdinaryLeastSquaresRegressionTrainer.Options), diff --git a/src/Microsoft.ML.Mkl.Components/SymSgdClassificationTrainer.cs b/src/Microsoft.ML.Mkl.Components/SymSgdClassificationTrainer.cs index 8af12c405d..397b01f778 100644 --- a/src/Microsoft.ML.Mkl.Components/SymSgdClassificationTrainer.cs +++ b/src/Microsoft.ML.Mkl.Components/SymSgdClassificationTrainer.cs @@ -16,6 +16,7 @@ using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Microsoft.ML.Transforms; diff --git a/src/Microsoft.ML.Mkl.Components/VectorWhitening.cs b/src/Microsoft.ML.Mkl.Components/VectorWhitening.cs index 8adb6da3a3..ba488f43cd 100644 --- a/src/Microsoft.ML.Mkl.Components/VectorWhitening.cs +++ b/src/Microsoft.ML.Mkl.Components/VectorWhitening.cs @@ -14,6 +14,7 @@ using Microsoft.ML.Internal.CpuMath; using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(VectorWhiteningTransformer.Summary, typeof(IDataTransform), typeof(VectorWhiteningTransformer), typeof(VectorWhiteningTransformer.Options), typeof(SignatureDataTransform), @@ -530,7 +531,7 @@ public static unsafe void Gemv(Layout layout, Transpose trans, int m, int n, flo // See: https://software.intel.com/en-us/node/520750 [DllImport(MklPath, CallingConvention = CallingConvention.Cdecl, EntryPoint = "cblas_sgemv"), SuppressUnmanagedCodeSecurity] - private static unsafe extern void Gemv(Layout layout, Transpose trans, int m, int n, float alpha, + private static extern unsafe void Gemv(Layout layout, Transpose trans, int m, int n, float alpha, float* a, int lda, float* x, int incx, float beta, float* y, int incy); // See: https://software.intel.com/en-us/node/520775 diff --git a/src/Microsoft.ML.OnnxConverter/OnnxContextImpl.cs b/src/Microsoft.ML.OnnxConverter/OnnxContextImpl.cs index 943e8e3dc1..5c6e5e7d87 100644 --- a/src/Microsoft.ML.OnnxConverter/OnnxContextImpl.cs +++ b/src/Microsoft.ML.OnnxConverter/OnnxContextImpl.cs @@ -6,8 +6,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Data.DataView; -using Microsoft.ML.Model.OnnxConverter; - +using Microsoft.ML.Runtime; namespace Microsoft.ML.Model.OnnxConverter { /// diff --git a/src/Microsoft.ML.OnnxConverter/OnnxNodeImpl.cs b/src/Microsoft.ML.OnnxConverter/OnnxNodeImpl.cs index 8906765b79..b3c67566ea 100644 --- a/src/Microsoft.ML.OnnxConverter/OnnxNodeImpl.cs +++ b/src/Microsoft.ML.OnnxConverter/OnnxNodeImpl.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using Microsoft.ML.Runtime; using static Microsoft.ML.Model.OnnxConverter.OnnxCSharpToProtoWrapper; namespace Microsoft.ML.Model.OnnxConverter diff --git a/src/Microsoft.ML.OnnxConverter/OnnxUtils.cs b/src/Microsoft.ML.OnnxConverter/OnnxUtils.cs index 44ea72c6a9..e109abdfbe 100644 --- a/src/Microsoft.ML.OnnxConverter/OnnxUtils.cs +++ b/src/Microsoft.ML.OnnxConverter/OnnxUtils.cs @@ -9,6 +9,7 @@ using Google.Protobuf; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using static Microsoft.ML.Model.OnnxConverter.OnnxCSharpToProtoWrapper; namespace Microsoft.ML.Model.OnnxConverter diff --git a/src/Microsoft.ML.OnnxConverter/SaveOnnxCommand.cs b/src/Microsoft.ML.OnnxConverter/SaveOnnxCommand.cs index 07dffc0152..63e2ea6957 100644 --- a/src/Microsoft.ML.OnnxConverter/SaveOnnxCommand.cs +++ b/src/Microsoft.ML.OnnxConverter/SaveOnnxCommand.cs @@ -13,6 +13,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model.OnnxConverter; +using Microsoft.ML.Runtime; using Newtonsoft.Json; using static Microsoft.ML.Model.OnnxConverter.OnnxCSharpToProtoWrapper; @@ -141,7 +142,7 @@ internal static void GetPipe(OnnxContextImpl ctx, IChannel ch, IDataView end, ou } internal static ModelProto ConvertTransformListToOnnxModel(OnnxContextImpl ctx, IChannel ch, IDataView inputData, IDataView outputData, - LinkedList transforms, HashSet inputColumnNamesToDrop=null, HashSet outputColumnNamesToDrop=null) + LinkedList transforms, HashSet inputColumnNamesToDrop = null, HashSet outputColumnNamesToDrop = null) { inputColumnNamesToDrop = inputColumnNamesToDrop ?? new HashSet(); outputColumnNamesToDrop = outputColumnNamesToDrop ?? new HashSet(); @@ -150,7 +151,7 @@ internal static ModelProto ConvertTransformListToOnnxModel(OnnxContextImpl ctx, for (int i = 0; i < inputData.Schema.Count; i++) { string colName = inputData.Schema[i].Name; - if(inputColumnNamesToDrop.Contains(colName)) + if (inputColumnNamesToDrop.Contains(colName)) continue; ctx.AddInputVariable(inputData.Schema[i].Type, colName); diff --git a/src/Microsoft.ML.OnnxTransformer.StaticPipe/DnnImageFeaturizerStaticExtensions.cs b/src/Microsoft.ML.OnnxTransformer.StaticPipe/DnnImageFeaturizerStaticExtensions.cs index e6ae20850e..7f0b6e968a 100644 --- a/src/Microsoft.ML.OnnxTransformer.StaticPipe/DnnImageFeaturizerStaticExtensions.cs +++ b/src/Microsoft.ML.OnnxTransformer.StaticPipe/DnnImageFeaturizerStaticExtensions.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.StaticPipe; namespace Microsoft.ML.Transforms.StaticPipe diff --git a/src/Microsoft.ML.OnnxTransformer.StaticPipe/OnnxStaticExtensions.cs b/src/Microsoft.ML.OnnxTransformer.StaticPipe/OnnxStaticExtensions.cs index 319ed380a6..feffe916c7 100644 --- a/src/Microsoft.ML.OnnxTransformer.StaticPipe/OnnxStaticExtensions.cs +++ b/src/Microsoft.ML.OnnxTransformer.StaticPipe/OnnxStaticExtensions.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; +using Microsoft.ML.Runtime; using Microsoft.ML.StaticPipe; namespace Microsoft.ML.Transforms.StaticPipe diff --git a/src/Microsoft.ML.OnnxTransformer/DnnImageFeaturizerTransform.cs b/src/Microsoft.ML.OnnxTransformer/DnnImageFeaturizerTransform.cs index 2aa80d442c..fef0da69ea 100644 --- a/src/Microsoft.ML.OnnxTransformer/DnnImageFeaturizerTransform.cs +++ b/src/Microsoft.ML.OnnxTransformer/DnnImageFeaturizerTransform.cs @@ -5,6 +5,7 @@ using System; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms { diff --git a/src/Microsoft.ML.OnnxTransformer/OnnxTransform.cs b/src/Microsoft.ML.OnnxTransformer/OnnxTransform.cs index e97de76ffa..2f87443026 100644 --- a/src/Microsoft.ML.OnnxTransformer/OnnxTransform.cs +++ b/src/Microsoft.ML.OnnxTransformer/OnnxTransform.cs @@ -12,8 +12,8 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.OnnxRuntime; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; using OnnxShape = System.Collections.Generic.List; diff --git a/src/Microsoft.ML.OnnxTransformer/OnnxUtils.cs b/src/Microsoft.ML.OnnxTransformer/OnnxUtils.cs index 2be81943cd..cca19a602e 100644 --- a/src/Microsoft.ML.OnnxTransformer/OnnxUtils.cs +++ b/src/Microsoft.ML.OnnxTransformer/OnnxUtils.cs @@ -10,6 +10,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.OnnxRuntime; +using Microsoft.ML.Runtime; using OnnxShape = System.Collections.Generic.List; namespace Microsoft.ML.Transforms diff --git a/src/Microsoft.ML.PCA/PCACatalog.cs b/src/Microsoft.ML.PCA/PCACatalog.cs index a07854da58..be6c13ff4d 100644 --- a/src/Microsoft.ML.PCA/PCACatalog.cs +++ b/src/Microsoft.ML.PCA/PCACatalog.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Microsoft.ML.Transforms; using static Microsoft.ML.Trainers.RandomizedPrincipalComponentAnalyzer; diff --git a/src/Microsoft.ML.PCA/PcaTrainer.cs b/src/Microsoft.ML.PCA/PcaTrainer.cs index ff32326cfa..1ea09467df 100644 --- a/src/Microsoft.ML.PCA/PcaTrainer.cs +++ b/src/Microsoft.ML.PCA/PcaTrainer.cs @@ -15,6 +15,7 @@ using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; [assembly: LoadableClass(RandomizedPrincipalComponentAnalyzer.Summary, typeof(RandomizedPrincipalComponentAnalyzer), typeof(RandomizedPrincipalComponentAnalyzer.Options), @@ -29,7 +30,7 @@ [assembly: LoadableClass(typeof(void), typeof(RandomizedPrincipalComponentAnalyzer), null, typeof(SignatureEntryPointModule), RandomizedPrincipalComponentAnalyzer.LoadNameValue)] namespace Microsoft.ML.Trainers - { +{ // REVIEW: make RFF transformer an option here. /// @@ -108,7 +109,7 @@ internal RandomizedPrincipalComponentAnalyzer(IHostEnvironment env, } internal RandomizedPrincipalComponentAnalyzer(IHostEnvironment env, Options options) - :this(env, options, options.FeatureColumnName, options.ExampleWeightColumnName) + : this(env, options, options.FeatureColumnName, options.ExampleWeightColumnName) { } @@ -327,8 +328,8 @@ private static void PostProcess(float[][] y, float[] sigma, float[] z, int d, in private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) { - return new[] - { + return new[] + { new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, diff --git a/src/Microsoft.ML.PCA/PcaTransformer.cs b/src/Microsoft.ML.PCA/PcaTransformer.cs index 06b397b417..986176dbd5 100644 --- a/src/Microsoft.ML.PCA/PcaTransformer.cs +++ b/src/Microsoft.ML.PCA/PcaTransformer.cs @@ -12,8 +12,8 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.CpuMath; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(PrincipalComponentAnalysisTransformer.Summary, typeof(IDataTransform), typeof(PrincipalComponentAnalysisTransformer), typeof(PrincipalComponentAnalysisTransformer.Options), typeof(SignatureDataTransform), @@ -31,7 +31,7 @@ [assembly: LoadableClass(typeof(void), typeof(PrincipalComponentAnalysisTransformer), null, typeof(SignatureEntryPointModule), PrincipalComponentAnalysisTransformer.LoaderSignature)] namespace Microsoft.ML.Transforms - { +{ /// public sealed class PrincipalComponentAnalysisTransformer : OneToOneTransformerBase { diff --git a/src/Microsoft.ML.Parquet/ParquetLoader.cs b/src/Microsoft.ML.Parquet/ParquetLoader.cs index 312a7b6e2c..69b4a85222 100644 --- a/src/Microsoft.ML.Parquet/ParquetLoader.cs +++ b/src/Microsoft.ML.Parquet/ParquetLoader.cs @@ -15,7 +15,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Parquet; using Parquet.Data; using Parquet.File.Values.Primitives; @@ -102,7 +102,7 @@ public sealed class Arguments private const int _defaultColumnChunkReadSize = 1000000; private bool _disposed; - private long? _rowCount; + private readonly long? _rowCount; private static VersionInfo GetVersionInfo() { @@ -444,8 +444,8 @@ private sealed class Cursor : RootCursorBase private int _curDataSetRow; private IEnumerator _dataSetEnumerator; private IEnumerator _blockEnumerator; - private IList[] _columnValues; - private Random _rand; + private readonly IList[] _columnValues; + private readonly Random _rand; public Cursor(ParquetLoader parent, IEnumerable columnsNeeded, Random rand) : base(parent._host) diff --git a/src/Microsoft.ML.Parquet/PartitionedFileLoader.cs b/src/Microsoft.ML.Parquet/PartitionedFileLoader.cs index 0f0ccf2989..6dd7c4ef24 100644 --- a/src/Microsoft.ML.Parquet/PartitionedFileLoader.cs +++ b/src/Microsoft.ML.Parquet/PartitionedFileLoader.cs @@ -16,6 +16,7 @@ using Microsoft.ML.Data.Utilities; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; [assembly: LoadableClass(PartitionedFileLoader.Summary, typeof(PartitionedFileLoader), typeof(PartitionedFileLoader.Arguments), typeof(SignatureDataLoader), PartitionedFileLoader.UserName, PartitionedFileLoader.LoadName, PartitionedFileLoader.ShortName)] @@ -368,8 +369,8 @@ private sealed class Cursor : RootCursorBase private readonly bool[] _active; private readonly bool[] _subActive; // Active columns of the sub-cursor. - private Delegate[] _getters; - private Delegate[] _subGetters; // Cached getters of the sub-cursor. + private readonly Delegate[] _getters; + private readonly Delegate[] _subGetters; // Cached getters of the sub-cursor. private readonly IEnumerable _columnsNeeded; private readonly IEnumerable _subActivecolumnsNeeded; diff --git a/src/Microsoft.ML.Parquet/PartitionedPathParser.cs b/src/Microsoft.ML.Parquet/PartitionedPathParser.cs index b453b99ccb..9421f02d8c 100644 --- a/src/Microsoft.ML.Parquet/PartitionedPathParser.cs +++ b/src/Microsoft.ML.Parquet/PartitionedPathParser.cs @@ -12,7 +12,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.Utilities; using Microsoft.ML.EntryPoints; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; [assembly: LoadableClass(SimplePartitionedPathParser.Summary, typeof(SimplePartitionedPathParser), typeof(SimplePartitionedPathParser.Arguments), typeof(PartitionedPathParser), SimplePartitionedPathParser.UserName, SimplePartitionedPathParser.LoadName, SimplePartitionedPathParser.ShortName)] diff --git a/src/Microsoft.ML.Parquet/PartitionedPathUtils.cs b/src/Microsoft.ML.Parquet/PartitionedPathUtils.cs index 88717c91c7..8ccca89e56 100644 --- a/src/Microsoft.ML.Parquet/PartitionedPathUtils.cs +++ b/src/Microsoft.ML.Parquet/PartitionedPathUtils.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.IO; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data.Utilities { diff --git a/src/Microsoft.ML.Recommender/MatrixFactorizationPredictor.cs b/src/Microsoft.ML.Recommender/MatrixFactorizationPredictor.cs index 1c0db5b5a0..6b97b90b1c 100644 --- a/src/Microsoft.ML.Recommender/MatrixFactorizationPredictor.cs +++ b/src/Microsoft.ML.Recommender/MatrixFactorizationPredictor.cs @@ -10,11 +10,11 @@ using Microsoft.ML; using Microsoft.ML.Data; using Microsoft.ML.Data.IO; -using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; using Microsoft.ML.Recommender; using Microsoft.ML.Recommender.Internal; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.Recommender; [assembly: LoadableClass(typeof(MatrixFactorizationModelParameters), null, typeof(SignatureLoadModel), "Matrix Factorization Predictor Executor", MatrixFactorizationModelParameters.LoaderSignature)] diff --git a/src/Microsoft.ML.Recommender/MatrixFactorizationTrainer.cs b/src/Microsoft.ML.Recommender/MatrixFactorizationTrainer.cs index 90c977935f..c934fe4704 100644 --- a/src/Microsoft.ML.Recommender/MatrixFactorizationTrainer.cs +++ b/src/Microsoft.ML.Recommender/MatrixFactorizationTrainer.cs @@ -13,6 +13,7 @@ using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Recommender; using Microsoft.ML.Recommender.Internal; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Microsoft.ML.Trainers.Recommender; diff --git a/src/Microsoft.ML.Recommender/RecommenderCatalog.cs b/src/Microsoft.ML.Recommender/RecommenderCatalog.cs index 2e1e5e8e12..8b6930ef0a 100644 --- a/src/Microsoft.ML.Recommender/RecommenderCatalog.cs +++ b/src/Microsoft.ML.Recommender/RecommenderCatalog.cs @@ -5,6 +5,7 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; namespace Microsoft.ML diff --git a/src/Microsoft.ML.Recommender/RecommenderUtils.cs b/src/Microsoft.ML.Recommender/RecommenderUtils.cs index 4e561f0dc4..72a93d345c 100644 --- a/src/Microsoft.ML.Recommender/RecommenderUtils.cs +++ b/src/Microsoft.ML.Recommender/RecommenderUtils.cs @@ -5,6 +5,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Recommender { diff --git a/src/Microsoft.ML.Recommender/SafeTrainingAndModelBuffer.cs b/src/Microsoft.ML.Recommender/SafeTrainingAndModelBuffer.cs index 4e42b3bffc..0f87b1a6eb 100644 --- a/src/Microsoft.ML.Recommender/SafeTrainingAndModelBuffer.cs +++ b/src/Microsoft.ML.Recommender/SafeTrainingAndModelBuffer.cs @@ -7,8 +7,8 @@ using System.Runtime.InteropServices; using System.Security; using Microsoft.Data.DataView; -using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Recommender.Internal { diff --git a/src/Microsoft.ML.ResultProcessor/ResultProcessor.cs b/src/Microsoft.ML.ResultProcessor/ResultProcessor.cs index 8ce4b5d280..7d90f968ab 100644 --- a/src/Microsoft.ML.ResultProcessor/ResultProcessor.cs +++ b/src/Microsoft.ML.ResultProcessor/ResultProcessor.cs @@ -15,6 +15,7 @@ using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Tools; #if TLCFULLBUILD diff --git a/src/Microsoft.ML.StandardLearners/FactorizationMachine/FactorizationMachineCatalog.cs b/src/Microsoft.ML.StandardLearners/FactorizationMachine/FactorizationMachineCatalog.cs index 4d5e4df381..c0dbce1724 100644 --- a/src/Microsoft.ML.StandardLearners/FactorizationMachine/FactorizationMachineCatalog.cs +++ b/src/Microsoft.ML.StandardLearners/FactorizationMachine/FactorizationMachineCatalog.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; namespace Microsoft.ML diff --git a/src/Microsoft.ML.StandardLearners/FactorizationMachine/FactorizationMachineInterface.cs b/src/Microsoft.ML.StandardLearners/FactorizationMachine/FactorizationMachineInterface.cs index bce1745843..a53aa7f056 100644 --- a/src/Microsoft.ML.StandardLearners/FactorizationMachine/FactorizationMachineInterface.cs +++ b/src/Microsoft.ML.StandardLearners/FactorizationMachine/FactorizationMachineInterface.cs @@ -5,6 +5,7 @@ using System.Runtime.InteropServices; using System.Security; using Microsoft.ML.Internal.CpuMath; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers { diff --git a/src/Microsoft.ML.StandardLearners/FactorizationMachine/FactorizationMachineTrainer.cs b/src/Microsoft.ML.StandardLearners/FactorizationMachine/FactorizationMachineTrainer.cs index feb0f527ac..84687b3ed9 100644 --- a/src/Microsoft.ML.StandardLearners/FactorizationMachine/FactorizationMachineTrainer.cs +++ b/src/Microsoft.ML.StandardLearners/FactorizationMachine/FactorizationMachineTrainer.cs @@ -12,6 +12,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.CpuMath; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; [assembly: LoadableClass(FieldAwareFactorizationMachineBinaryClassificationTrainer.Summary, typeof(FieldAwareFactorizationMachineBinaryClassificationTrainer), diff --git a/src/Microsoft.ML.StandardLearners/FactorizationMachine/FieldAwareFactorizationMachineModelParameters.cs b/src/Microsoft.ML.StandardLearners/FactorizationMachine/FieldAwareFactorizationMachineModelParameters.cs index b262fa02f5..ca4de8e369 100644 --- a/src/Microsoft.ML.StandardLearners/FactorizationMachine/FieldAwareFactorizationMachineModelParameters.cs +++ b/src/Microsoft.ML.StandardLearners/FactorizationMachine/FieldAwareFactorizationMachineModelParameters.cs @@ -11,6 +11,7 @@ using Microsoft.ML.Internal.CpuMath; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; [assembly: LoadableClass(typeof(FieldAwareFactorizationMachineModelParameters), null, typeof(SignatureLoadModel), "Field Aware Factorization Machine", FieldAwareFactorizationMachineModelParameters.LoaderSignature)] diff --git a/src/Microsoft.ML.StandardLearners/FactorizationMachine/FieldAwareFactorizationMachineUtils.cs b/src/Microsoft.ML.StandardLearners/FactorizationMachine/FieldAwareFactorizationMachineUtils.cs index 2f8b56bca6..caace74e7a 100644 --- a/src/Microsoft.ML.StandardLearners/FactorizationMachine/FieldAwareFactorizationMachineUtils.cs +++ b/src/Microsoft.ML.StandardLearners/FactorizationMachine/FieldAwareFactorizationMachineUtils.cs @@ -9,6 +9,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.CpuMath; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers { diff --git a/src/Microsoft.ML.StandardLearners/Optimizer/DifferentiableFunction.cs b/src/Microsoft.ML.StandardLearners/Optimizer/DifferentiableFunction.cs index ae74f51e59..06f5f01441 100644 --- a/src/Microsoft.ML.StandardLearners/Optimizer/DifferentiableFunction.cs +++ b/src/Microsoft.ML.StandardLearners/Optimizer/DifferentiableFunction.cs @@ -7,6 +7,7 @@ using System.Threading; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Numeric { diff --git a/src/Microsoft.ML.StandardLearners/Optimizer/L1Optimizer.cs b/src/Microsoft.ML.StandardLearners/Optimizer/L1Optimizer.cs index bcbd54ed71..e2da56ab9d 100644 --- a/src/Microsoft.ML.StandardLearners/Optimizer/L1Optimizer.cs +++ b/src/Microsoft.ML.StandardLearners/Optimizer/L1Optimizer.cs @@ -5,6 +5,7 @@ using System; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Numeric { @@ -47,7 +48,7 @@ internal override OptimizerState MakeState(IChannel ch, IProgressChannelProvider if (EnforceNonNegativity) { - VBufferUtils.Apply(ref initial, delegate(int ind, ref float initialVal) + VBufferUtils.Apply(ref initial, delegate (int ind, ref float initialVal) { if (initialVal < 0.0 && ind >= _biasCount) initialVal = 0; @@ -167,15 +168,15 @@ private void GetNextPoint(float alpha) if (!EnforceNonNegativity) { VBufferUtils.ApplyWith(in _x, ref _newX, - delegate(int ind, float xVal, ref float newXval) + delegate (int ind, float xVal, ref float newXval) { - if (xVal*newXval < 0.0 && ind >= _biasCount) + if (xVal * newXval < 0.0 && ind >= _biasCount) newXval = 0; }); } else { - VBufferUtils.Apply(ref _newX, delegate(int ind, ref float newXval) + VBufferUtils.Apply(ref _newX, delegate (int ind, ref float newXval) { if (newXval < 0.0 && ind >= _biasCount) newXval = 0; diff --git a/src/Microsoft.ML.StandardLearners/Optimizer/LineSearch.cs b/src/Microsoft.ML.StandardLearners/Optimizer/LineSearch.cs index 4f8a49a2e3..61821e47e2 100644 --- a/src/Microsoft.ML.StandardLearners/Optimizer/LineSearch.cs +++ b/src/Microsoft.ML.StandardLearners/Optimizer/LineSearch.cs @@ -5,6 +5,7 @@ using System; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Numeric { @@ -131,7 +132,8 @@ public StepValueDeriv(DiffFunc1D func, float initStep, float initVal, float init private float _value; private float _deriv; - public float Step { + public float Step + { get { return _step; } set { _step = value; _value = _func(value, out _deriv); } } @@ -272,9 +274,11 @@ private sealed class StepAndValue private readonly Func _func; private float _step; - public float Step { + public float Step + { get { return _step; } - set { + set + { _step = value; Value = _func(value); } @@ -457,8 +461,8 @@ private static float LogTest(float x, out float deriv) private static float QuadTest2D(in VBuffer x, ref VBuffer grad, IProgressChannelProvider progress = null) { - float d1 = VectorUtils.DotProduct(in x, in _c1); - float d2 = VectorUtils.DotProduct(in x, in _c2); + float d1 = VectorUtils.DotProduct(in x, in _c1); + float d2 = VectorUtils.DotProduct(in x, in _c2); float d3 = VectorUtils.DotProduct(in x, in _c3); _c3.CopyTo(ref grad); VectorUtils.AddMult(in _c1, d1, ref grad); diff --git a/src/Microsoft.ML.StandardLearners/Optimizer/OptimizationMonitor.cs b/src/Microsoft.ML.StandardLearners/Optimizer/OptimizationMonitor.cs index ffae097913..8b10022779 100644 --- a/src/Microsoft.ML.StandardLearners/Optimizer/OptimizationMonitor.cs +++ b/src/Microsoft.ML.StandardLearners/Optimizer/OptimizationMonitor.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Numeric { diff --git a/src/Microsoft.ML.StandardLearners/Optimizer/Optimizer.cs b/src/Microsoft.ML.StandardLearners/Optimizer/Optimizer.cs index 0a9c2061bd..d073dc0381 100644 --- a/src/Microsoft.ML.StandardLearners/Optimizer/Optimizer.cs +++ b/src/Microsoft.ML.StandardLearners/Optimizer/Optimizer.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Numeric { @@ -403,7 +404,7 @@ internal virtual bool LineSearch(IChannel ch, bool force) VectorUtils.AddMultInto(in _x, alpha, in _dir, ref _newX); if (EnforceNonNegativity) { - VBufferUtils.Apply(ref _newX, delegate(int ind, ref float newXval) + VBufferUtils.Apply(ref _newX, delegate (int ind, ref float newXval) { if (newXval < 0.0) newXval = 0; @@ -484,7 +485,7 @@ internal virtual bool LineSearch(IChannel ch, bool force) VectorUtils.AddMultInto(in _x, alpha, in _dir, ref _newX); if (EnforceNonNegativity) { - VBufferUtils.Apply(ref _newX, delegate(int ind, ref float newXval) + VBufferUtils.Apply(ref _newX, delegate (int ind, ref float newXval) { if (newXval < 0.0) newXval = 0; @@ -612,11 +613,11 @@ public void Minimize(DifferentiableFunction function, ref VBuffer initial var header = new ProgressHeader(new[] { "Loss", "Improvement" }, new[] { "iterations", "gradients" }); pch.SetHeader(header, -(Action)( e => - { - e.SetProgress(0, (double)(state.Iter - 1)); - e.SetProgress(1, state.GradientCalculations); - })); + (Action)(e => + { + e.SetProgress(0, (double)(state.Iter - 1)); + e.SetProgress(1, state.GradientCalculations); + })); bool finished = false; pch.Checkpoint(state.Value, null, 0); diff --git a/src/Microsoft.ML.StandardLearners/Optimizer/SgdOptimizer.cs b/src/Microsoft.ML.StandardLearners/Optimizer/SgdOptimizer.cs index 0813f2fb79..d83b42f046 100644 --- a/src/Microsoft.ML.StandardLearners/Optimizer/SgdOptimizer.cs +++ b/src/Microsoft.ML.StandardLearners/Optimizer/SgdOptimizer.cs @@ -5,6 +5,7 @@ using System; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Numeric { @@ -25,9 +26,11 @@ internal sealed class SgdOptimizer /// /// Size of minibatches /// - public int BatchSize { + public int BatchSize + { get { return _batchSize; } - set { + set + { Contracts.Check(value > 0); _batchSize = value; } @@ -38,9 +41,11 @@ public int BatchSize { /// /// Momentum parameter /// - public float Momentum { + public float Momentum + { get { return _momentum; } - set { + set + { Contracts.Check(0 <= value && value < 1); _momentum = value; } @@ -51,9 +56,11 @@ public float Momentum { /// /// Base of step size schedule s_t = 1 / (t0 + f(t)) /// - public float T0 { + public float T0 + { get { return _t0; } - set { + set + { Contracts.Check(value >= 0); _t0 = value; } @@ -69,7 +76,8 @@ public float T0 { /// /// If true, iterates are averaged /// - public bool Averaging { + public bool Averaging + { get { return _averaging; } set { _averaging = value; } } @@ -79,7 +87,8 @@ public bool Averaging { /// /// Gets/Sets rate schedule type /// - public RateScheduleType RateSchedule { + public RateScheduleType RateSchedule + { get { return _rateSchedule; } set { _rateSchedule = value; } } @@ -89,9 +98,11 @@ public RateScheduleType RateSchedule { /// /// Gets/Sets maximum number of steps. Set to 0 for no max /// - public int MaxSteps { + public int MaxSteps + { get { return _maxSteps; } - set { + set + { Contracts.Check(value >= 0); _maxSteps = value; } @@ -238,9 +249,11 @@ internal class GDOptimizer /// /// Gets/Sets maximum number of steps. Set to 0 for no max. /// - public int MaxSteps { + public int MaxSteps + { get { return _maxSteps; } - set { + set + { Contracts.Check(value >= 0); _maxSteps = value; } diff --git a/src/Microsoft.ML.StandardLearners/Standard/LinearModelParameters.cs b/src/Microsoft.ML.StandardLearners/Standard/LinearModelParameters.cs index cd07fa39af..21908bb79a 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/LinearModelParameters.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/LinearModelParameters.cs @@ -16,6 +16,7 @@ using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Microsoft.ML.Transforms; using Newtonsoft.Json.Linq; diff --git a/src/Microsoft.ML.StandardLearners/Standard/LinearPredictorUtils.cs b/src/Microsoft.ML.StandardLearners/Standard/LinearPredictorUtils.cs index bde1ee0dfe..10e21b0fdb 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/LinearPredictorUtils.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/LinearPredictorUtils.cs @@ -11,6 +11,7 @@ using Microsoft.ML.Calibrators; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers { diff --git a/src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LbfgsPredictorBase.cs b/src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LbfgsPredictorBase.cs index ae78972b86..266d4dea88 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LbfgsPredictorBase.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LbfgsPredictorBase.cs @@ -11,14 +11,14 @@ using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Numeric; -using Microsoft.ML.Trainers; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers { public abstract class LbfgsTrainerBase : TrainerEstimatorBase where TTransformer : ISingleFeaturePredictionTransformer where TModel : class - where TOptions : LbfgsTrainerBase.OptionsBase, new () + where TOptions : LbfgsTrainerBase.OptionsBase, new() { public abstract class OptionsBase : TrainerInputBaseWithWeight { diff --git a/src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LogisticRegression.cs b/src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LogisticRegression.cs index 3f4e6bb792..8c570d02f4 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LogisticRegression.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LogisticRegression.cs @@ -13,6 +13,7 @@ using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; [assembly: LoadableClass(LogisticRegression.Summary, typeof(LogisticRegression), typeof(LogisticRegression.Options), diff --git a/src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/MulticlassLogisticRegression.cs b/src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/MulticlassLogisticRegression.cs index c6b69986fd..ed700c1149 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/MulticlassLogisticRegression.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/MulticlassLogisticRegression.cs @@ -11,12 +11,12 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; -using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Newtonsoft.Json.Linq; diff --git a/src/Microsoft.ML.StandardLearners/Standard/ModelStatistics.cs b/src/Microsoft.ML.StandardLearners/Standard/ModelStatistics.cs index dae648acf5..73803c0e83 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/ModelStatistics.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/ModelStatistics.cs @@ -10,9 +10,9 @@ using Microsoft.ML; using Microsoft.ML.Data; using Microsoft.ML.Internal.CpuMath; -using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; // This is for deserialization from a model repository. diff --git a/src/Microsoft.ML.StandardLearners/Standard/MultiClass/MetaMulticlassTrainer.cs b/src/Microsoft.ML.StandardLearners/Standard/MultiClass/MetaMulticlassTrainer.cs index a69cfbaeb4..c7e3647ee1 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/MultiClass/MetaMulticlassTrainer.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/MultiClass/MetaMulticlassTrainer.cs @@ -10,7 +10,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.Conversion; using Microsoft.ML.Internal.Internallearn; -using Microsoft.ML.Trainers; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers { diff --git a/src/Microsoft.ML.StandardLearners/Standard/MultiClass/MultiClassNaiveBayesTrainer.cs b/src/Microsoft.ML.StandardLearners/Standard/MultiClass/MultiClassNaiveBayesTrainer.cs index 7bc6eb2cde..0faacec7c3 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/MultiClass/MultiClassNaiveBayesTrainer.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/MultiClass/MultiClassNaiveBayesTrainer.cs @@ -9,9 +9,9 @@ using Microsoft.ML; using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; -using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; [assembly: LoadableClass(MultiClassNaiveBayesTrainer.Summary, typeof(MultiClassNaiveBayesTrainer), typeof(MultiClassNaiveBayesTrainer.Options), diff --git a/src/Microsoft.ML.StandardLearners/Standard/MultiClass/OneVersusAllTrainer.cs b/src/Microsoft.ML.StandardLearners/Standard/MultiClass/OneVersusAllTrainer.cs index 44dbf74edd..82a3b259ff 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/MultiClass/OneVersusAllTrainer.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/MultiClass/OneVersusAllTrainer.cs @@ -18,6 +18,7 @@ using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Newtonsoft.Json.Linq; @@ -257,7 +258,7 @@ public enum OutputFormula { Raw = 0, ProbabilityNormalization = 1, Softmax = 2 } bool ICanSavePfa.CanSavePfa => _impl.CanSavePfa; [BestFriend] - internal static OneVersusAllModelParameters Create(IHost host, OutputFormula outputFormula, TScalarPredictor[] predictors) + internal static OneVersusAllModelParameters Create(IHost host, OutputFormula outputFormula, TScalarPredictor[] predictors) { ImplBase impl; @@ -465,7 +466,7 @@ protected bool IsValid(IValueMapper mapper, ref VectorType inputType) return false; if (mapper.OutputType != NumberDataViewType.Single) return false; - if (!(mapper.InputType is VectorType mapperVectorType)|| mapperVectorType.ItemType != NumberDataViewType.Single) + if (!(mapper.InputType is VectorType mapperVectorType) || mapperVectorType.ItemType != NumberDataViewType.Single) return false; if (inputType == null) inputType = mapperVectorType; diff --git a/src/Microsoft.ML.StandardLearners/Standard/MultiClass/PairwiseCouplingTrainer.cs b/src/Microsoft.ML.StandardLearners/Standard/MultiClass/PairwiseCouplingTrainer.cs index c8816935a7..53cc39327c 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/MultiClass/PairwiseCouplingTrainer.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/MultiClass/PairwiseCouplingTrainer.cs @@ -9,9 +9,9 @@ using Microsoft.ML; using Microsoft.ML.Calibrators; using Microsoft.ML.Data; -using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; [assembly: LoadableClass(PairwiseCouplingTrainer.Summary, typeof(PairwiseCouplingTrainer), typeof(PairwiseCouplingTrainer.Options), diff --git a/src/Microsoft.ML.StandardLearners/Standard/Online/AveragedLinear.cs b/src/Microsoft.ML.StandardLearners/Standard/Online/AveragedLinear.cs index 6e291134e9..b0f61d1da1 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/Online/AveragedLinear.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/Online/AveragedLinear.cs @@ -9,6 +9,7 @@ using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; // TODO: Check if it works properly if Averaged is set to false diff --git a/src/Microsoft.ML.StandardLearners/Standard/Online/AveragedPerceptron.cs b/src/Microsoft.ML.StandardLearners/Standard/Online/AveragedPerceptron.cs index 3fe119d98a..91374d01c3 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/Online/AveragedPerceptron.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/Online/AveragedPerceptron.cs @@ -11,6 +11,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Model; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; [assembly: LoadableClass(AveragedPerceptronTrainer.Summary, typeof(AveragedPerceptronTrainer), typeof(AveragedPerceptronTrainer.Options), diff --git a/src/Microsoft.ML.StandardLearners/Standard/Online/LinearSvm.cs b/src/Microsoft.ML.StandardLearners/Standard/Online/LinearSvm.cs index b9145818c8..60f379465e 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/Online/LinearSvm.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/Online/LinearSvm.cs @@ -13,6 +13,7 @@ using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; [assembly: LoadableClass(LinearSvmTrainer.Summary, typeof(LinearSvmTrainer), typeof(LinearSvmTrainer.Options), @@ -231,7 +232,7 @@ public override LinearBinaryModelParameters CreatePredictor() /// The environment to use. /// The name of the label column. /// The name of the feature column. - /// The optional name of the weight column. + /// The optional name of the weight column. /// The number of training iteraitons. [BestFriend] internal LinearSvmTrainer(IHostEnvironment env, diff --git a/src/Microsoft.ML.StandardLearners/Standard/Online/OnlineGradientDescent.cs b/src/Microsoft.ML.StandardLearners/Standard/Online/OnlineGradientDescent.cs index 771fe8b149..3e71e063dd 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/Online/OnlineGradientDescent.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/Online/OnlineGradientDescent.cs @@ -10,6 +10,7 @@ using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Model; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; [assembly: LoadableClass(OnlineGradientDescentTrainer.Summary, typeof(OnlineGradientDescentTrainer), typeof(OnlineGradientDescentTrainer.Options), diff --git a/src/Microsoft.ML.StandardLearners/Standard/Online/OnlineLinear.cs b/src/Microsoft.ML.StandardLearners/Standard/Online/OnlineLinear.cs index 803eff6afb..13b6c32bf0 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/Online/OnlineLinear.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/Online/OnlineLinear.cs @@ -12,6 +12,7 @@ using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Trainers { diff --git a/src/Microsoft.ML.StandardLearners/Standard/PoissonRegression/PoissonRegression.cs b/src/Microsoft.ML.StandardLearners/Standard/PoissonRegression/PoissonRegression.cs index bb1e9eb792..7ad1981383 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/PoissonRegression/PoissonRegression.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/PoissonRegression/PoissonRegression.cs @@ -10,6 +10,7 @@ using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; [assembly: LoadableClass(PoissonRegression.Summary, typeof(PoissonRegression), typeof(PoissonRegression.Options), diff --git a/src/Microsoft.ML.StandardLearners/Standard/SdcaBinary.cs b/src/Microsoft.ML.StandardLearners/Standard/SdcaBinary.cs index 4dccfa7526..08ef5701d3 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/SdcaBinary.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/SdcaBinary.cs @@ -19,6 +19,7 @@ using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Microsoft.ML.Transforms; diff --git a/src/Microsoft.ML.StandardLearners/Standard/SdcaMultiClass.cs b/src/Microsoft.ML.StandardLearners/Standard/SdcaMultiClass.cs index 9239e748a4..1abb3029ab 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/SdcaMultiClass.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/SdcaMultiClass.cs @@ -14,6 +14,7 @@ using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; [assembly: LoadableClass(SdcaMultiClassTrainer.Summary, typeof(SdcaMultiClassTrainer), typeof(SdcaMultiClassTrainer.Options), diff --git a/src/Microsoft.ML.StandardLearners/Standard/SdcaRegression.cs b/src/Microsoft.ML.StandardLearners/Standard/SdcaRegression.cs index d5b17998ac..01bed21182 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/SdcaRegression.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/SdcaRegression.cs @@ -11,6 +11,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; [assembly: LoadableClass(SdcaRegressionTrainer.Summary, typeof(SdcaRegressionTrainer), typeof(SdcaRegressionTrainer.Options), diff --git a/src/Microsoft.ML.StandardLearners/Standard/Simple/SimpleTrainers.cs b/src/Microsoft.ML.StandardLearners/Standard/Simple/SimpleTrainers.cs index 1f1b7ce000..6a3d021caa 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/Simple/SimpleTrainers.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/Simple/SimpleTrainers.cs @@ -9,6 +9,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; [assembly: LoadableClass(PriorTrainer.Summary, typeof(PriorTrainer), typeof(PriorTrainer.Options), diff --git a/src/Microsoft.ML.StandardLearners/Standard/StochasticTrainerBase.cs b/src/Microsoft.ML.StandardLearners/Standard/StochasticTrainerBase.cs index ab256c6a1c..6a65782ecf 100644 --- a/src/Microsoft.ML.StandardLearners/Standard/StochasticTrainerBase.cs +++ b/src/Microsoft.ML.StandardLearners/Standard/StochasticTrainerBase.cs @@ -6,6 +6,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Calibrators; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML.Trainers diff --git a/src/Microsoft.ML.StandardLearners/StandardLearnersCatalog.cs b/src/Microsoft.ML.StandardLearners/StandardLearnersCatalog.cs index f32c45ff85..c988102be2 100644 --- a/src/Microsoft.ML.StandardLearners/StandardLearnersCatalog.cs +++ b/src/Microsoft.ML.StandardLearners/StandardLearnersCatalog.cs @@ -4,6 +4,7 @@ using Microsoft.ML.Calibrators; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; namespace Microsoft.ML diff --git a/src/Microsoft.ML.StaticPipe/Attributes.cs b/src/Microsoft.ML.StaticPipe/Attributes.cs index 69c58ab859..78c2c9b521 100644 --- a/src/Microsoft.ML.StaticPipe/Attributes.cs +++ b/src/Microsoft.ML.StaticPipe/Attributes.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System; - namespace Microsoft.ML.StaticPipe { /// diff --git a/src/Microsoft.ML.StaticPipe/CategoricalHashStaticExtensions.cs b/src/Microsoft.ML.StaticPipe/CategoricalHashStaticExtensions.cs index b1ae24d105..af7a6796d9 100644 --- a/src/Microsoft.ML.StaticPipe/CategoricalHashStaticExtensions.cs +++ b/src/Microsoft.ML.StaticPipe/CategoricalHashStaticExtensions.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.StaticPipe/CategoricalStaticExtensions.cs b/src/Microsoft.ML.StaticPipe/CategoricalStaticExtensions.cs index 90196520e3..fcb8efa35f 100644 --- a/src/Microsoft.ML.StaticPipe/CategoricalStaticExtensions.cs +++ b/src/Microsoft.ML.StaticPipe/CategoricalStaticExtensions.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; using static Microsoft.ML.StaticPipe.TermStaticExtensions; diff --git a/src/Microsoft.ML.StaticPipe/ConvertStaticExtensions.cs b/src/Microsoft.ML.StaticPipe/ConvertStaticExtensions.cs index cbb301730c..cf404e2eb3 100644 --- a/src/Microsoft.ML.StaticPipe/ConvertStaticExtensions.cs +++ b/src/Microsoft.ML.StaticPipe/ConvertStaticExtensions.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.StaticPipe { diff --git a/src/Microsoft.ML.StaticPipe/ConvertStaticExtensions.tt b/src/Microsoft.ML.StaticPipe/ConvertStaticExtensions.tt index ecc16c4672..74620beab9 100644 --- a/src/Microsoft.ML.StaticPipe/ConvertStaticExtensions.tt +++ b/src/Microsoft.ML.StaticPipe/ConvertStaticExtensions.tt @@ -10,6 +10,7 @@ using Microsoft.ML; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.StaticPipe; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.StaticPipe/DataLoader.cs b/src/Microsoft.ML.StaticPipe/DataLoader.cs index 414594f110..db93b80405 100644 --- a/src/Microsoft.ML.StaticPipe/DataLoader.cs +++ b/src/Microsoft.ML.StaticPipe/DataLoader.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.StaticPipe { diff --git a/src/Microsoft.ML.StaticPipe/DataLoaderEstimator.cs b/src/Microsoft.ML.StaticPipe/DataLoaderEstimator.cs index f2a8e61885..1901eda49a 100644 --- a/src/Microsoft.ML.StaticPipe/DataLoaderEstimator.cs +++ b/src/Microsoft.ML.StaticPipe/DataLoaderEstimator.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.StaticPipe { diff --git a/src/Microsoft.ML.StaticPipe/DataView.cs b/src/Microsoft.ML.StaticPipe/DataView.cs index 42e45e2072..68f047a6fd 100644 --- a/src/Microsoft.ML.StaticPipe/DataView.cs +++ b/src/Microsoft.ML.StaticPipe/DataView.cs @@ -7,6 +7,7 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.StaticPipe { diff --git a/src/Microsoft.ML.StaticPipe/Estimator.cs b/src/Microsoft.ML.StaticPipe/Estimator.cs index 792722325f..ed44944781 100644 --- a/src/Microsoft.ML.StaticPipe/Estimator.cs +++ b/src/Microsoft.ML.StaticPipe/Estimator.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using Microsoft.ML.Runtime; namespace Microsoft.ML.StaticPipe { diff --git a/src/Microsoft.ML.StaticPipe/EvaluatorStaticExtensions.cs b/src/Microsoft.ML.StaticPipe/EvaluatorStaticExtensions.cs index 9feebaaf29..61eb4bd924 100644 --- a/src/Microsoft.ML.StaticPipe/EvaluatorStaticExtensions.cs +++ b/src/Microsoft.ML.StaticPipe/EvaluatorStaticExtensions.cs @@ -4,6 +4,8 @@ using System; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; +using Microsoft.ML.Trainers; namespace Microsoft.ML.StaticPipe { diff --git a/src/Microsoft.ML.StaticPipe/FactorizationMachineStatic.cs b/src/Microsoft.ML.StaticPipe/FactorizationMachineStatic.cs index 9ab04b50fc..007bf5d67a 100644 --- a/src/Microsoft.ML.StaticPipe/FactorizationMachineStatic.cs +++ b/src/Microsoft.ML.StaticPipe/FactorizationMachineStatic.cs @@ -7,6 +7,7 @@ using System.Linq; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.StaticPipe/ImageStaticPipe.cs b/src/Microsoft.ML.StaticPipe/ImageStaticPipe.cs index ecedb3611c..af5a58345d 100644 --- a/src/Microsoft.ML.StaticPipe/ImageStaticPipe.cs +++ b/src/Microsoft.ML.StaticPipe/ImageStaticPipe.cs @@ -5,6 +5,7 @@ using System; using System.Drawing; using Microsoft.ML.ImageAnalytics; +using Microsoft.ML.Runtime; namespace Microsoft.ML.StaticPipe { diff --git a/src/Microsoft.ML.StaticPipe/ImageTransformsStatic.cs b/src/Microsoft.ML.StaticPipe/ImageTransformsStatic.cs index 7727648162..301494b2c9 100644 --- a/src/Microsoft.ML.StaticPipe/ImageTransformsStatic.cs +++ b/src/Microsoft.ML.StaticPipe/ImageTransformsStatic.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Drawing; using Microsoft.ML.ImageAnalytics; +using Microsoft.ML.Runtime; namespace Microsoft.ML.StaticPipe { diff --git a/src/Microsoft.ML.StaticPipe/KMeansStatic.cs b/src/Microsoft.ML.StaticPipe/KMeansStatic.cs index ab997664f4..17b5ecd247 100644 --- a/src/Microsoft.ML.StaticPipe/KMeansStatic.cs +++ b/src/Microsoft.ML.StaticPipe/KMeansStatic.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.StaticPipe/LbfgsStatic.cs b/src/Microsoft.ML.StaticPipe/LbfgsStatic.cs index f2fe56401a..5d83ad9e86 100644 --- a/src/Microsoft.ML.StaticPipe/LbfgsStatic.cs +++ b/src/Microsoft.ML.StaticPipe/LbfgsStatic.cs @@ -4,6 +4,7 @@ using System; using Microsoft.ML.Calibrators; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.StaticPipe/LdaStaticExtensions.cs b/src/Microsoft.ML.StaticPipe/LdaStaticExtensions.cs index 6c4f6ec36d..d094d444ba 100644 --- a/src/Microsoft.ML.StaticPipe/LdaStaticExtensions.cs +++ b/src/Microsoft.ML.StaticPipe/LdaStaticExtensions.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.Text; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.StaticPipe/LpNormalizerStaticExtensions.cs b/src/Microsoft.ML.StaticPipe/LpNormalizerStaticExtensions.cs index 8a945c8a14..337dad694d 100644 --- a/src/Microsoft.ML.StaticPipe/LpNormalizerStaticExtensions.cs +++ b/src/Microsoft.ML.StaticPipe/LpNormalizerStaticExtensions.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.StaticPipe/MatrixFactorizationStatic.cs b/src/Microsoft.ML.StaticPipe/MatrixFactorizationStatic.cs index 540d42e373..0408ca85d9 100644 --- a/src/Microsoft.ML.StaticPipe/MatrixFactorizationStatic.cs +++ b/src/Microsoft.ML.StaticPipe/MatrixFactorizationStatic.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Microsoft.ML.Trainers.Recommender; diff --git a/src/Microsoft.ML.StaticPipe/MultiClassNaiveBayesStatic.cs b/src/Microsoft.ML.StaticPipe/MultiClassNaiveBayesStatic.cs index 8ee7675062..fa602f4859 100644 --- a/src/Microsoft.ML.StaticPipe/MultiClassNaiveBayesStatic.cs +++ b/src/Microsoft.ML.StaticPipe/MultiClassNaiveBayesStatic.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.StaticPipe/NormalizerStaticExtensions.cs b/src/Microsoft.ML.StaticPipe/NormalizerStaticExtensions.cs index 87be3e1e2c..2e7480dbe4 100644 --- a/src/Microsoft.ML.StaticPipe/NormalizerStaticExtensions.cs +++ b/src/Microsoft.ML.StaticPipe/NormalizerStaticExtensions.cs @@ -7,6 +7,7 @@ using System.Collections.Immutable; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.StaticPipe/OnlineLearnerStatic.cs b/src/Microsoft.ML.StaticPipe/OnlineLearnerStatic.cs index 8614a2c4fc..72a65aebc5 100644 --- a/src/Microsoft.ML.StaticPipe/OnlineLearnerStatic.cs +++ b/src/Microsoft.ML.StaticPipe/OnlineLearnerStatic.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.StaticPipe/PipelineColumn.cs b/src/Microsoft.ML.StaticPipe/PipelineColumn.cs index 01dab46469..0a512cd291 100644 --- a/src/Microsoft.ML.StaticPipe/PipelineColumn.cs +++ b/src/Microsoft.ML.StaticPipe/PipelineColumn.cs @@ -4,6 +4,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.StaticPipe { diff --git a/src/Microsoft.ML.StaticPipe/Reconciler.cs b/src/Microsoft.ML.StaticPipe/Reconciler.cs index c3385f36e7..4d0bc448cd 100644 --- a/src/Microsoft.ML.StaticPipe/Reconciler.cs +++ b/src/Microsoft.ML.StaticPipe/Reconciler.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.StaticPipe/SchemaBearing.cs b/src/Microsoft.ML.StaticPipe/SchemaBearing.cs index a1e1e72153..683674f984 100644 --- a/src/Microsoft.ML.StaticPipe/SchemaBearing.cs +++ b/src/Microsoft.ML.StaticPipe/SchemaBearing.cs @@ -4,6 +4,7 @@ using System.Threading; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.StaticPipe { diff --git a/src/Microsoft.ML.StaticPipe/SdcaStaticExtensions.cs b/src/Microsoft.ML.StaticPipe/SdcaStaticExtensions.cs index 0d8de683e4..2da753c331 100644 --- a/src/Microsoft.ML.StaticPipe/SdcaStaticExtensions.cs +++ b/src/Microsoft.ML.StaticPipe/SdcaStaticExtensions.cs @@ -4,6 +4,7 @@ using System; using Microsoft.ML.Calibrators; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.StaticPipe/StaticPipeExtensions.cs b/src/Microsoft.ML.StaticPipe/StaticPipeExtensions.cs index 62bf956d01..f3581188f2 100644 --- a/src/Microsoft.ML.StaticPipe/StaticPipeExtensions.cs +++ b/src/Microsoft.ML.StaticPipe/StaticPipeExtensions.cs @@ -4,7 +4,7 @@ using System; using Microsoft.Data.DataView; - +using Microsoft.ML.Runtime; namespace Microsoft.ML.StaticPipe { public static class StaticPipeExtensions diff --git a/src/Microsoft.ML.StaticPipe/StaticPipeInternalUtils.cs b/src/Microsoft.ML.StaticPipe/StaticPipeInternalUtils.cs index 2fae3fc36d..e7acc2cbf3 100644 --- a/src/Microsoft.ML.StaticPipe/StaticPipeInternalUtils.cs +++ b/src/Microsoft.ML.StaticPipe/StaticPipeInternalUtils.cs @@ -8,6 +8,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.StaticPipe { diff --git a/src/Microsoft.ML.StaticPipe/StaticPipeUtils.cs b/src/Microsoft.ML.StaticPipe/StaticPipeUtils.cs index 26772803fa..031c1bd838 100644 --- a/src/Microsoft.ML.StaticPipe/StaticPipeUtils.cs +++ b/src/Microsoft.ML.StaticPipe/StaticPipeUtils.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; -using Microsoft.ML; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.StaticPipe/StaticSchemaShape.cs b/src/Microsoft.ML.StaticPipe/StaticSchemaShape.cs index 6385145534..ed1fcbea6b 100644 --- a/src/Microsoft.ML.StaticPipe/StaticSchemaShape.cs +++ b/src/Microsoft.ML.StaticPipe/StaticSchemaShape.cs @@ -7,6 +7,7 @@ using System.Reflection; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.StaticPipe { diff --git a/src/Microsoft.ML.StaticPipe/TermStaticExtensions.cs b/src/Microsoft.ML.StaticPipe/TermStaticExtensions.cs index 2e24884334..3c14e75034 100644 --- a/src/Microsoft.ML.StaticPipe/TermStaticExtensions.cs +++ b/src/Microsoft.ML.StaticPipe/TermStaticExtensions.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.StaticPipe/TermStaticExtensions.tt b/src/Microsoft.ML.StaticPipe/TermStaticExtensions.tt index 703a71d4ef..1f4e47b9d7 100644 --- a/src/Microsoft.ML.StaticPipe/TermStaticExtensions.tt +++ b/src/Microsoft.ML.StaticPipe/TermStaticExtensions.tt @@ -9,6 +9,7 @@ // See the LICENSE file in the project root for more information. using System; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.StaticPipe/TextLoaderStatic.cs b/src/Microsoft.ML.StaticPipe/TextLoaderStatic.cs index 9249219600..a36d51a42d 100644 --- a/src/Microsoft.ML.StaticPipe/TextLoaderStatic.cs +++ b/src/Microsoft.ML.StaticPipe/TextLoaderStatic.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.StaticPipe { diff --git a/src/Microsoft.ML.StaticPipe/TextStaticExtensions.cs b/src/Microsoft.ML.StaticPipe/TextStaticExtensions.cs index e8b34ac44e..0ca72c150f 100644 --- a/src/Microsoft.ML.StaticPipe/TextStaticExtensions.cs +++ b/src/Microsoft.ML.StaticPipe/TextStaticExtensions.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.Text; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.StaticPipe/TrainerEstimatorReconciler.cs b/src/Microsoft.ML.StaticPipe/TrainerEstimatorReconciler.cs index 5e230156b5..fd0070ddcd 100644 --- a/src/Microsoft.ML.StaticPipe/TrainerEstimatorReconciler.cs +++ b/src/Microsoft.ML.StaticPipe/TrainerEstimatorReconciler.cs @@ -6,6 +6,7 @@ using System.Linq; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.StaticPipe/TrainingStaticExtensions.cs b/src/Microsoft.ML.StaticPipe/TrainingStaticExtensions.cs index 577a4f22e4..bd2ccad153 100644 --- a/src/Microsoft.ML.StaticPipe/TrainingStaticExtensions.cs +++ b/src/Microsoft.ML.StaticPipe/TrainingStaticExtensions.cs @@ -5,6 +5,7 @@ using System; using System.Linq; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.StaticPipe { diff --git a/src/Microsoft.ML.StaticPipe/Transformer.cs b/src/Microsoft.ML.StaticPipe/Transformer.cs index df9ee2ff89..c8cd9cc9f8 100644 --- a/src/Microsoft.ML.StaticPipe/Transformer.cs +++ b/src/Microsoft.ML.StaticPipe/Transformer.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.StaticPipe { diff --git a/src/Microsoft.ML.StaticPipe/TransformsStatic.cs b/src/Microsoft.ML.StaticPipe/TransformsStatic.cs index 492791fcdb..0fa12795d1 100644 --- a/src/Microsoft.ML.StaticPipe/TransformsStatic.cs +++ b/src/Microsoft.ML.StaticPipe/TransformsStatic.cs @@ -7,6 +7,7 @@ using System.Linq; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; using Microsoft.ML.Transforms.FeatureSelection; using Microsoft.ML.Transforms.Text; diff --git a/src/Microsoft.ML.StaticPipe/TreeTrainersStatic.cs b/src/Microsoft.ML.StaticPipe/TreeTrainersStatic.cs index 8e2b08d3d7..2d55af198b 100644 --- a/src/Microsoft.ML.StaticPipe/TreeTrainersStatic.cs +++ b/src/Microsoft.ML.StaticPipe/TreeTrainersStatic.cs @@ -4,6 +4,7 @@ using System; using Microsoft.ML.Calibrators; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers.FastTree; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.StaticPipe/WordEmbeddingsStaticExtensions.cs b/src/Microsoft.ML.StaticPipe/WordEmbeddingsStaticExtensions.cs index 7f6d9fde60..d310dcd777 100644 --- a/src/Microsoft.ML.StaticPipe/WordEmbeddingsStaticExtensions.cs +++ b/src/Microsoft.ML.StaticPipe/WordEmbeddingsStaticExtensions.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.Text; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.Sweeper/Algorithms/Grid.cs b/src/Microsoft.ML.Sweeper/Algorithms/Grid.cs index e4e45dbb2c..1fd7ea4124 100644 --- a/src/Microsoft.ML.Sweeper/Algorithms/Grid.cs +++ b/src/Microsoft.ML.Sweeper/Algorithms/Grid.cs @@ -7,6 +7,7 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Sweeper; [assembly: LoadableClass(typeof(RandomGridSweeper), typeof(RandomGridSweeper.Options), typeof(SignatureSweeper), diff --git a/src/Microsoft.ML.Sweeper/Algorithms/KdoSweeper.cs b/src/Microsoft.ML.Sweeper/Algorithms/KdoSweeper.cs index 8d0cdb86df..3ed9cc1240 100644 --- a/src/Microsoft.ML.Sweeper/Algorithms/KdoSweeper.cs +++ b/src/Microsoft.ML.Sweeper/Algorithms/KdoSweeper.cs @@ -8,6 +8,7 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Sweeper.Algorithms; using Microsoft.ML.Trainers.FastTree; diff --git a/src/Microsoft.ML.Sweeper/Algorithms/NelderMead.cs b/src/Microsoft.ML.Sweeper/Algorithms/NelderMead.cs index 7687439ead..f65d6162aa 100644 --- a/src/Microsoft.ML.Sweeper/Algorithms/NelderMead.cs +++ b/src/Microsoft.ML.Sweeper/Algorithms/NelderMead.cs @@ -8,6 +8,7 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Microsoft.ML.Sweeper; [assembly: LoadableClass(typeof(NelderMeadSweeper), typeof(NelderMeadSweeper.Options), typeof(SignatureSweeper), @@ -92,7 +93,7 @@ public NelderMeadSweeper(IHostEnvironment env, Options options) env.CheckUserArg(options.DeltaReflection > options.DeltaOutsideContraction, nameof(options.DeltaReflection), "Must be greater than " + nameof(options.DeltaOutsideContraction)); env.CheckUserArg(options.DeltaExpansion > options.DeltaReflection, nameof(options.DeltaExpansion), "Must be greater than " + nameof(options.DeltaReflection)); env.CheckUserArg(0 < options.GammaShrink && options.GammaShrink < 1, nameof(options.GammaShrink), "Must be between 0 and 1"); - env.CheckValue(options.FirstBatchSweeper, nameof(options.FirstBatchSweeper) , "First Batch Sweeper Contains Null Value"); + env.CheckValue(options.FirstBatchSweeper, nameof(options.FirstBatchSweeper), "First Batch Sweeper Contains Null Value"); _args = options; @@ -151,20 +152,104 @@ public ParameterSet[] ProposeSweeps(int maxSweeps, IEnumerable previ switch (_stage) { - case OptimizationStage.NeedReflectionPoint: - _pendingSweeps.Clear(); - var nextPoint = GetNewPoint(_centroid, _worst.Value, _args.DeltaReflection); - if (OutOfBounds(nextPoint) && _args.ProjectInbounds) - { - // if the reflection point is out of bounds, get the inner contraction point. - nextPoint = GetNewPoint(_centroid, _worst.Value, _args.DeltaInsideContraction); - _stage = OptimizationStage.WaitingForInnerContractionResult; - } - else - _stage = OptimizationStage.WaitingForReflectionResult; - _pendingSweeps.Add(new KeyValuePair(FloatArrayAsParameterSet(nextPoint), nextPoint)); - if (previousRuns.Any(runResult => runResult.ParameterSet.Equals(_pendingSweeps[0].Key))) - { + case OptimizationStage.NeedReflectionPoint: + _pendingSweeps.Clear(); + var nextPoint = GetNewPoint(_centroid, _worst.Value, _args.DeltaReflection); + if (OutOfBounds(nextPoint) && _args.ProjectInbounds) + { + // if the reflection point is out of bounds, get the inner contraction point. + nextPoint = GetNewPoint(_centroid, _worst.Value, _args.DeltaInsideContraction); + _stage = OptimizationStage.WaitingForInnerContractionResult; + } + else + _stage = OptimizationStage.WaitingForReflectionResult; + _pendingSweeps.Add(new KeyValuePair(FloatArrayAsParameterSet(nextPoint), nextPoint)); + if (previousRuns.Any(runResult => runResult.ParameterSet.Equals(_pendingSweeps[0].Key))) + { + _stage = OptimizationStage.WaitingForReductionResult; + _pendingSweeps.Clear(); + if (!TryGetReductionPoints(maxSweeps, previousRuns)) + { + _stage = OptimizationStage.Done; + return null; + } + return _pendingSweeps.Select(kvp => kvp.Key).ToArray(); + } + return new ParameterSet[] { _pendingSweeps[0].Key }; + + case OptimizationStage.WaitingForReflectionResult: + Contracts.Assert(_pendingSweeps.Count == 1); + _lastReflectionResult = FindRunResult(previousRuns)[0]; + if (_secondWorst.Key.CompareTo(_lastReflectionResult.Key) < 0 && _lastReflectionResult.Key.CompareTo(_best.Key) <= 0) + { + // the reflection result is better than the second worse, but not better than the best + UpdateSimplex(_lastReflectionResult.Key, _lastReflectionResult.Value); + goto case OptimizationStage.NeedReflectionPoint; + } + + if (_lastReflectionResult.Key.CompareTo(_best.Key) > 0) + { + // the reflection result is the best so far + nextPoint = GetNewPoint(_centroid, _worst.Value, _args.DeltaExpansion); + if (OutOfBounds(nextPoint) && _args.ProjectInbounds) + { + // if the expansion point is out of bounds, get the inner contraction point. + nextPoint = GetNewPoint(_centroid, _worst.Value, _args.DeltaInsideContraction); + _stage = OptimizationStage.WaitingForInnerContractionResult; + } + else + _stage = OptimizationStage.WaitingForExpansionResult; + } + else if (_lastReflectionResult.Key.CompareTo(_worst.Key) > 0) + { + // other wise, get results for the outer contraction point. + nextPoint = GetNewPoint(_centroid, _worst.Value, _args.DeltaOutsideContraction); + _stage = OptimizationStage.WaitingForOuterContractionResult; + } + else + { + // other wise, reflection result is not better than worst, get results for the inner contraction point + nextPoint = GetNewPoint(_centroid, _worst.Value, _args.DeltaInsideContraction); + _stage = OptimizationStage.WaitingForInnerContractionResult; + } + _pendingSweeps.Clear(); + _pendingSweeps.Add(new KeyValuePair(FloatArrayAsParameterSet(nextPoint), nextPoint)); + if (previousRuns.Any(runResult => runResult.ParameterSet.Equals(_pendingSweeps[0].Key))) + { + _stage = OptimizationStage.WaitingForReductionResult; + _pendingSweeps.Clear(); + if (!TryGetReductionPoints(maxSweeps, previousRuns)) + { + _stage = OptimizationStage.Done; + return null; + } + return _pendingSweeps.Select(kvp => kvp.Key).ToArray(); + } + return new ParameterSet[] { _pendingSweeps[0].Key }; + + case OptimizationStage.WaitingForExpansionResult: + Contracts.Assert(_pendingSweeps.Count == 1); + var expansionResult = FindRunResult(previousRuns)[0].Key; + if (expansionResult.CompareTo(_lastReflectionResult.Key) > 0) + { + // expansion point is better than reflection point + UpdateSimplex(expansionResult, _pendingSweeps[0].Value); + goto case OptimizationStage.NeedReflectionPoint; + } + // reflection point is better than expansion point + UpdateSimplex(_lastReflectionResult.Key, _lastReflectionResult.Value); + goto case OptimizationStage.NeedReflectionPoint; + + case OptimizationStage.WaitingForOuterContractionResult: + Contracts.Assert(_pendingSweeps.Count == 1); + var outerContractionResult = FindRunResult(previousRuns)[0].Key; + if (outerContractionResult.CompareTo(_lastReflectionResult.Key) > 0) + { + // outer contraction point is better than reflection point + UpdateSimplex(outerContractionResult, _pendingSweeps[0].Value); + goto case OptimizationStage.NeedReflectionPoint; + } + // get the reduction points _stage = OptimizationStage.WaitingForReductionResult; _pendingSweeps.Clear(); if (!TryGetReductionPoints(maxSweeps, previousRuns)) @@ -173,48 +258,17 @@ public ParameterSet[] ProposeSweeps(int maxSweeps, IEnumerable previ return null; } return _pendingSweeps.Select(kvp => kvp.Key).ToArray(); - } - return new ParameterSet[] { _pendingSweeps[0].Key }; - case OptimizationStage.WaitingForReflectionResult: - Contracts.Assert(_pendingSweeps.Count == 1); - _lastReflectionResult = FindRunResult(previousRuns)[0]; - if (_secondWorst.Key.CompareTo(_lastReflectionResult.Key) < 0 && _lastReflectionResult.Key.CompareTo(_best.Key) <= 0) - { - // the reflection result is better than the second worse, but not better than the best - UpdateSimplex(_lastReflectionResult.Key, _lastReflectionResult.Value); - goto case OptimizationStage.NeedReflectionPoint; - } - - if (_lastReflectionResult.Key.CompareTo(_best.Key) > 0) - { - // the reflection result is the best so far - nextPoint = GetNewPoint(_centroid, _worst.Value, _args.DeltaExpansion); - if (OutOfBounds(nextPoint) && _args.ProjectInbounds) + case OptimizationStage.WaitingForInnerContractionResult: + Contracts.Assert(_pendingSweeps.Count == 1); + var innerContractionResult = FindRunResult(previousRuns)[0].Key; + if (innerContractionResult.CompareTo(_worst.Key) > 0) { - // if the expansion point is out of bounds, get the inner contraction point. - nextPoint = GetNewPoint(_centroid, _worst.Value, _args.DeltaInsideContraction); - _stage = OptimizationStage.WaitingForInnerContractionResult; + // inner contraction point is better than worst point + UpdateSimplex(innerContractionResult, _pendingSweeps[0].Value); + goto case OptimizationStage.NeedReflectionPoint; } - else - _stage = OptimizationStage.WaitingForExpansionResult; - } - else if (_lastReflectionResult.Key.CompareTo(_worst.Key) > 0) - { - // other wise, get results for the outer contraction point. - nextPoint = GetNewPoint(_centroid, _worst.Value, _args.DeltaOutsideContraction); - _stage = OptimizationStage.WaitingForOuterContractionResult; - } - else - { - // other wise, reflection result is not better than worst, get results for the inner contraction point - nextPoint = GetNewPoint(_centroid, _worst.Value, _args.DeltaInsideContraction); - _stage = OptimizationStage.WaitingForInnerContractionResult; - } - _pendingSweeps.Clear(); - _pendingSweeps.Add(new KeyValuePair(FloatArrayAsParameterSet(nextPoint), nextPoint)); - if (previousRuns.Any(runResult => runResult.ParameterSet.Equals(_pendingSweeps[0].Key))) - { + // get the reduction points _stage = OptimizationStage.WaitingForReductionResult; _pendingSweeps.Clear(); if (!TryGetReductionPoints(maxSweeps, previousRuns)) @@ -223,74 +277,21 @@ public ParameterSet[] ProposeSweeps(int maxSweeps, IEnumerable previ return null; } return _pendingSweeps.Select(kvp => kvp.Key).ToArray(); - } - return new ParameterSet[] { _pendingSweeps[0].Key }; - case OptimizationStage.WaitingForExpansionResult: - Contracts.Assert(_pendingSweeps.Count == 1); - var expansionResult = FindRunResult(previousRuns)[0].Key; - if (expansionResult.CompareTo(_lastReflectionResult.Key) > 0) - { - // expansion point is better than reflection point - UpdateSimplex(expansionResult, _pendingSweeps[0].Value); - goto case OptimizationStage.NeedReflectionPoint; - } - // reflection point is better than expansion point - UpdateSimplex(_lastReflectionResult.Key, _lastReflectionResult.Value); - goto case OptimizationStage.NeedReflectionPoint; - - case OptimizationStage.WaitingForOuterContractionResult: - Contracts.Assert(_pendingSweeps.Count == 1); - var outerContractionResult = FindRunResult(previousRuns)[0].Key; - if (outerContractionResult.CompareTo(_lastReflectionResult.Key) > 0) - { - // outer contraction point is better than reflection point - UpdateSimplex(outerContractionResult, _pendingSweeps[0].Value); - goto case OptimizationStage.NeedReflectionPoint; - } - // get the reduction points - _stage = OptimizationStage.WaitingForReductionResult; - _pendingSweeps.Clear(); - if (!TryGetReductionPoints(maxSweeps, previousRuns)) - { - _stage = OptimizationStage.Done; - return null; - } - return _pendingSweeps.Select(kvp => kvp.Key).ToArray(); - - case OptimizationStage.WaitingForInnerContractionResult: - Contracts.Assert(_pendingSweeps.Count == 1); - var innerContractionResult = FindRunResult(previousRuns)[0].Key; - if (innerContractionResult.CompareTo(_worst.Key) > 0) - { - // inner contraction point is better than worst point - UpdateSimplex(innerContractionResult, _pendingSweeps[0].Value); - goto case OptimizationStage.NeedReflectionPoint; - } - // get the reduction points - _stage = OptimizationStage.WaitingForReductionResult; - _pendingSweeps.Clear(); - if (!TryGetReductionPoints(maxSweeps, previousRuns)) - { - _stage = OptimizationStage.Done; - return null; - } - return _pendingSweeps.Select(kvp => kvp.Key).ToArray(); + case OptimizationStage.WaitingForReductionResult: + Contracts.Assert(_pendingSweeps.Count + _pendingSweepsNotSubmitted.Count == _dim); + if (_pendingSweeps.Count < _dim) + return SubmitMoreReductionPoints(maxSweeps); + ReplaceSimplexVertices(previousRuns); - case OptimizationStage.WaitingForReductionResult: - Contracts.Assert(_pendingSweeps.Count + _pendingSweepsNotSubmitted.Count == _dim); - if (_pendingSweeps.Count < _dim) - return SubmitMoreReductionPoints(maxSweeps); - ReplaceSimplexVertices(previousRuns); + // if the diameter of the new simplex has become too small, stop sweeping. + if (SimplexDiameter() < _args.StoppingSimplexDiameter) + return null; - // if the diameter of the new simplex has become too small, stop sweeping. - if (SimplexDiameter() < _args.StoppingSimplexDiameter) + goto case OptimizationStage.NeedReflectionPoint; + case OptimizationStage.Done: + default: return null; - - goto case OptimizationStage.NeedReflectionPoint; - case OptimizationStage.Done: - default: - return null; } } diff --git a/src/Microsoft.ML.Sweeper/Algorithms/Random.cs b/src/Microsoft.ML.Sweeper/Algorithms/Random.cs index 491cdb6161..08d5e75b38 100644 --- a/src/Microsoft.ML.Sweeper/Algorithms/Random.cs +++ b/src/Microsoft.ML.Sweeper/Algorithms/Random.cs @@ -4,6 +4,7 @@ using System.Linq; using Microsoft.ML; +using Microsoft.ML.Runtime; using Microsoft.ML.Sweeper; [assembly: LoadableClass(typeof(UniformRandomSweeper), typeof(SweeperBase.OptionsBase), typeof(SignatureSweeper), diff --git a/src/Microsoft.ML.Sweeper/Algorithms/SmacSweeper.cs b/src/Microsoft.ML.Sweeper/Algorithms/SmacSweeper.cs index 772a8d07ad..61cffff813 100644 --- a/src/Microsoft.ML.Sweeper/Algorithms/SmacSweeper.cs +++ b/src/Microsoft.ML.Sweeper/Algorithms/SmacSweeper.cs @@ -10,6 +10,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Sweeper; using Microsoft.ML.Sweeper.Algorithms; using Microsoft.ML.Trainers.FastTree; diff --git a/src/Microsoft.ML.Sweeper/Algorithms/SweeperProbabilityUtils.cs b/src/Microsoft.ML.Sweeper/Algorithms/SweeperProbabilityUtils.cs index 09fc1ba847..4e124d318e 100644 --- a/src/Microsoft.ML.Sweeper/Algorithms/SweeperProbabilityUtils.cs +++ b/src/Microsoft.ML.Sweeper/Algorithms/SweeperProbabilityUtils.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using Microsoft.ML.Internal.CpuMath; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Sweeper.Algorithms { diff --git a/src/Microsoft.ML.Sweeper/AsyncSweeper.cs b/src/Microsoft.ML.Sweeper/AsyncSweeper.cs index 579f20c53b..703bdf4443 100644 --- a/src/Microsoft.ML.Sweeper/AsyncSweeper.cs +++ b/src/Microsoft.ML.Sweeper/AsyncSweeper.cs @@ -7,10 +7,10 @@ using System.Threading; using System.Threading.Tasks; using System.Threading.Tasks.Dataflow; - using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Sweeper; [assembly: LoadableClass(typeof(SimpleAsyncSweeper), typeof(SweeperBase.OptionsBase), typeof(SignatureAsyncSweeper), diff --git a/src/Microsoft.ML.Sweeper/ConfigRunner.cs b/src/Microsoft.ML.Sweeper/ConfigRunner.cs index a301bcf521..fb57fcedd7 100644 --- a/src/Microsoft.ML.Sweeper/ConfigRunner.cs +++ b/src/Microsoft.ML.Sweeper/ConfigRunner.cs @@ -10,8 +10,8 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Sweeper; - using ResultProcessorInternal = Microsoft.ML.ResultProcessor; [assembly: LoadableClass(typeof(LocalExeConfigRunner), typeof(LocalExeConfigRunner.Options), typeof(SignatureConfigRunner), @@ -166,7 +166,7 @@ public IEnumerable RunConfigs(ParameterSet[] sweeps, int min) for (int i = 0; i < sweeps.Length; i++) ch.Info("Parameter set: {0}", string.Join(", ", sweeps[i].Select(p => string.Format("{0}:{1}", p.Name, p.ValueText)))); - return RunConfigsCore(sweeps, ch, min); + return RunConfigsCore(sweeps, ch, min); } } diff --git a/src/Microsoft.ML.Sweeper/ISweeper.cs b/src/Microsoft.ML.Sweeper/ISweeper.cs index c40e43a396..61d9bc3097 100644 --- a/src/Microsoft.ML.Sweeper/ISweeper.cs +++ b/src/Microsoft.ML.Sweeper/ISweeper.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML { diff --git a/src/Microsoft.ML.Sweeper/Parameters.cs b/src/Microsoft.ML.Sweeper/Parameters.cs index e0c95dab12..2518339381 100644 --- a/src/Microsoft.ML.Sweeper/Parameters.cs +++ b/src/Microsoft.ML.Sweeper/Parameters.cs @@ -10,6 +10,7 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Sweeper; [assembly: LoadableClass(typeof(LongValueGenerator), typeof(LongParamOptions), typeof(SignatureSweeperParameter), diff --git a/src/Microsoft.ML.Sweeper/SweepCommand.cs b/src/Microsoft.ML.Sweeper/SweepCommand.cs index 2e27338040..7f31daca23 100644 --- a/src/Microsoft.ML.Sweeper/SweepCommand.cs +++ b/src/Microsoft.ML.Sweeper/SweepCommand.cs @@ -9,6 +9,7 @@ using Microsoft.ML.Command; using Microsoft.ML.CommandLine; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Sweeper; [assembly: LoadableClass(SweepCommand.Summary, typeof(SweepCommand), typeof(SweepCommand.Arguments), typeof(SignatureCommand), diff --git a/src/Microsoft.ML.Sweeper/SweepResultEvaluator.cs b/src/Microsoft.ML.Sweeper/SweepResultEvaluator.cs index 82149cea5b..5ebae9c8ce 100644 --- a/src/Microsoft.ML.Sweeper/SweepResultEvaluator.cs +++ b/src/Microsoft.ML.Sweeper/SweepResultEvaluator.cs @@ -7,6 +7,7 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Sweeper; using ResultProcessor = Microsoft.ML.ResultProcessor; diff --git a/src/Microsoft.ML.Sweeper/SynthConfigRunner.cs b/src/Microsoft.ML.Sweeper/SynthConfigRunner.cs index 21555277af..7f2d390974 100644 --- a/src/Microsoft.ML.Sweeper/SynthConfigRunner.cs +++ b/src/Microsoft.ML.Sweeper/SynthConfigRunner.cs @@ -6,9 +6,9 @@ using System.Collections.Generic; using System.IO; using System.Threading.Tasks; - using Microsoft.ML; using Microsoft.ML.CommandLine; +using Microsoft.ML.Runtime; using Microsoft.ML.Sweeper; [assembly: LoadableClass(typeof(SynthConfigRunner), typeof(SynthConfigRunner.Options), typeof(SignatureConfigRunner), diff --git a/src/Microsoft.ML.TensorFlow.StaticPipe/TensorFlowStaticExtensions.cs b/src/Microsoft.ML.TensorFlow.StaticPipe/TensorFlowStaticExtensions.cs index 6e2b28f12d..94d244fcd4 100644 --- a/src/Microsoft.ML.TensorFlow.StaticPipe/TensorFlowStaticExtensions.cs +++ b/src/Microsoft.ML.TensorFlow.StaticPipe/TensorFlowStaticExtensions.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; +using Microsoft.ML.Runtime; using Microsoft.ML.StaticPipe; namespace Microsoft.ML.Transforms.StaticPipe diff --git a/src/Microsoft.ML.TensorFlow/TensorFlow/Tensor.cs b/src/Microsoft.ML.TensorFlow/TensorFlow/Tensor.cs index fe770d3cc7..66d9f10c4c 100644 --- a/src/Microsoft.ML.TensorFlow/TensorFlow/Tensor.cs +++ b/src/Microsoft.ML.TensorFlow/TensorFlow/Tensor.cs @@ -6,6 +6,7 @@ using System.Numerics; using System.Runtime.InteropServices; using System.Text; +using Microsoft.ML.Runtime; using size_t = System.UIntPtr; using TF_Status = System.IntPtr; using TF_Tensor = System.IntPtr; @@ -478,7 +479,7 @@ internal static unsafe TFTensor CreateStringTensor(byte[][] buffer, TFShape shap // [offset1, offset2,...,offsetn, s1size, s1bytes, s2size, s2bytes,...,snsize,snbytes] // int size = 0; - foreach(var b in buffer) + foreach (var b in buffer) { size += (int)TF_StringEncodedSize((UIntPtr)b.Length); } diff --git a/src/Microsoft.ML.TensorFlow/TensorFlow/TensorGeneric.cs b/src/Microsoft.ML.TensorFlow/TensorFlow/TensorGeneric.cs index 2a91b63f0b..fb3646ffe9 100644 --- a/src/Microsoft.ML.TensorFlow/TensorFlow/TensorGeneric.cs +++ b/src/Microsoft.ML.TensorFlow/TensorFlow/TensorGeneric.cs @@ -3,6 +3,7 @@ using System; using System.Text; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms.TensorFlow { diff --git a/src/Microsoft.ML.TensorFlow/TensorFlow/TensorflowUtils.cs b/src/Microsoft.ML.TensorFlow/TensorFlow/TensorflowUtils.cs index 6c6df85adb..614456f690 100644 --- a/src/Microsoft.ML.TensorFlow/TensorFlow/TensorflowUtils.cs +++ b/src/Microsoft.ML.TensorFlow/TensorFlow/TensorflowUtils.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System; -using System.Collections.Generic; using System.IO; using System.Linq; using System.Security.AccessControl; @@ -12,6 +11,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms.TensorFlow { diff --git a/src/Microsoft.ML.TensorFlow/TensorFlowModel.cs b/src/Microsoft.ML.TensorFlow/TensorFlowModel.cs index 589133b778..f3c2c6d771 100644 --- a/src/Microsoft.ML.TensorFlow/TensorFlowModel.cs +++ b/src/Microsoft.ML.TensorFlow/TensorFlowModel.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.TensorFlow; namespace Microsoft.ML.Transforms @@ -107,7 +108,7 @@ public TensorFlowEstimator RetrainTensorFlowModel( string optimizationOperation, int epoch = 10, int batchSize = 20, - string lossOperation= null, + string lossOperation = null, string metricOperation = null, string learningRateOperation = null, float learningRate = 0.01f) diff --git a/src/Microsoft.ML.TensorFlow/TensorflowTransform.cs b/src/Microsoft.ML.TensorFlow/TensorflowTransform.cs index 53a23a29d8..89d3b1d0b7 100644 --- a/src/Microsoft.ML.TensorFlow/TensorflowTransform.cs +++ b/src/Microsoft.ML.TensorFlow/TensorflowTransform.cs @@ -13,7 +13,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; using Microsoft.ML.Transforms.TensorFlow; diff --git a/src/Microsoft.ML.TimeSeries.StaticPipe/TimeSeriesStatic.cs b/src/Microsoft.ML.TimeSeries.StaticPipe/TimeSeriesStatic.cs index 9bb6114d90..df4d6877ef 100644 --- a/src/Microsoft.ML.TimeSeries.StaticPipe/TimeSeriesStatic.cs +++ b/src/Microsoft.ML.TimeSeries.StaticPipe/TimeSeriesStatic.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.TimeSeries; namespace Microsoft.ML.StaticPipe diff --git a/src/Microsoft.ML.TimeSeries/AdaptiveSingularSpectrumSequenceModeler.cs b/src/Microsoft.ML.TimeSeries/AdaptiveSingularSpectrumSequenceModeler.cs index 7335157945..0af119b638 100644 --- a/src/Microsoft.ML.TimeSeries/AdaptiveSingularSpectrumSequenceModeler.cs +++ b/src/Microsoft.ML.TimeSeries/AdaptiveSingularSpectrumSequenceModeler.cs @@ -10,7 +10,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.CpuMath; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.TimeSeries; [assembly: LoadableClass(typeof(AdaptiveSingularSpectrumSequenceModeler), typeof(AdaptiveSingularSpectrumSequenceModeler), null, typeof(SignatureLoadModel), diff --git a/src/Microsoft.ML.TimeSeries/EigenUtils.cs b/src/Microsoft.ML.TimeSeries/EigenUtils.cs index 48c211a608..c4f13f05db 100644 --- a/src/Microsoft.ML.TimeSeries/EigenUtils.cs +++ b/src/Microsoft.ML.TimeSeries/EigenUtils.cs @@ -6,6 +6,7 @@ using System.Runtime.InteropServices; using System.Security; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms.TimeSeries { diff --git a/src/Microsoft.ML.TimeSeries/ExponentialAverageTransform.cs b/src/Microsoft.ML.TimeSeries/ExponentialAverageTransform.cs index 29653b2620..9c2308f6b8 100644 --- a/src/Microsoft.ML.TimeSeries/ExponentialAverageTransform.cs +++ b/src/Microsoft.ML.TimeSeries/ExponentialAverageTransform.cs @@ -7,9 +7,8 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.TimeSeries; [assembly: LoadableClass(ExponentialAverageTransform.Summary, typeof(ExponentialAverageTransform), typeof(ExponentialAverageTransform.Arguments), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.TimeSeries/FftUtils.cs b/src/Microsoft.ML.TimeSeries/FftUtils.cs index 28a19a89ed..2b00009547 100644 --- a/src/Microsoft.ML.TimeSeries/FftUtils.cs +++ b/src/Microsoft.ML.TimeSeries/FftUtils.cs @@ -5,6 +5,7 @@ using System; using System.Runtime.InteropServices; using System.Security; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms.TimeSeries { diff --git a/src/Microsoft.ML.TimeSeries/IidAnomalyDetectionBase.cs b/src/Microsoft.ML.TimeSeries/IidAnomalyDetectionBase.cs index 46902ae369..6b9c2cc6f8 100644 --- a/src/Microsoft.ML.TimeSeries/IidAnomalyDetectionBase.cs +++ b/src/Microsoft.ML.TimeSeries/IidAnomalyDetectionBase.cs @@ -7,7 +7,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms.TimeSeries { diff --git a/src/Microsoft.ML.TimeSeries/IidChangePointDetector.cs b/src/Microsoft.ML.TimeSeries/IidChangePointDetector.cs index af43a18c64..08e5165389 100644 --- a/src/Microsoft.ML.TimeSeries/IidChangePointDetector.cs +++ b/src/Microsoft.ML.TimeSeries/IidChangePointDetector.cs @@ -9,8 +9,7 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.TimeSeries; [assembly: LoadableClass(IidChangePointDetector.Summary, typeof(IDataTransform), typeof(IidChangePointDetector), typeof(IidChangePointDetector.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.TimeSeries/IidSpikeDetector.cs b/src/Microsoft.ML.TimeSeries/IidSpikeDetector.cs index 5302e3f42b..10b42e2dfb 100644 --- a/src/Microsoft.ML.TimeSeries/IidSpikeDetector.cs +++ b/src/Microsoft.ML.TimeSeries/IidSpikeDetector.cs @@ -8,8 +8,7 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.TimeSeries; [assembly: LoadableClass(IidSpikeDetector.Summary, typeof(IDataTransform), typeof(IidSpikeDetector), typeof(IidSpikeDetector.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.TimeSeries/MovingAverageTransform.cs b/src/Microsoft.ML.TimeSeries/MovingAverageTransform.cs index 1e04173d49..b02697d88f 100644 --- a/src/Microsoft.ML.TimeSeries/MovingAverageTransform.cs +++ b/src/Microsoft.ML.TimeSeries/MovingAverageTransform.cs @@ -9,7 +9,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.TimeSeries; [assembly: LoadableClass(MovingAverageTransform.Summary, typeof(MovingAverageTransform), typeof(MovingAverageTransform.Arguments), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.TimeSeries/PValueTransform.cs b/src/Microsoft.ML.TimeSeries/PValueTransform.cs index 528f8b7fd0..26d90dd3ba 100644 --- a/src/Microsoft.ML.TimeSeries/PValueTransform.cs +++ b/src/Microsoft.ML.TimeSeries/PValueTransform.cs @@ -7,9 +7,8 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.TimeSeries; [assembly: LoadableClass(PValueTransform.Summary, typeof(PValueTransform), typeof(PValueTransform.Arguments), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.TimeSeries/PercentileThresholdTransform.cs b/src/Microsoft.ML.TimeSeries/PercentileThresholdTransform.cs index a4e8c792d0..615b0f0a2a 100644 --- a/src/Microsoft.ML.TimeSeries/PercentileThresholdTransform.cs +++ b/src/Microsoft.ML.TimeSeries/PercentileThresholdTransform.cs @@ -7,9 +7,8 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.TimeSeries; [assembly: LoadableClass(PercentileThresholdTransform.Summary, typeof(PercentileThresholdTransform), typeof(PercentileThresholdTransform.Arguments), typeof(SignatureDataTransform), @@ -75,7 +74,7 @@ public PercentileThresholdTransform(IHostEnvironment env, Arguments args, IDataV } public PercentileThresholdTransform(IHostEnvironment env, ModelLoadContext ctx, IDataView input) - : base(env, ctx, LoaderSignature,input) + : base(env, ctx, LoaderSignature, input) { // *** Binary format *** // Double: _percentile diff --git a/src/Microsoft.ML.TimeSeries/PolynomialUtils.cs b/src/Microsoft.ML.TimeSeries/PolynomialUtils.cs index 7ba7dd0d25..5973a65192 100644 --- a/src/Microsoft.ML.TimeSeries/PolynomialUtils.cs +++ b/src/Microsoft.ML.TimeSeries/PolynomialUtils.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Numerics; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms.TimeSeries { diff --git a/src/Microsoft.ML.TimeSeries/PredictionFunction.cs b/src/Microsoft.ML.TimeSeries/PredictionFunction.cs index 9a52074206..e4ebea4d91 100644 --- a/src/Microsoft.ML.TimeSeries/PredictionFunction.cs +++ b/src/Microsoft.ML.TimeSeries/PredictionFunction.cs @@ -8,6 +8,7 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms.TimeSeries { @@ -68,12 +69,12 @@ public sealed class TimeSeriesPredictionFunction : PredictionEngineB public void CheckPoint(IHostEnvironment env, string modelPath) { using (var file = File.Create(modelPath)) - if (Transformer is ITransformerChainAccessor ) + if (Transformer is ITransformerChainAccessor) { new TransformerChain - (((ITransformerChainAccessor )Transformer).Transformers, - ((ITransformerChainAccessor )Transformer).Scopes).SaveTo(env, file); + (((ITransformerChainAccessor)Transformer).Transformers, + ((ITransformerChainAccessor)Transformer).Scopes).SaveTo(env, file); } else Transformer.SaveTo(env, file); @@ -83,9 +84,9 @@ private static ITransformer CloneTransformers(ITransformer transformer) { ITransformer[] transformersClone = null; TransformerScope[] scopeClone = null; - if (transformer is ITransformerChainAccessor ) + if (transformer is ITransformerChainAccessor) { - ITransformerChainAccessor accessor = (ITransformerChainAccessor )transformer; + ITransformerChainAccessor accessor = (ITransformerChainAccessor)transformer; transformersClone = accessor.Transformers.Select(x => x).ToArray(); scopeClone = accessor.Scopes.Select(x => x).ToArray(); int index = 0; @@ -178,8 +179,8 @@ private protected override void PredictionEngineCore(IHostEnvironment env, DataV private bool IsRowToRowMapper(ITransformer transformer) { - if (transformer is ITransformerChainAccessor ) - return ((ITransformerChainAccessor )transformer).Transformers.All(t => t.IsRowToRowMapper || t is IStatefulTransformer); + if (transformer is ITransformerChainAccessor) + return ((ITransformerChainAccessor)transformer).Transformers.All(t => t.IsRowToRowMapper || t is IStatefulTransformer); else return transformer.IsRowToRowMapper || transformer is IStatefulTransformer; } @@ -190,15 +191,15 @@ private IRowToRowMapper GetRowToRowMapper(DataViewSchema inputSchema) Contracts.Check(IsRowToRowMapper(InputTransformer), nameof(GetRowToRowMapper) + " method called despite " + nameof(IsRowToRowMapper) + " being false. or transformer not being " + nameof(IStatefulTransformer)); - if (!(InputTransformer is ITransformerChainAccessor )) + if (!(InputTransformer is ITransformerChainAccessor)) if (InputTransformer is IStatefulTransformer) return ((IStatefulTransformer)InputTransformer).GetStatefulRowToRowMapper(inputSchema); else return InputTransformer.GetRowToRowMapper(inputSchema); - Contracts.Check(InputTransformer is ITransformerChainAccessor ); + Contracts.Check(InputTransformer is ITransformerChainAccessor); - var transformers = ((ITransformerChainAccessor )InputTransformer).Transformers; + var transformers = ((ITransformerChainAccessor)InputTransformer).Transformers; IRowToRowMapper[] mappers = new IRowToRowMapper[transformers.Length]; DataViewSchema schema = inputSchema; for (int i = 0; i < mappers.Length; ++i) diff --git a/src/Microsoft.ML.TimeSeries/SequenceModelerBase.cs b/src/Microsoft.ML.TimeSeries/SequenceModelerBase.cs index b6da0925cc..287444f631 100644 --- a/src/Microsoft.ML.TimeSeries/SequenceModelerBase.cs +++ b/src/Microsoft.ML.TimeSeries/SequenceModelerBase.cs @@ -4,7 +4,6 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; namespace Microsoft.ML.Transforms.TimeSeries { diff --git a/src/Microsoft.ML.TimeSeries/SequentialAnomalyDetectionTransformBase.cs b/src/Microsoft.ML.TimeSeries/SequentialAnomalyDetectionTransformBase.cs index c29e70700a..094b04aade 100644 --- a/src/Microsoft.ML.TimeSeries/SequentialAnomalyDetectionTransformBase.cs +++ b/src/Microsoft.ML.TimeSeries/SequentialAnomalyDetectionTransformBase.cs @@ -10,7 +10,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.CpuMath; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms.TimeSeries { @@ -113,254 +113,254 @@ internal abstract class ArgumentsBase public Double AlertThreshold; } - // REVIEW: This base class and its children classes generate one output column of type VBuffer to output 3 different anomaly scores as well as - // the alert flag. Ideally these 4 output information should be put in four seaparate columns instead of one VBuffer<> column. However, this is not currently - // possible due to our design restriction. This must be fixed in the next version and will potentially affect the children classes. - /// - /// The base class for sequential anomaly detection transforms that supports the p-value as well as the martingales scores computation from the sequence of - /// raw anomaly scores whose calculation is specified by the children classes. This class also provides mechanism for the threshold-based alerting on - /// the raw anomaly score, the p-value score or the martingale score. Currently, this class supports Power and Mixture martingales. - /// For more details, please refer to http://arxiv.org/pdf/1204.3251.pdf - /// - /// The type of the input sequence - /// The type of the input sequence - internal abstract class SequentialAnomalyDetectionTransformBase : SequentialTransformerBase, TState> - where TState : SequentialAnomalyDetectionTransformBase.AnomalyDetectionStateBase, new() - { - // Determines the side of anomaly detection for this transform. - internal AnomalySide Side; + // REVIEW: This base class and its children classes generate one output column of type VBuffer to output 3 different anomaly scores as well as + // the alert flag. Ideally these 4 output information should be put in four seaparate columns instead of one VBuffer<> column. However, this is not currently + // possible due to our design restriction. This must be fixed in the next version and will potentially affect the children classes. + /// + /// The base class for sequential anomaly detection transforms that supports the p-value as well as the martingales scores computation from the sequence of + /// raw anomaly scores whose calculation is specified by the children classes. This class also provides mechanism for the threshold-based alerting on + /// the raw anomaly score, the p-value score or the martingale score. Currently, this class supports Power and Mixture martingales. + /// For more details, please refer to http://arxiv.org/pdf/1204.3251.pdf + /// + /// The type of the input sequence + /// The type of the input sequence + internal abstract class SequentialAnomalyDetectionTransformBase : SequentialTransformerBase, TState> + where TState : SequentialAnomalyDetectionTransformBase.AnomalyDetectionStateBase, new() + { + // Determines the side of anomaly detection for this transform. + internal AnomalySide Side; - // Determines the type of martingale used by this transform. - internal MartingaleType Martingale; + // Determines the type of martingale used by this transform. + internal MartingaleType Martingale; - // The epsilon parameter used by the Power martingale. - internal Double PowerMartingaleEpsilon; + // The epsilon parameter used by the Power martingale. + internal Double PowerMartingaleEpsilon; - // Determines the score that should be thresholded to generate alerts by this transform. - internal AlertingScore ThresholdScore; + // Determines the score that should be thresholded to generate alerts by this transform. + internal AlertingScore ThresholdScore; - // Determines the threshold for generating alerts. - internal Double AlertThreshold; + // Determines the threshold for generating alerts. + internal Double AlertThreshold; - // The size of the VBuffer in the dst column. - internal int OutputLength; + // The size of the VBuffer in the dst column. + internal int OutputLength; - // The minimum value for p-values. The smaller p-values are ceiled to this value. - internal const Double MinPValue = 1e-8; + // The minimum value for p-values. The smaller p-values are ceiled to this value. + internal const Double MinPValue = 1e-8; - // The maximun value for p-values. The larger p-values are floored to this value. - internal const Double MaxPValue = 1 - MinPValue; + // The maximun value for p-values. The larger p-values are floored to this value. + internal const Double MaxPValue = 1 - MinPValue; - private static int GetOutputLength(AlertingScore alertingScore, IHostEnvironment host) + private static int GetOutputLength(AlertingScore alertingScore, IHostEnvironment host) + { + switch (alertingScore) { - switch (alertingScore) - { - case AlertingScore.RawScore: - return 2; - case AlertingScore.PValueScore: - return 3; - case AlertingScore.MartingaleScore: - return 4; - default: - throw host.Except("The alerting score can be only (0) RawScore, (1) PValueScore or (2) MartingaleScore."); - } + case AlertingScore.RawScore: + return 2; + case AlertingScore.PValueScore: + return 3; + case AlertingScore.MartingaleScore: + return 4; + default: + throw host.Except("The alerting score can be only (0) RawScore, (1) PValueScore or (2) MartingaleScore."); } + } - private protected SequentialAnomalyDetectionTransformBase(int windowSize, int initialWindowSize, string inputColumnName, string outputColumnName, string name, IHostEnvironment env, - AnomalySide anomalySide, MartingaleType martingale, AlertingScore alertingScore, Double powerMartingaleEpsilon, - Double alertThreshold) - : base(Contracts.CheckRef(env, nameof(env)).Register(name), windowSize, initialWindowSize, outputColumnName, inputColumnName, new VectorType(NumberDataViewType.Double, GetOutputLength(alertingScore, env))) - { - Host.CheckUserArg(Enum.IsDefined(typeof(MartingaleType), martingale), nameof(ArgumentsBase.Martingale), "Value is undefined."); - Host.CheckUserArg(Enum.IsDefined(typeof(AnomalySide), anomalySide), nameof(ArgumentsBase.Side), "Value is undefined."); - Host.CheckUserArg(Enum.IsDefined(typeof(AlertingScore), alertingScore), nameof(ArgumentsBase.AlertOn), "Value is undefined."); - Host.CheckUserArg(martingale != MartingaleType.None || alertingScore != AlertingScore.MartingaleScore, nameof(ArgumentsBase.Martingale), "A martingale type should be specified if alerting is based on the martingale score."); - Host.CheckUserArg(windowSize > 0 || alertingScore == AlertingScore.RawScore, nameof(ArgumentsBase.AlertOn), - "When there is no windowed buffering (i.e., " + nameof(ArgumentsBase.WindowSize) + " = 0), the alert can be generated only based on the raw score (i.e., " - + nameof(ArgumentsBase.AlertOn) + " = " + nameof(AlertingScore.RawScore) + ")"); - Host.CheckUserArg(0 < powerMartingaleEpsilon && powerMartingaleEpsilon < 1, nameof(ArgumentsBase.PowerMartingaleEpsilon), "Should be in (0,1)."); - Host.CheckUserArg(alertThreshold >= 0, nameof(ArgumentsBase.AlertThreshold), "Must be non-negative."); - Host.CheckUserArg(alertingScore != AlertingScore.PValueScore || (0 <= alertThreshold && alertThreshold <= 1), nameof(ArgumentsBase.AlertThreshold), "Must be in [0,1]."); - - ThresholdScore = alertingScore; - Side = anomalySide; - Martingale = martingale; - PowerMartingaleEpsilon = powerMartingaleEpsilon; - AlertThreshold = alertThreshold; - OutputLength = GetOutputLength(ThresholdScore, Host); - } + private protected SequentialAnomalyDetectionTransformBase(int windowSize, int initialWindowSize, string inputColumnName, string outputColumnName, string name, IHostEnvironment env, + AnomalySide anomalySide, MartingaleType martingale, AlertingScore alertingScore, Double powerMartingaleEpsilon, + Double alertThreshold) + : base(Contracts.CheckRef(env, nameof(env)).Register(name), windowSize, initialWindowSize, outputColumnName, inputColumnName, new VectorType(NumberDataViewType.Double, GetOutputLength(alertingScore, env))) + { + Host.CheckUserArg(Enum.IsDefined(typeof(MartingaleType), martingale), nameof(ArgumentsBase.Martingale), "Value is undefined."); + Host.CheckUserArg(Enum.IsDefined(typeof(AnomalySide), anomalySide), nameof(ArgumentsBase.Side), "Value is undefined."); + Host.CheckUserArg(Enum.IsDefined(typeof(AlertingScore), alertingScore), nameof(ArgumentsBase.AlertOn), "Value is undefined."); + Host.CheckUserArg(martingale != MartingaleType.None || alertingScore != AlertingScore.MartingaleScore, nameof(ArgumentsBase.Martingale), "A martingale type should be specified if alerting is based on the martingale score."); + Host.CheckUserArg(windowSize > 0 || alertingScore == AlertingScore.RawScore, nameof(ArgumentsBase.AlertOn), + "When there is no windowed buffering (i.e., " + nameof(ArgumentsBase.WindowSize) + " = 0), the alert can be generated only based on the raw score (i.e., " + + nameof(ArgumentsBase.AlertOn) + " = " + nameof(AlertingScore.RawScore) + ")"); + Host.CheckUserArg(0 < powerMartingaleEpsilon && powerMartingaleEpsilon < 1, nameof(ArgumentsBase.PowerMartingaleEpsilon), "Should be in (0,1)."); + Host.CheckUserArg(alertThreshold >= 0, nameof(ArgumentsBase.AlertThreshold), "Must be non-negative."); + Host.CheckUserArg(alertingScore != AlertingScore.PValueScore || (0 <= alertThreshold && alertThreshold <= 1), nameof(ArgumentsBase.AlertThreshold), "Must be in [0,1]."); + + ThresholdScore = alertingScore; + Side = anomalySide; + Martingale = martingale; + PowerMartingaleEpsilon = powerMartingaleEpsilon; + AlertThreshold = alertThreshold; + OutputLength = GetOutputLength(ThresholdScore, Host); + } - private protected SequentialAnomalyDetectionTransformBase(ArgumentsBase args, string name, IHostEnvironment env) - : this(args.WindowSize, args.InitialWindowSize, args.Source, args.Name, name, env, args.Side, args.Martingale, - args.AlertOn, args.PowerMartingaleEpsilon, args.AlertThreshold) - { - } + private protected SequentialAnomalyDetectionTransformBase(ArgumentsBase args, string name, IHostEnvironment env) + : this(args.WindowSize, args.InitialWindowSize, args.Source, args.Name, name, env, args.Side, args.Martingale, + args.AlertOn, args.PowerMartingaleEpsilon, args.AlertThreshold) + { + } - private protected SequentialAnomalyDetectionTransformBase(IHostEnvironment env, ModelLoadContext ctx, string name) - : base(Contracts.CheckRef(env, nameof(env)).Register(name), ctx) - { - // *** Binary format *** - // - // byte: _martingale - // byte: _alertingScore - // byte: _anomalySide - // Double: _powerMartingaleEpsilon - // Double: _alertThreshold - - byte temp; - temp = ctx.Reader.ReadByte(); - Host.CheckDecode(Enum.IsDefined(typeof(MartingaleType), temp)); - Martingale = (MartingaleType)temp; - - temp = ctx.Reader.ReadByte(); - Host.CheckDecode(Enum.IsDefined(typeof(AlertingScore), temp)); - ThresholdScore = (AlertingScore)temp; - - Host.CheckDecode(Martingale != MartingaleType.None || ThresholdScore != AlertingScore.MartingaleScore); - Host.CheckDecode(WindowSize > 0 || ThresholdScore == AlertingScore.RawScore); - - temp = ctx.Reader.ReadByte(); - Host.CheckDecode(Enum.IsDefined(typeof(AnomalySide), temp)); - Side = (AnomalySide)temp; - - PowerMartingaleEpsilon = ctx.Reader.ReadDouble(); - Host.CheckDecode(0 < PowerMartingaleEpsilon && PowerMartingaleEpsilon < 1); - - AlertThreshold = ctx.Reader.ReadDouble(); - Host.CheckDecode(AlertThreshold >= 0); - Host.CheckDecode(ThresholdScore != AlertingScore.PValueScore || (0 <= AlertThreshold && AlertThreshold <= 1)); - - OutputLength = GetOutputLength(ThresholdScore, Host); - } + private protected SequentialAnomalyDetectionTransformBase(IHostEnvironment env, ModelLoadContext ctx, string name) + : base(Contracts.CheckRef(env, nameof(env)).Register(name), ctx) + { + // *** Binary format *** + // + // byte: _martingale + // byte: _alertingScore + // byte: _anomalySide + // Double: _powerMartingaleEpsilon + // Double: _alertThreshold + + byte temp; + temp = ctx.Reader.ReadByte(); + Host.CheckDecode(Enum.IsDefined(typeof(MartingaleType), temp)); + Martingale = (MartingaleType)temp; + + temp = ctx.Reader.ReadByte(); + Host.CheckDecode(Enum.IsDefined(typeof(AlertingScore), temp)); + ThresholdScore = (AlertingScore)temp; + + Host.CheckDecode(Martingale != MartingaleType.None || ThresholdScore != AlertingScore.MartingaleScore); + Host.CheckDecode(WindowSize > 0 || ThresholdScore == AlertingScore.RawScore); + + temp = ctx.Reader.ReadByte(); + Host.CheckDecode(Enum.IsDefined(typeof(AnomalySide), temp)); + Side = (AnomalySide)temp; + + PowerMartingaleEpsilon = ctx.Reader.ReadDouble(); + Host.CheckDecode(0 < PowerMartingaleEpsilon && PowerMartingaleEpsilon < 1); + + AlertThreshold = ctx.Reader.ReadDouble(); + Host.CheckDecode(AlertThreshold >= 0); + Host.CheckDecode(ThresholdScore != AlertingScore.PValueScore || (0 <= AlertThreshold && AlertThreshold <= 1)); + + OutputLength = GetOutputLength(ThresholdScore, Host); + } - private protected override void SaveModel(ModelSaveContext ctx) - { - Host.CheckValue(ctx, nameof(ctx)); - ctx.CheckAtModel(); - - Host.Assert(Enum.IsDefined(typeof(MartingaleType), Martingale)); - Host.Assert(Enum.IsDefined(typeof(AlertingScore), ThresholdScore)); - Host.Assert(Martingale != MartingaleType.None || ThresholdScore != AlertingScore.MartingaleScore); - Host.Assert(WindowSize > 0 || ThresholdScore == AlertingScore.RawScore); - Host.Assert(Enum.IsDefined(typeof(AnomalySide), Side)); - Host.Assert(0 < PowerMartingaleEpsilon && PowerMartingaleEpsilon < 1); - Host.Assert(AlertThreshold >= 0); - Host.Assert(ThresholdScore != AlertingScore.PValueScore || (0 <= AlertThreshold && AlertThreshold <= 1)); - - // *** Binary format *** - // - // byte: _martingale - // byte: _alertingScore - // byte: _anomalySide - // Double: _powerMartingaleEpsilon - // Double: _alertThreshold - - base.SaveModel(ctx); - ctx.Writer.Write((byte)Martingale); - ctx.Writer.Write((byte)ThresholdScore); - ctx.Writer.Write((byte)Side); - ctx.Writer.Write(PowerMartingaleEpsilon); - ctx.Writer.Write(AlertThreshold); - } + private protected override void SaveModel(ModelSaveContext ctx) + { + Host.CheckValue(ctx, nameof(ctx)); + ctx.CheckAtModel(); + + Host.Assert(Enum.IsDefined(typeof(MartingaleType), Martingale)); + Host.Assert(Enum.IsDefined(typeof(AlertingScore), ThresholdScore)); + Host.Assert(Martingale != MartingaleType.None || ThresholdScore != AlertingScore.MartingaleScore); + Host.Assert(WindowSize > 0 || ThresholdScore == AlertingScore.RawScore); + Host.Assert(Enum.IsDefined(typeof(AnomalySide), Side)); + Host.Assert(0 < PowerMartingaleEpsilon && PowerMartingaleEpsilon < 1); + Host.Assert(AlertThreshold >= 0); + Host.Assert(ThresholdScore != AlertingScore.PValueScore || (0 <= AlertThreshold && AlertThreshold <= 1)); + + // *** Binary format *** + // + // byte: _martingale + // byte: _alertingScore + // byte: _anomalySide + // Double: _powerMartingaleEpsilon + // Double: _alertThreshold + + base.SaveModel(ctx); + ctx.Writer.Write((byte)Martingale); + ctx.Writer.Write((byte)ThresholdScore); + ctx.Writer.Write((byte)Side); + ctx.Writer.Write(PowerMartingaleEpsilon); + ctx.Writer.Write(AlertThreshold); + } - /// - /// Calculates the betting function for the Power martingale in the log scale. - /// For more details, please refer to http://arxiv.org/pdf/1204.3251.pdf. - /// - /// The p-value - /// The epsilon - /// The Power martingale betting function value in the natural logarithmic scale. - internal Double LogPowerMartigaleBettingFunc(Double p, Double epsilon) - { - Host.Assert(MinPValue > 0); - Host.Assert(MaxPValue < 1); - Host.Assert(MinPValue <= p && p <= MaxPValue); - Host.Assert(0 < epsilon && epsilon < 1); + /// + /// Calculates the betting function for the Power martingale in the log scale. + /// For more details, please refer to http://arxiv.org/pdf/1204.3251.pdf. + /// + /// The p-value + /// The epsilon + /// The Power martingale betting function value in the natural logarithmic scale. + internal Double LogPowerMartigaleBettingFunc(Double p, Double epsilon) + { + Host.Assert(MinPValue > 0); + Host.Assert(MaxPValue < 1); + Host.Assert(MinPValue <= p && p <= MaxPValue); + Host.Assert(0 < epsilon && epsilon < 1); - return Math.Log(epsilon) + (epsilon - 1) * Math.Log(p); - } + return Math.Log(epsilon) + (epsilon - 1) * Math.Log(p); + } - /// - /// Calculates the betting function for the Mixture martingale in the log scale. - /// For more details, please refer to http://arxiv.org/pdf/1204.3251.pdf. - /// - /// The p-value - /// The Mixure (marginalized over epsilon) martingale betting function value in the natural logarithmic scale. - internal Double LogMixtureMartigaleBettingFunc(Double p) - { - Host.Assert(MinPValue > 0); - Host.Assert(MaxPValue < 1); - Host.Assert(MinPValue <= p && p <= MaxPValue); + /// + /// Calculates the betting function for the Mixture martingale in the log scale. + /// For more details, please refer to http://arxiv.org/pdf/1204.3251.pdf. + /// + /// The p-value + /// The Mixure (marginalized over epsilon) martingale betting function value in the natural logarithmic scale. + internal Double LogMixtureMartigaleBettingFunc(Double p) + { + Host.Assert(MinPValue > 0); + Host.Assert(MaxPValue < 1); + Host.Assert(MinPValue <= p && p <= MaxPValue); - Double logP = Math.Log(p); - return Math.Log(p * logP + 1 - p) - 2 * Math.Log(-logP) - logP; - } + Double logP = Math.Log(p); + return Math.Log(p * logP + 1 - p) - 2 * Math.Log(-logP) - logP; + } - internal override IStatefulRowMapper MakeRowMapper(DataViewSchema schema) => new Mapper(Host, this, schema); + internal override IStatefulRowMapper MakeRowMapper(DataViewSchema schema) => new Mapper(Host, this, schema); - internal sealed class Mapper : IStatefulRowMapper + internal sealed class Mapper : IStatefulRowMapper + { + private readonly IHost _host; + private readonly SequentialAnomalyDetectionTransformBase _parent; + private readonly DataViewSchema _parentSchema; + private readonly int _inputColumnIndex; + private readonly VBuffer> _slotNames; + private AnomalyDetectionStateBase State { get; set; } + + public Mapper(IHostEnvironment env, SequentialAnomalyDetectionTransformBase parent, DataViewSchema inputSchema) { - private readonly IHost _host; - private readonly SequentialAnomalyDetectionTransformBase _parent; - private readonly DataViewSchema _parentSchema; - private readonly int _inputColumnIndex; - private readonly VBuffer> _slotNames; - private AnomalyDetectionStateBase State { get; set; } - - public Mapper(IHostEnvironment env, SequentialAnomalyDetectionTransformBase parent, DataViewSchema inputSchema) - { - Contracts.CheckValue(env, nameof(env)); - _host = env.Register(nameof(Mapper)); - _host.CheckValue(inputSchema, nameof(inputSchema)); - _host.CheckValue(parent, nameof(parent)); + Contracts.CheckValue(env, nameof(env)); + _host = env.Register(nameof(Mapper)); + _host.CheckValue(inputSchema, nameof(inputSchema)); + _host.CheckValue(parent, nameof(parent)); - if (!inputSchema.TryGetColumnIndex(parent.InputColumnName, out _inputColumnIndex)) - throw _host.ExceptSchemaMismatch(nameof(inputSchema), "input", parent.InputColumnName); + if (!inputSchema.TryGetColumnIndex(parent.InputColumnName, out _inputColumnIndex)) + throw _host.ExceptSchemaMismatch(nameof(inputSchema), "input", parent.InputColumnName); - var colType = inputSchema[_inputColumnIndex].Type; - if (colType != NumberDataViewType.Single) - throw _host.ExceptSchemaMismatch(nameof(inputSchema), "input", parent.InputColumnName, "float", colType.ToString()); + var colType = inputSchema[_inputColumnIndex].Type; + if (colType != NumberDataViewType.Single) + throw _host.ExceptSchemaMismatch(nameof(inputSchema), "input", parent.InputColumnName, "float", colType.ToString()); - _parent = parent; - _parentSchema = inputSchema; - _slotNames = new VBuffer>(4, new[] { "Alert".AsMemory(), "Raw Score".AsMemory(), + _parent = parent; + _parentSchema = inputSchema; + _slotNames = new VBuffer>(4, new[] { "Alert".AsMemory(), "Raw Score".AsMemory(), "P-Value Score".AsMemory(), "Martingale Score".AsMemory() }); - State = (AnomalyDetectionStateBase)_parent.StateRef; - } + State = (AnomalyDetectionStateBase)_parent.StateRef; + } - public DataViewSchema.DetachedColumn[] GetOutputColumns() - { - var meta = new DataViewSchema.Annotations.Builder(); - meta.AddSlotNames(_parent.OutputLength, GetSlotNames); - var info = new DataViewSchema.DetachedColumn[1]; - info[0] = new DataViewSchema.DetachedColumn(_parent.OutputColumnName, new VectorType(NumberDataViewType.Double, _parent.OutputLength), meta.ToAnnotations()); - return info; - } + public DataViewSchema.DetachedColumn[] GetOutputColumns() + { + var meta = new DataViewSchema.Annotations.Builder(); + meta.AddSlotNames(_parent.OutputLength, GetSlotNames); + var info = new DataViewSchema.DetachedColumn[1]; + info[0] = new DataViewSchema.DetachedColumn(_parent.OutputColumnName, new VectorType(NumberDataViewType.Double, _parent.OutputLength), meta.ToAnnotations()); + return info; + } - public void GetSlotNames(ref VBuffer> dst) => _slotNames.CopyTo(ref dst, 0, _parent.OutputLength); + public void GetSlotNames(ref VBuffer> dst) => _slotNames.CopyTo(ref dst, 0, _parent.OutputLength); - public Func GetDependencies(Func activeOutput) - { - if (activeOutput(0)) - return col => col == _inputColumnIndex; - else - return col => false; - } + public Func GetDependencies(Func activeOutput) + { + if (activeOutput(0)) + return col => col == _inputColumnIndex; + else + return col => false; + } - void ICanSaveModel.Save(ModelSaveContext ctx) => _parent.SaveModel(ctx); + void ICanSaveModel.Save(ModelSaveContext ctx) => _parent.SaveModel(ctx); - public Delegate[] CreateGetters(DataViewRow input, Func activeOutput, out Action disposer) - { - disposer = null; - var getters = new Delegate[1]; - if (activeOutput(0)) - getters[0] = MakeGetter(input, State); + public Delegate[] CreateGetters(DataViewRow input, Func activeOutput, out Action disposer) + { + disposer = null; + var getters = new Delegate[1]; + if (activeOutput(0)) + getters[0] = MakeGetter(input, State); - return getters; - } + return getters; + } - private delegate void ProcessData(ref TInput src, ref VBuffer dst); + private delegate void ProcessData(ref TInput src, ref VBuffer dst); private Delegate MakeGetter(DataViewRow input, AnomalyDetectionStateBase state) { @@ -369,24 +369,24 @@ private Delegate MakeGetter(DataViewRow input, AnomalyDetectionStateBase state) ProcessData processData = _parent.WindowSize > 0 ? (ProcessData)state.Process : state.ProcessWithoutBuffer; - ValueGetter> valueGetter = (ref VBuffer dst) => - { - TInput src = default; - srcGetter(ref src); - processData(ref src, ref dst); - }; - return valueGetter; - } - - public Action CreatePinger(DataViewRow input, Func activeOutput, out Action disposer) + ValueGetter> valueGetter = (ref VBuffer dst) => { - disposer = null; - Action pinger = null; - if (activeOutput(0)) - pinger = MakePinger(input, State); + TInput src = default; + srcGetter(ref src); + processData(ref src, ref dst); + }; + return valueGetter; + } - return pinger; - } + public Action CreatePinger(DataViewRow input, Func activeOutput, out Action disposer) + { + disposer = null; + Action pinger = null; + if (activeOutput(0)) + pinger = MakePinger(input, State); + + return pinger; + } private Action MakePinger(DataViewRow input, AnomalyDetectionStateBase state) { @@ -401,289 +401,289 @@ private Action MakePinger(DataViewRow input, AnomalyDetectionStateBase sta return pinger; } - public void CloneState() - { - if (Interlocked.Increment(ref _parent.StateRefCount) > 1) - { - State = (AnomalyDetectionStateBase)_parent.StateRef.Clone(); - } - } - - public ITransformer GetTransformer() + public void CloneState() + { + if (Interlocked.Increment(ref _parent.StateRefCount) > 1) { - return _parent; + State = (AnomalyDetectionStateBase)_parent.StateRef.Clone(); } } - /// - /// The base state class for sequential anomaly detection: this class implements the p-values and martinagle calculations for anomaly detection - /// given that the raw anomaly score calculation is specified by the derived classes. - /// - internal abstract class AnomalyDetectionStateBase : SequentialTransformerBase, TState>.StateBase + + public ITransformer GetTransformer() { - // A reference to the parent transform. - protected SequentialAnomalyDetectionTransformBase Parent; + return _parent; + } + } + /// + /// The base state class for sequential anomaly detection: this class implements the p-values and martinagle calculations for anomaly detection + /// given that the raw anomaly score calculation is specified by the derived classes. + /// + internal abstract class AnomalyDetectionStateBase : SequentialTransformerBase, TState>.StateBase + { + // A reference to the parent transform. + protected SequentialAnomalyDetectionTransformBase Parent; - // A windowed buffer to cache the update values to the martingale score in the log scale. - private FixedSizeQueue LogMartingaleUpdateBuffer { get; set; } + // A windowed buffer to cache the update values to the martingale score in the log scale. + private FixedSizeQueue LogMartingaleUpdateBuffer { get; set; } - // A windowed buffer to cache the raw anomaly scores for p-value calculation. - private FixedSizeQueue RawScoreBuffer { get; set; } + // A windowed buffer to cache the raw anomaly scores for p-value calculation. + private FixedSizeQueue RawScoreBuffer { get; set; } - // The current martingale score in the log scale. - private Double _logMartingaleValue; + // The current martingale score in the log scale. + private Double _logMartingaleValue; - // Sum of the squared Euclidean distances among the raw socres in the buffer. - // Used for computing the optimal bandwidth for Kernel Density Estimation of p-values. - private Double _sumSquaredDist; + // Sum of the squared Euclidean distances among the raw socres in the buffer. + // Used for computing the optimal bandwidth for Kernel Density Estimation of p-values. + private Double _sumSquaredDist; - private int _martingaleAlertCounter; + private int _martingaleAlertCounter; - protected Double LatestMartingaleScore => Math.Exp(_logMartingaleValue); + protected Double LatestMartingaleScore => Math.Exp(_logMartingaleValue); - private protected AnomalyDetectionStateBase() { } + private protected AnomalyDetectionStateBase() { } - private protected override void CloneCore(TState state) - { - base.CloneCore(state); - Contracts.Assert(state is AnomalyDetectionStateBase); - var stateLocal = state as AnomalyDetectionStateBase; - stateLocal.LogMartingaleUpdateBuffer = LogMartingaleUpdateBuffer.Clone(); - stateLocal.RawScoreBuffer = RawScoreBuffer.Clone(); - } + private protected override void CloneCore(TState state) + { + base.CloneCore(state); + Contracts.Assert(state is AnomalyDetectionStateBase); + var stateLocal = state as AnomalyDetectionStateBase; + stateLocal.LogMartingaleUpdateBuffer = LogMartingaleUpdateBuffer.Clone(); + stateLocal.RawScoreBuffer = RawScoreBuffer.Clone(); + } - private protected AnomalyDetectionStateBase(BinaryReader reader) : base(reader) - { - LogMartingaleUpdateBuffer = TimeSeriesUtils.DeserializeFixedSizeQueueDouble(reader, Host); - RawScoreBuffer = TimeSeriesUtils.DeserializeFixedSizeQueueSingle(reader, Host); - _logMartingaleValue = reader.ReadDouble(); - _sumSquaredDist = reader.ReadDouble(); - _martingaleAlertCounter = reader.ReadInt32(); - } + private protected AnomalyDetectionStateBase(BinaryReader reader) : base(reader) + { + LogMartingaleUpdateBuffer = TimeSeriesUtils.DeserializeFixedSizeQueueDouble(reader, Host); + RawScoreBuffer = TimeSeriesUtils.DeserializeFixedSizeQueueSingle(reader, Host); + _logMartingaleValue = reader.ReadDouble(); + _sumSquaredDist = reader.ReadDouble(); + _martingaleAlertCounter = reader.ReadInt32(); + } - internal override void Save(BinaryWriter writer) - { - base.Save(writer); - TimeSeriesUtils.SerializeFixedSizeQueue(LogMartingaleUpdateBuffer, writer); - TimeSeriesUtils.SerializeFixedSizeQueue(RawScoreBuffer, writer); - writer.Write(_logMartingaleValue); - writer.Write(_sumSquaredDist); - writer.Write(_martingaleAlertCounter); - } + internal override void Save(BinaryWriter writer) + { + base.Save(writer); + TimeSeriesUtils.SerializeFixedSizeQueue(LogMartingaleUpdateBuffer, writer); + TimeSeriesUtils.SerializeFixedSizeQueue(RawScoreBuffer, writer); + writer.Write(_logMartingaleValue); + writer.Write(_sumSquaredDist); + writer.Write(_martingaleAlertCounter); + } - private Double ComputeKernelPValue(Double rawScore) - { - int i; - int n = RawScoreBuffer.Count; + private Double ComputeKernelPValue(Double rawScore) + { + int i; + int n = RawScoreBuffer.Count; - if (n == 0) - return 0.5; + if (n == 0) + return 0.5; - Double pValue = 0; - Double bandWidth = Math.Sqrt(2) * ((n == 1) ? 1 : Math.Sqrt(_sumSquaredDist) / n); - bandWidth = Math.Max(bandWidth, 1e-6); + Double pValue = 0; + Double bandWidth = Math.Sqrt(2) * ((n == 1) ? 1 : Math.Sqrt(_sumSquaredDist) / n); + bandWidth = Math.Max(bandWidth, 1e-6); - Double diff; - for (i = 0; i < n; ++i) - { - diff = rawScore - RawScoreBuffer[i]; - pValue -= ProbabilityFunctions.Erf(diff / bandWidth); - _sumSquaredDist += diff * diff; - } + Double diff; + for (i = 0; i < n; ++i) + { + diff = rawScore - RawScoreBuffer[i]; + pValue -= ProbabilityFunctions.Erf(diff / bandWidth); + _sumSquaredDist += diff * diff; + } - pValue = 0.5 + pValue / (2 * n); - if (RawScoreBuffer.IsFull) + pValue = 0.5 + pValue / (2 * n); + if (RawScoreBuffer.IsFull) + { + for (i = 1; i < n; ++i) { - for (i = 1; i < n; ++i) - { - diff = RawScoreBuffer[0] - RawScoreBuffer[i]; - _sumSquaredDist -= diff * diff; - } - - diff = RawScoreBuffer[0] - rawScore; + diff = RawScoreBuffer[0] - RawScoreBuffer[i]; _sumSquaredDist -= diff * diff; } - return pValue; + diff = RawScoreBuffer[0] - rawScore; + _sumSquaredDist -= diff * diff; } - private protected override void SetNaOutput(ref VBuffer dst) - { - var outputLength = Parent.OutputLength; - var editor = VBufferEditor.Create(ref dst, outputLength); + return pValue; + } - for (int i = 0; i < outputLength; ++i) - editor.Values[i] = Double.NaN; + private protected override void SetNaOutput(ref VBuffer dst) + { + var outputLength = Parent.OutputLength; + var editor = VBufferEditor.Create(ref dst, outputLength); - dst = editor.Commit(); - } + for (int i = 0; i < outputLength; ++i) + editor.Values[i] = Double.NaN; - private protected override sealed void TransformCore(ref TInput input, FixedSizeQueue windowedBuffer, long iteration, ref VBuffer dst) - { - var outputLength = Parent.OutputLength; - Host.Assert(outputLength >= 2); + dst = editor.Commit(); + } - var result = VBufferEditor.Create(ref dst, outputLength); - float rawScore = 0; + private protected sealed override void TransformCore(ref TInput input, FixedSizeQueue windowedBuffer, long iteration, ref VBuffer dst) + { + var outputLength = Parent.OutputLength; + Host.Assert(outputLength >= 2); - for (int i = 0; i < outputLength; ++i) - result.Values[i] = Double.NaN; + var result = VBufferEditor.Create(ref dst, outputLength); + float rawScore = 0; - // Step 1: Computing the raw anomaly score - result.Values[1] = ComputeRawAnomalyScore(ref input, windowedBuffer, iteration); + for (int i = 0; i < outputLength; ++i) + result.Values[i] = Double.NaN; - if (Double.IsNaN(result.Values[1])) - result.Values[0] = 0; - else + // Step 1: Computing the raw anomaly score + result.Values[1] = ComputeRawAnomalyScore(ref input, windowedBuffer, iteration); + + if (Double.IsNaN(result.Values[1])) + result.Values[0] = 0; + else + { + if (WindowSize > 0) { - if (WindowSize > 0) + // Step 2: Computing the p-value score + rawScore = (float)result.Values[1]; + if (Parent.ThresholdScore == AlertingScore.RawScore) { - // Step 2: Computing the p-value score - rawScore = (float)result.Values[1]; - if (Parent.ThresholdScore == AlertingScore.RawScore) + switch (Parent.Side) { - switch (Parent.Side) - { - case AnomalySide.Negative: - rawScore = (float)(-result.Values[1]); - break; + case AnomalySide.Negative: + rawScore = (float)(-result.Values[1]); + break; - case AnomalySide.Positive: - break; + case AnomalySide.Positive: + break; - default: - rawScore = (float)Math.Abs(result.Values[1]); - break; - } + default: + rawScore = (float)Math.Abs(result.Values[1]); + break; } - else + } + else + { + result.Values[2] = ComputeKernelPValue(rawScore); + + switch (Parent.Side) { - result.Values[2] = ComputeKernelPValue(rawScore); + case AnomalySide.Negative: + result.Values[2] = 1 - result.Values[2]; + break; - switch (Parent.Side) - { - case AnomalySide.Negative: - result.Values[2] = 1 - result.Values[2]; - break; + case AnomalySide.Positive: + break; + + default: + result.Values[2] = Math.Min(result.Values[2], 1 - result.Values[2]); + break; + } + + // Keeping the p-value in the safe range + if (result.Values[2] < SequentialAnomalyDetectionTransformBase.MinPValue) + result.Values[2] = SequentialAnomalyDetectionTransformBase.MinPValue; + else if (result.Values[2] > SequentialAnomalyDetectionTransformBase.MaxPValue) + result.Values[2] = SequentialAnomalyDetectionTransformBase.MaxPValue; - case AnomalySide.Positive: + RawScoreBuffer.AddLast(rawScore); + + // Step 3: Computing the martingale value + if (Parent.Martingale != MartingaleType.None && Parent.ThresholdScore == AlertingScore.MartingaleScore) + { + Double martingaleUpdate = 0; + switch (Parent.Martingale) + { + case MartingaleType.Power: + martingaleUpdate = Parent.LogPowerMartigaleBettingFunc(result.Values[2], Parent.PowerMartingaleEpsilon); break; - default: - result.Values[2] = Math.Min(result.Values[2], 1 - result.Values[2]); + case MartingaleType.Mixture: + martingaleUpdate = Parent.LogMixtureMartigaleBettingFunc(result.Values[2]); break; } - // Keeping the p-value in the safe range - if (result.Values[2] < SequentialAnomalyDetectionTransformBase.MinPValue) - result.Values[2] = SequentialAnomalyDetectionTransformBase.MinPValue; - else if (result.Values[2] > SequentialAnomalyDetectionTransformBase.MaxPValue) - result.Values[2] = SequentialAnomalyDetectionTransformBase.MaxPValue; - - RawScoreBuffer.AddLast(rawScore); - - // Step 3: Computing the martingale value - if (Parent.Martingale != MartingaleType.None && Parent.ThresholdScore == AlertingScore.MartingaleScore) + if (LogMartingaleUpdateBuffer.Count == 0) { - Double martingaleUpdate = 0; - switch (Parent.Martingale) - { - case MartingaleType.Power: - martingaleUpdate = Parent.LogPowerMartigaleBettingFunc(result.Values[2], Parent.PowerMartingaleEpsilon); - break; - - case MartingaleType.Mixture: - martingaleUpdate = Parent.LogMixtureMartigaleBettingFunc(result.Values[2]); - break; - } - - if (LogMartingaleUpdateBuffer.Count == 0) - { - for (int i = 0; i < LogMartingaleUpdateBuffer.Capacity; ++i) - LogMartingaleUpdateBuffer.AddLast(martingaleUpdate); - _logMartingaleValue += LogMartingaleUpdateBuffer.Capacity * martingaleUpdate; - } - else - { - _logMartingaleValue += martingaleUpdate; - _logMartingaleValue -= LogMartingaleUpdateBuffer.PeekFirst(); + for (int i = 0; i < LogMartingaleUpdateBuffer.Capacity; ++i) LogMartingaleUpdateBuffer.AddLast(martingaleUpdate); - } - - result.Values[3] = Math.Exp(_logMartingaleValue); + _logMartingaleValue += LogMartingaleUpdateBuffer.Capacity * martingaleUpdate; + } + else + { + _logMartingaleValue += martingaleUpdate; + _logMartingaleValue -= LogMartingaleUpdateBuffer.PeekFirst(); + LogMartingaleUpdateBuffer.AddLast(martingaleUpdate); } + + result.Values[3] = Math.Exp(_logMartingaleValue); } } + } - // Generating alert - bool alert = false; + // Generating alert + bool alert = false; - if (RawScoreBuffer.IsFull) // No alert until the buffer is completely full. + if (RawScoreBuffer.IsFull) // No alert until the buffer is completely full. + { + switch (Parent.ThresholdScore) { - switch (Parent.ThresholdScore) - { - case AlertingScore.RawScore: - alert = rawScore >= Parent.AlertThreshold; - break; - case AlertingScore.PValueScore: - alert = result.Values[2] <= Parent.AlertThreshold; - break; - case AlertingScore.MartingaleScore: - alert = (Parent.Martingale != MartingaleType.None) && (result.Values[3] >= Parent.AlertThreshold); - - if (alert) - { - if (_martingaleAlertCounter > 0) - alert = false; - else - _martingaleAlertCounter = Parent.WindowSize; - } - - _martingaleAlertCounter--; - _martingaleAlertCounter = _martingaleAlertCounter < 0 ? 0 : _martingaleAlertCounter; - break; - } - } + case AlertingScore.RawScore: + alert = rawScore >= Parent.AlertThreshold; + break; + case AlertingScore.PValueScore: + alert = result.Values[2] <= Parent.AlertThreshold; + break; + case AlertingScore.MartingaleScore: + alert = (Parent.Martingale != MartingaleType.None) && (result.Values[3] >= Parent.AlertThreshold); + + if (alert) + { + if (_martingaleAlertCounter > 0) + alert = false; + else + _martingaleAlertCounter = Parent.WindowSize; + } - result.Values[0] = Convert.ToDouble(alert); + _martingaleAlertCounter--; + _martingaleAlertCounter = _martingaleAlertCounter < 0 ? 0 : _martingaleAlertCounter; + break; + } } - dst = result.Commit(); + result.Values[0] = Convert.ToDouble(alert); } - private protected override sealed void InitializeStateCore(bool disk = false) - { - Parent = (SequentialAnomalyDetectionTransformBase)ParentTransform; - Host.Assert(WindowSize >= 0); + dst = result.Commit(); + } - if (disk == false) - { - if (Parent.Martingale != MartingaleType.None) - LogMartingaleUpdateBuffer = new FixedSizeQueue(WindowSize == 0 ? 1 : WindowSize); - else - LogMartingaleUpdateBuffer = new FixedSizeQueue(1); + private protected sealed override void InitializeStateCore(bool disk = false) + { + Parent = (SequentialAnomalyDetectionTransformBase)ParentTransform; + Host.Assert(WindowSize >= 0); - RawScoreBuffer = new FixedSizeQueue(WindowSize == 0 ? 1 : WindowSize); + if (disk == false) + { + if (Parent.Martingale != MartingaleType.None) + LogMartingaleUpdateBuffer = new FixedSizeQueue(WindowSize == 0 ? 1 : WindowSize); + else + LogMartingaleUpdateBuffer = new FixedSizeQueue(1); - _logMartingaleValue = 0; - } + RawScoreBuffer = new FixedSizeQueue(WindowSize == 0 ? 1 : WindowSize); - InitializeAnomalyDetector(); + _logMartingaleValue = 0; } - /// - /// The abstract method that realizes the initialization functionality for the anomaly detector. - /// - private protected abstract void InitializeAnomalyDetector(); - - /// - /// The abstract method that realizes the main logic for calculating the raw anomaly score bfor the current input given a windowed buffer - /// - /// A reference to the input object. - /// A reference to the windowed buffer. - /// A long number that indicates the number of times ComputeRawAnomalyScore has been called so far (starting value = 0). - /// The raw anomaly score for the input. The Assumption is the higher absolute value of the raw score, the more anomalous the input is. - /// The sign of the score determines whether it's a positive anomaly or a negative one. - private protected abstract Double ComputeRawAnomalyScore(ref TInput input, FixedSizeQueue windowedBuffer, long iteration); + InitializeAnomalyDetector(); } + + /// + /// The abstract method that realizes the initialization functionality for the anomaly detector. + /// + private protected abstract void InitializeAnomalyDetector(); + + /// + /// The abstract method that realizes the main logic for calculating the raw anomaly score bfor the current input given a windowed buffer + /// + /// A reference to the input object. + /// A reference to the windowed buffer. + /// A long number that indicates the number of times ComputeRawAnomalyScore has been called so far (starting value = 0). + /// The raw anomaly score for the input. The Assumption is the higher absolute value of the raw score, the more anomalous the input is. + /// The sign of the score determines whether it's a positive anomaly or a negative one. + private protected abstract Double ComputeRawAnomalyScore(ref TInput input, FixedSizeQueue windowedBuffer, long iteration); } + } } diff --git a/src/Microsoft.ML.TimeSeries/SequentialTransformBase.cs b/src/Microsoft.ML.TimeSeries/SequentialTransformBase.cs index 272ceb90a7..146f0bc50e 100644 --- a/src/Microsoft.ML.TimeSeries/SequentialTransformBase.cs +++ b/src/Microsoft.ML.TimeSeries/SequentialTransformBase.cs @@ -8,8 +8,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; -using Microsoft.ML.Transforms; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms.TimeSeries { diff --git a/src/Microsoft.ML.TimeSeries/SequentialTransformerBase.cs b/src/Microsoft.ML.TimeSeries/SequentialTransformerBase.cs index 690738dd9f..2d30aad040 100644 --- a/src/Microsoft.ML.TimeSeries/SequentialTransformerBase.cs +++ b/src/Microsoft.ML.TimeSeries/SequentialTransformerBase.cs @@ -10,9 +10,9 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms.TimeSeries { @@ -749,7 +749,7 @@ protected override DataViewRowCursor GetRowCursorCore(IEnumerable columnsNeeded, int n, Random rand = null) { - Host.CheckValueOrNull(rand); + Host.CheckValueOrNull(rand); Func predicateInput; var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema); diff --git a/src/Microsoft.ML.TimeSeries/SlidingWindowTransform.cs b/src/Microsoft.ML.TimeSeries/SlidingWindowTransform.cs index 103d63f0fa..75302f02a9 100644 --- a/src/Microsoft.ML.TimeSeries/SlidingWindowTransform.cs +++ b/src/Microsoft.ML.TimeSeries/SlidingWindowTransform.cs @@ -6,7 +6,7 @@ using Microsoft.Data.DataView; using Microsoft.ML; using Microsoft.ML.Data; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.TimeSeries; [assembly: LoadableClass(SlidingWindowTransform.Summary, typeof(SlidingWindowTransform), typeof(SlidingWindowTransform.Arguments), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.TimeSeries/SlidingWindowTransformBase.cs b/src/Microsoft.ML.TimeSeries/SlidingWindowTransformBase.cs index 78e2e38215..32e9aea67d 100644 --- a/src/Microsoft.ML.TimeSeries/SlidingWindowTransformBase.cs +++ b/src/Microsoft.ML.TimeSeries/SlidingWindowTransformBase.cs @@ -6,9 +6,8 @@ using Microsoft.Data.DataView; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms.TimeSeries { @@ -79,8 +78,8 @@ protected SlidingWindowTransformBase(Arguments args, string loaderSignature, IHo _nanValue = GetNaValue(); } - protected SlidingWindowTransformBase(IHostEnvironment env, ModelLoadContext ctx, string loaderSignature, IDataView input) - : base(env, ctx, loaderSignature, input) + protected SlidingWindowTransformBase(IHostEnvironment env, ModelLoadContext ctx, string loaderSignature, IDataView input) + : base(env, ctx, loaderSignature, input) { // *** Binary format *** // @@ -139,13 +138,13 @@ private protected override void SetNaOutput(ref VBuffer output) TInput value = _parentSliding._nanValue; switch (_parentSliding._begin) { - case BeginOptions.NaNValues: - value = _parentSliding._nanValue; - break; - case BeginOptions.FirstValue: - // REVIEW: will complete the implementation - // if the design looks good - throw new NotImplementedException(); + case BeginOptions.NaNValues: + value = _parentSliding._nanValue; + break; + case BeginOptions.FirstValue: + // REVIEW: will complete the implementation + // if the design looks good + throw new NotImplementedException(); } for (int i = 0; i < size; ++i) diff --git a/src/Microsoft.ML.TimeSeries/SsaAnomalyDetectionBase.cs b/src/Microsoft.ML.TimeSeries/SsaAnomalyDetectionBase.cs index 704002298d..2cb9ea437f 100644 --- a/src/Microsoft.ML.TimeSeries/SsaAnomalyDetectionBase.cs +++ b/src/Microsoft.ML.TimeSeries/SsaAnomalyDetectionBase.cs @@ -8,7 +8,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms.TimeSeries { @@ -59,23 +59,23 @@ public static Func GetErrorFunction(ErrorFunction errorF { switch (errorFunction) { - case ErrorFunction.SignedDifference: - return SignedDifference; + case ErrorFunction.SignedDifference: + return SignedDifference; - case ErrorFunction.AbsoluteDifference: - return AbsoluteDifference; + case ErrorFunction.AbsoluteDifference: + return AbsoluteDifference; - case ErrorFunction.SignedProportion: - return SignedProportion; + case ErrorFunction.SignedProportion: + return SignedProportion; - case ErrorFunction.AbsoluteProportion: - return AbsoluteProportion; + case ErrorFunction.AbsoluteProportion: + return AbsoluteProportion; - case ErrorFunction.SquaredDifference: - return SquaredDifference; + case ErrorFunction.SquaredDifference: + return SquaredDifference; - default: - throw Contracts.Except(ErrorFunctionHelpText); + default: + throw Contracts.Except(ErrorFunctionHelpText); } } } diff --git a/src/Microsoft.ML.TimeSeries/SsaChangePointDetector.cs b/src/Microsoft.ML.TimeSeries/SsaChangePointDetector.cs index e0b27590c8..0183a66d6a 100644 --- a/src/Microsoft.ML.TimeSeries/SsaChangePointDetector.cs +++ b/src/Microsoft.ML.TimeSeries/SsaChangePointDetector.cs @@ -9,8 +9,7 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.TimeSeries; [assembly: LoadableClass(SsaChangePointDetector.Summary, typeof(IDataTransform), typeof(SsaChangePointDetector), typeof(SsaChangePointDetector.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.TimeSeries/SsaSpikeDetector.cs b/src/Microsoft.ML.TimeSeries/SsaSpikeDetector.cs index 4ccfc8467a..7926d895ef 100644 --- a/src/Microsoft.ML.TimeSeries/SsaSpikeDetector.cs +++ b/src/Microsoft.ML.TimeSeries/SsaSpikeDetector.cs @@ -8,8 +8,7 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.TimeSeries; [assembly: LoadableClass(SsaSpikeDetector.Summary, typeof(IDataTransform), typeof(SsaSpikeDetector), typeof(SsaSpikeDetector.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.TimeSeries/TimeSeriesProcessing.cs b/src/Microsoft.ML.TimeSeries/TimeSeriesProcessing.cs index e128a4730c..a7dd59cfc9 100644 --- a/src/Microsoft.ML.TimeSeries/TimeSeriesProcessing.cs +++ b/src/Microsoft.ML.TimeSeries/TimeSeriesProcessing.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.TimeSeries; [assembly: EntryPointModule(typeof(TimeSeriesProcessingEntryPoints))] diff --git a/src/Microsoft.ML.TimeSeries/TimeSeriesUtils.cs b/src/Microsoft.ML.TimeSeries/TimeSeriesUtils.cs index e8eb79f1ba..e2202f4700 100644 --- a/src/Microsoft.ML.TimeSeries/TimeSeriesUtils.cs +++ b/src/Microsoft.ML.TimeSeries/TimeSeriesUtils.cs @@ -1,6 +1,7 @@ using System; using System.IO; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms.TimeSeries { diff --git a/src/Microsoft.ML.TimeSeries/TrajectoryMatrix.cs b/src/Microsoft.ML.TimeSeries/TrajectoryMatrix.cs index 2ea67dae96..62d81cf6ec 100644 --- a/src/Microsoft.ML.TimeSeries/TrajectoryMatrix.cs +++ b/src/Microsoft.ML.TimeSeries/TrajectoryMatrix.cs @@ -4,6 +4,7 @@ using System; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms.TimeSeries { diff --git a/src/Microsoft.ML.Transforms/CompositeTransformer.cs b/src/Microsoft.ML.Transforms/CompositeTransformer.cs index 3d822fa76c..74e1a1f770 100644 --- a/src/Microsoft.ML.Transforms/CompositeTransformer.cs +++ b/src/Microsoft.ML.Transforms/CompositeTransformer.cs @@ -5,7 +5,7 @@ using Microsoft.Data.DataView; using Microsoft.ML; using Microsoft.ML.Data; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; // REVIEW: This is a temporary hack code to allow loading old saved loader models. Delete it once it is no longer needed. diff --git a/src/Microsoft.ML.Transforms/CountFeatureSelection.cs b/src/Microsoft.ML.Transforms/CountFeatureSelection.cs index 83f39642a5..24b49cad88 100644 --- a/src/Microsoft.ML.Transforms/CountFeatureSelection.cs +++ b/src/Microsoft.ML.Transforms/CountFeatureSelection.cs @@ -11,6 +11,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.FeatureSelection; [assembly: LoadableClass(CountFeatureSelectingEstimator.Summary, typeof(IDataTransform), typeof(CountFeatureSelectingEstimator), typeof(CountFeatureSelectingEstimator.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/CustomMappingFactory.cs b/src/Microsoft.ML.Transforms/CustomMappingFactory.cs index f1778f72f7..47c0b56de3 100644 --- a/src/Microsoft.ML.Transforms/CustomMappingFactory.cs +++ b/src/Microsoft.ML.Transforms/CustomMappingFactory.cs @@ -4,7 +4,7 @@ using System; using Microsoft.Data.DataView; - +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms { /// diff --git a/src/Microsoft.ML.Transforms/CustomMappingTransformer.cs b/src/Microsoft.ML.Transforms/CustomMappingTransformer.cs index d598e2f51a..74ae7a8bb8 100644 --- a/src/Microsoft.ML.Transforms/CustomMappingTransformer.cs +++ b/src/Microsoft.ML.Transforms/CustomMappingTransformer.cs @@ -7,7 +7,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms { diff --git a/src/Microsoft.ML.Transforms/EntryPoints/SelectFeatures.cs b/src/Microsoft.ML.Transforms/EntryPoints/SelectFeatures.cs index 7ca6a4b4fe..1ec20f366a 100644 --- a/src/Microsoft.ML.Transforms/EntryPoints/SelectFeatures.cs +++ b/src/Microsoft.ML.Transforms/EntryPoints/SelectFeatures.cs @@ -4,6 +4,7 @@ using Microsoft.ML; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; using Microsoft.ML.Transforms.FeatureSelection; diff --git a/src/Microsoft.ML.Transforms/EntryPoints/TextAnalytics.cs b/src/Microsoft.ML.Transforms/EntryPoints/TextAnalytics.cs index daacdcfab7..caabe64172 100644 --- a/src/Microsoft.ML.Transforms/EntryPoints/TextAnalytics.cs +++ b/src/Microsoft.ML.Transforms/EntryPoints/TextAnalytics.cs @@ -5,6 +5,7 @@ using System.Linq; using Microsoft.ML; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.Text; [assembly: LoadableClass(typeof(void), typeof(TextAnalytics), null, typeof(SignatureEntryPointModule), "TextAnalytics")] diff --git a/src/Microsoft.ML.Transforms/FourierDistributionSampler.cs b/src/Microsoft.ML.Transforms/FourierDistributionSampler.cs index d74fa407de..453371c0ff 100644 --- a/src/Microsoft.ML.Transforms/FourierDistributionSampler.cs +++ b/src/Microsoft.ML.Transforms/FourierDistributionSampler.cs @@ -8,6 +8,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Numeric; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(typeof(GaussianKernel), typeof(GaussianKernel.Options), typeof(SignatureKernelBase), diff --git a/src/Microsoft.ML.Transforms/GcnTransform.cs b/src/Microsoft.ML.Transforms/GcnTransform.cs index 19e5ce0497..b6845419bd 100644 --- a/src/Microsoft.ML.Transforms/GcnTransform.cs +++ b/src/Microsoft.ML.Transforms/GcnTransform.cs @@ -13,6 +13,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.CpuMath; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(LpNormalizingTransformer.GcnSummary, typeof(IDataTransform), typeof(LpNormalizingTransformer), typeof(LpNormalizingTransformer.GcnOptions), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/GroupTransform.cs b/src/Microsoft.ML.Transforms/GroupTransform.cs index 8450c70b13..a7cd1c795a 100644 --- a/src/Microsoft.ML.Transforms/GroupTransform.cs +++ b/src/Microsoft.ML.Transforms/GroupTransform.cs @@ -12,7 +12,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(GroupTransform.Summary, typeof(GroupTransform), typeof(GroupTransform.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/HashJoiningTransform.cs b/src/Microsoft.ML.Transforms/HashJoiningTransform.cs index bfaa28f3bf..f2dc7b7154 100644 --- a/src/Microsoft.ML.Transforms/HashJoiningTransform.cs +++ b/src/Microsoft.ML.Transforms/HashJoiningTransform.cs @@ -13,6 +13,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(HashJoiningTransform.Summary, typeof(HashJoiningTransform), typeof(HashJoiningTransform.Arguments), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/KeyToVectorMapping.cs b/src/Microsoft.ML.Transforms/KeyToVectorMapping.cs index 68fa84e590..9606753937 100644 --- a/src/Microsoft.ML.Transforms/KeyToVectorMapping.cs +++ b/src/Microsoft.ML.Transforms/KeyToVectorMapping.cs @@ -11,6 +11,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(KeyToBinaryVectorMappingTransformer.Summary, typeof(IDataTransform), typeof(KeyToBinaryVectorMappingTransformer), typeof(KeyToBinaryVectorMappingTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/LambdaTransform.cs b/src/Microsoft.ML.Transforms/LambdaTransform.cs index 6950d9f46a..25bb57abf6 100644 --- a/src/Microsoft.ML.Transforms/LambdaTransform.cs +++ b/src/Microsoft.ML.Transforms/LambdaTransform.cs @@ -9,7 +9,7 @@ using Microsoft.ML; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(typeof(ITransformer), typeof(LambdaTransform), null, typeof(SignatureLoadModel), "", LambdaTransform.LoaderSignature)] diff --git a/src/Microsoft.ML.Transforms/LearnerFeatureSelection.cs b/src/Microsoft.ML.Transforms/LearnerFeatureSelection.cs index 96f52e3252..1bcea554d6 100644 --- a/src/Microsoft.ML.Transforms/LearnerFeatureSelection.cs +++ b/src/Microsoft.ML.Transforms/LearnerFeatureSelection.cs @@ -10,8 +10,8 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; -using Microsoft.ML.Transforms.FeatureSelection; [assembly: LoadableClass(LearnerFeatureSelectionTransform.Summary, typeof(IDataTransform), typeof(LearnerFeatureSelectionTransform), typeof(LearnerFeatureSelectionTransform.Options), typeof(SignatureDataTransform), "Learner Feature Selection Transform", "LearnerFeatureSelectionTransform", "LearnerFeatureSelection")] diff --git a/src/Microsoft.ML.Transforms/LoadTransform.cs b/src/Microsoft.ML.Transforms/LoadTransform.cs index 11d346dc7f..9d4eccadf1 100644 --- a/src/Microsoft.ML.Transforms/LoadTransform.cs +++ b/src/Microsoft.ML.Transforms/LoadTransform.cs @@ -11,6 +11,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(LoadTransform.Summary, typeof(IDataTransform), typeof(LoadTransform), typeof(LoadTransform.Arguments), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/MissingValueDroppingTransformer.cs b/src/Microsoft.ML.Transforms/MissingValueDroppingTransformer.cs index 17f315e5b5..87064ab093 100644 --- a/src/Microsoft.ML.Transforms/MissingValueDroppingTransformer.cs +++ b/src/Microsoft.ML.Transforms/MissingValueDroppingTransformer.cs @@ -11,9 +11,8 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(MissingValueDroppingTransformer.Summary, typeof(IDataTransform), typeof(MissingValueDroppingTransformer), typeof(MissingValueDroppingTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/MissingValueHandlingTransformer.cs b/src/Microsoft.ML.Transforms/MissingValueHandlingTransformer.cs index 505ceed86e..83f1dd9ac8 100644 --- a/src/Microsoft.ML.Transforms/MissingValueHandlingTransformer.cs +++ b/src/Microsoft.ML.Transforms/MissingValueHandlingTransformer.cs @@ -9,8 +9,8 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(MissingValueHandlingTransformer.Summary, typeof(IDataTransform), typeof(MissingValueHandlingTransformer), diff --git a/src/Microsoft.ML.Transforms/MissingValueIndicatorTransform.cs b/src/Microsoft.ML.Transforms/MissingValueIndicatorTransform.cs index 6a352cf6a1..8edf582b15 100644 --- a/src/Microsoft.ML.Transforms/MissingValueIndicatorTransform.cs +++ b/src/Microsoft.ML.Transforms/MissingValueIndicatorTransform.cs @@ -9,7 +9,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(typeof(MissingValueIndicatorTransform), typeof(MissingValueIndicatorTransform.Arguments), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/MissingValueIndicatorTransformer.cs b/src/Microsoft.ML.Transforms/MissingValueIndicatorTransformer.cs index a6de8129f6..a366fc25e9 100644 --- a/src/Microsoft.ML.Transforms/MissingValueIndicatorTransformer.cs +++ b/src/Microsoft.ML.Transforms/MissingValueIndicatorTransformer.cs @@ -10,9 +10,8 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(MissingValueIndicatorTransformer.Summary, typeof(IDataTransform), typeof(MissingValueIndicatorTransformer), typeof(MissingValueIndicatorTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/MissingValueReplacing.cs b/src/Microsoft.ML.Transforms/MissingValueReplacing.cs index 09d222f959..03776277b3 100644 --- a/src/Microsoft.ML.Transforms/MissingValueReplacing.cs +++ b/src/Microsoft.ML.Transforms/MissingValueReplacing.cs @@ -14,10 +14,9 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Data.IO; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Model.OnnxConverter; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(MissingValueReplacingTransformer.Summary, typeof(IDataTransform), typeof(MissingValueReplacingTransformer), typeof(MissingValueReplacingTransformer.Options), typeof(SignatureDataTransform), @@ -280,14 +279,14 @@ private void GetReplacementValues(IDataView input, MissingValueReplacingEstimato List columnsToImpute = null; // REVIEW: Would like to get rid of the sourceColumns list but seems to be the best way to provide // the cursor with what columns to cursor through. - var sourceColumns = new List(); + var sourceColumns = new List(); for (int iinfo = 0; iinfo < columns.Length; iinfo++) { input.Schema.TryGetColumnIndex(columns[iinfo].InputColumnName, out int colSrc); sources[iinfo] = colSrc; var type = input.Schema[colSrc].Type; if (type is VectorType vectorType) - type = new VectorType(vectorType.ItemType, vectorType); + type = new VectorType(vectorType.ItemType, vectorType); Delegate isNa = GetIsNADelegate(type); types[iinfo] = type; var kind = (ReplacementKind)columns[iinfo].Replacement; diff --git a/src/Microsoft.ML.Transforms/MissingValueReplacingUtils.cs b/src/Microsoft.ML.Transforms/MissingValueReplacingUtils.cs index 669d30ab73..38ade39f81 100644 --- a/src/Microsoft.ML.Transforms/MissingValueReplacingUtils.cs +++ b/src/Microsoft.ML.Transforms/MissingValueReplacingUtils.cs @@ -2,11 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.Internal.CpuMath; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms { diff --git a/src/Microsoft.ML.Transforms/MutualInformationFeatureSelection.cs b/src/Microsoft.ML.Transforms/MutualInformationFeatureSelection.cs index 05d67116a2..01c813d0e7 100644 --- a/src/Microsoft.ML.Transforms/MutualInformationFeatureSelection.cs +++ b/src/Microsoft.ML.Transforms/MutualInformationFeatureSelection.cs @@ -11,8 +11,8 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.FeatureSelection; [assembly: LoadableClass(MutualInformationFeatureSelectingEstimator.Summary, typeof(IDataTransform), typeof(MutualInformationFeatureSelectingEstimator), typeof(MutualInformationFeatureSelectingEstimator.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/NAHandling.cs b/src/Microsoft.ML.Transforms/NAHandling.cs index 8a569bf186..eefa2dc23d 100644 --- a/src/Microsoft.ML.Transforms/NAHandling.cs +++ b/src/Microsoft.ML.Transforms/NAHandling.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: EntryPointModule(typeof(NAHandling))] diff --git a/src/Microsoft.ML.Transforms/OneHotEncoding.cs b/src/Microsoft.ML.Transforms/OneHotEncoding.cs index 03cd090650..cf635a574a 100644 --- a/src/Microsoft.ML.Transforms/OneHotEncoding.cs +++ b/src/Microsoft.ML.Transforms/OneHotEncoding.cs @@ -13,7 +13,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(OneHotEncodingTransformer.Summary, typeof(IDataTransform), typeof(OneHotEncodingTransformer), typeof(OneHotEncodingTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/OneHotHashEncoding.cs b/src/Microsoft.ML.Transforms/OneHotHashEncoding.cs index 78601c709d..ea3279bc05 100644 --- a/src/Microsoft.ML.Transforms/OneHotHashEncoding.cs +++ b/src/Microsoft.ML.Transforms/OneHotHashEncoding.cs @@ -9,8 +9,8 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(OneHotHashEncodingTransformer.Summary, typeof(IDataTransform), typeof(OneHotHashEncodingTransformer), typeof(OneHotHashEncodingTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/OptionalColumnTransform.cs b/src/Microsoft.ML.Transforms/OptionalColumnTransform.cs index 526d33d5b3..953fbdd2eb 100644 --- a/src/Microsoft.ML.Transforms/OptionalColumnTransform.cs +++ b/src/Microsoft.ML.Transforms/OptionalColumnTransform.cs @@ -14,7 +14,7 @@ using Microsoft.ML.Data.IO; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(OptionalColumnTransform.Summary, typeof(OptionalColumnTransform), diff --git a/src/Microsoft.ML.Transforms/PermutationFeatureImportance.cs b/src/Microsoft.ML.Transforms/PermutationFeatureImportance.cs index 9875185cc3..273438c985 100644 --- a/src/Microsoft.ML.Transforms/PermutationFeatureImportance.cs +++ b/src/Microsoft.ML.Transforms/PermutationFeatureImportance.cs @@ -11,6 +11,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms { @@ -276,9 +277,9 @@ private sealed class FeaturesBuffer /// private sealed class FeatureIndex { - #pragma warning disable 0649 +#pragma warning disable 0649 public int Index; - #pragma warning restore 0649 +#pragma warning restore 0649 } /// @@ -286,9 +287,9 @@ private sealed class FeatureIndex /// private sealed class FeatureName { - #pragma warning disable 0649 +#pragma warning disable 0649 public ReadOnlyMemory Name; - #pragma warning restore 0649 +#pragma warning restore 0649 } } } \ No newline at end of file diff --git a/src/Microsoft.ML.Transforms/PermutationFeatureImportanceExtensions.cs b/src/Microsoft.ML.Transforms/PermutationFeatureImportanceExtensions.cs index 0169a11faa..332e0e821e 100644 --- a/src/Microsoft.ML.Transforms/PermutationFeatureImportanceExtensions.cs +++ b/src/Microsoft.ML.Transforms/PermutationFeatureImportanceExtensions.cs @@ -6,6 +6,7 @@ using System.Collections.Immutable; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML diff --git a/src/Microsoft.ML.Transforms/ProduceIdTransform.cs b/src/Microsoft.ML.Transforms/ProduceIdTransform.cs index d1819c9c7f..8c8f38bad8 100644 --- a/src/Microsoft.ML.Transforms/ProduceIdTransform.cs +++ b/src/Microsoft.ML.Transforms/ProduceIdTransform.cs @@ -9,7 +9,7 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(ProduceIdTransform.Summary, typeof(ProduceIdTransform), typeof(ProduceIdTransform.Arguments), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/RandomFourierFeaturizing.cs b/src/Microsoft.ML.Transforms/RandomFourierFeaturizing.cs index 7ed8e436ef..14faad1960 100644 --- a/src/Microsoft.ML.Transforms/RandomFourierFeaturizing.cs +++ b/src/Microsoft.ML.Transforms/RandomFourierFeaturizing.cs @@ -12,7 +12,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.CpuMath; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(RandomFourierExpansionTransformer.Summary, typeof(IDataTransform), typeof(RandomFourierExpansionTransformer), typeof(RandomFourierExpansionTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/SerializableLambdaTransform.cs b/src/Microsoft.ML.Transforms/SerializableLambdaTransform.cs index a7ef1afc89..cd4b285c06 100644 --- a/src/Microsoft.ML.Transforms/SerializableLambdaTransform.cs +++ b/src/Microsoft.ML.Transforms/SerializableLambdaTransform.cs @@ -10,7 +10,7 @@ using Microsoft.ML; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(SerializableLambdaTransform.Summary, typeof(ITransformTemplate), typeof(SerializableLambdaTransform), null, diff --git a/src/Microsoft.ML.Transforms/StatefulFilterTransform.cs b/src/Microsoft.ML.Transforms/StatefulFilterTransform.cs index 89bfdb36c8..0d8c7f0710 100644 --- a/src/Microsoft.ML.Transforms/StatefulFilterTransform.cs +++ b/src/Microsoft.ML.Transforms/StatefulFilterTransform.cs @@ -8,6 +8,7 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms { diff --git a/src/Microsoft.ML.Transforms/Text/LdaSingleBox.cs b/src/Microsoft.ML.Transforms/Text/LdaSingleBox.cs index 50b3d6dad7..97054d8bb8 100644 --- a/src/Microsoft.ML.Transforms/Text/LdaSingleBox.cs +++ b/src/Microsoft.ML.Transforms/Text/LdaSingleBox.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Runtime.InteropServices; using System.Security; +using Microsoft.ML.Runtime; namespace Microsoft.ML.TextAnalytics { diff --git a/src/Microsoft.ML.Transforms/Text/LdaTransform.cs b/src/Microsoft.ML.Transforms/Text/LdaTransform.cs index 49dd3c61ad..3c247ab1fd 100644 --- a/src/Microsoft.ML.Transforms/Text/LdaTransform.cs +++ b/src/Microsoft.ML.Transforms/Text/LdaTransform.cs @@ -14,7 +14,7 @@ using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.TextAnalytics; using Microsoft.ML.Transforms.Text; diff --git a/src/Microsoft.ML.Transforms/Text/NgramHashingTransformer.cs b/src/Microsoft.ML.Transforms/Text/NgramHashingTransformer.cs index 34af9d3ed5..eb2e63d85d 100644 --- a/src/Microsoft.ML.Transforms/Text/NgramHashingTransformer.cs +++ b/src/Microsoft.ML.Transforms/Text/NgramHashingTransformer.cs @@ -13,7 +13,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.Text; [assembly: LoadableClass(NgramHashingTransformer.Summary, typeof(IDataTransform), typeof(NgramHashingTransformer), typeof(NgramHashingTransformer.Options), typeof(SignatureDataTransform), @@ -662,7 +662,7 @@ public InvertHashHelper(NgramHashingTransformer parent, DataViewSchema inputSche _srcTextGetters = new ValueMapper[inputSchema.Count]; _invertHashMaxCounts = invertHashMaxCounts; - foreach(var col in columnsNeeded) + foreach (var col in columnsNeeded) { Contracts.Assert(col.Index < _srcTextGetters.Length); _srcTextGetters[col.Index] = InvertHashUtils.GetSimpleMapper(inputSchema, col.Index); diff --git a/src/Microsoft.ML.Transforms/Text/NgramTransform.cs b/src/Microsoft.ML.Transforms/Text/NgramTransform.cs index 513a00884f..feab3ac49b 100644 --- a/src/Microsoft.ML.Transforms/Text/NgramTransform.cs +++ b/src/Microsoft.ML.Transforms/Text/NgramTransform.cs @@ -12,9 +12,8 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.Text; [assembly: LoadableClass(NgramExtractingTransformer.Summary, typeof(IDataTransform), typeof(NgramExtractingTransformer), typeof(NgramExtractingTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/Text/NgramUtils.cs b/src/Microsoft.ML.Transforms/Text/NgramUtils.cs index cf3f0f3d09..2cd529552e 100644 --- a/src/Microsoft.ML.Transforms/Text/NgramUtils.cs +++ b/src/Microsoft.ML.Transforms/Text/NgramUtils.cs @@ -4,6 +4,7 @@ using System; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Data { diff --git a/src/Microsoft.ML.Transforms/Text/SentimentAnalyzingTransform.cs b/src/Microsoft.ML.Transforms/Text/SentimentAnalyzingTransform.cs index 1358548df8..2eba58707c 100644 --- a/src/Microsoft.ML.Transforms/Text/SentimentAnalyzingTransform.cs +++ b/src/Microsoft.ML.Transforms/Text/SentimentAnalyzingTransform.cs @@ -8,9 +8,9 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.Text; [assembly: LoadableClass(TextFeaturizingEstimator.Summary, typeof(IDataTransform), typeof(SentimentAnalyzingTransformer), typeof(SentimentAnalyzingTransformer.Arguments), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/Text/StopWordsRemovingTransformer.cs b/src/Microsoft.ML.Transforms/Text/StopWordsRemovingTransformer.cs index 7e62c6907f..2a36dbae24 100644 --- a/src/Microsoft.ML.Transforms/Text/StopWordsRemovingTransformer.cs +++ b/src/Microsoft.ML.Transforms/Text/StopWordsRemovingTransformer.cs @@ -16,7 +16,7 @@ using Microsoft.ML.Data.IO; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.Text; [assembly: LoadableClass(StopWordsRemovingTransformer.Summary, typeof(IDataTransform), typeof(StopWordsRemovingTransformer), typeof(StopWordsRemovingTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/Text/TextCatalog.cs b/src/Microsoft.ML.Transforms/Text/TextCatalog.cs index 0d513681f3..92647a4ab0 100644 --- a/src/Microsoft.ML.Transforms/Text/TextCatalog.cs +++ b/src/Microsoft.ML.Transforms/Text/TextCatalog.cs @@ -2,9 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Collections.Generic; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.Text; namespace Microsoft.ML diff --git a/src/Microsoft.ML.Transforms/Text/TextFeaturizingEstimator.cs b/src/Microsoft.ML.Transforms/Text/TextFeaturizingEstimator.cs index f29e80306e..7e30b62165 100644 --- a/src/Microsoft.ML.Transforms/Text/TextFeaturizingEstimator.cs +++ b/src/Microsoft.ML.Transforms/Text/TextFeaturizingEstimator.cs @@ -11,9 +11,9 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Data.IO; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.Text; [assembly: LoadableClass(TextFeaturizingEstimator.Summary, typeof(IDataTransform), typeof(TextFeaturizingEstimator), typeof(TextFeaturizingEstimator.Arguments), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/Text/TextNormalizing.cs b/src/Microsoft.ML.Transforms/Text/TextNormalizing.cs index 2785c849ba..e9c28e04af 100644 --- a/src/Microsoft.ML.Transforms/Text/TextNormalizing.cs +++ b/src/Microsoft.ML.Transforms/Text/TextNormalizing.cs @@ -12,7 +12,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.Text; [assembly: LoadableClass(TextNormalizingTransformer.Summary, typeof(IDataTransform), typeof(TextNormalizingTransformer), typeof(TextNormalizingTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/Text/TokenizingByCharacters.cs b/src/Microsoft.ML.Transforms/Text/TokenizingByCharacters.cs index 2f3a3614d4..731f13990e 100644 --- a/src/Microsoft.ML.Transforms/Text/TokenizingByCharacters.cs +++ b/src/Microsoft.ML.Transforms/Text/TokenizingByCharacters.cs @@ -11,9 +11,8 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.Text; [assembly: LoadableClass(TokenizingByCharactersTransformer.Summary, typeof(IDataTransform), typeof(TokenizingByCharactersTransformer), typeof(TokenizingByCharactersTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/Text/WordBagTransform.cs b/src/Microsoft.ML.Transforms/Text/WordBagTransform.cs index 72de0b6bd3..a66b4512be 100644 --- a/src/Microsoft.ML.Transforms/Text/WordBagTransform.cs +++ b/src/Microsoft.ML.Transforms/Text/WordBagTransform.cs @@ -11,6 +11,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.Text; [assembly: LoadableClass(WordBagBuildingTransformer.Summary, typeof(IDataTransform), typeof(WordBagBuildingTransformer), typeof(WordBagBuildingTransformer.Options), typeof(SignatureDataTransform), diff --git a/src/Microsoft.ML.Transforms/Text/WordEmbeddingsExtractor.cs b/src/Microsoft.ML.Transforms/Text/WordEmbeddingsExtractor.cs index c386e015d9..b288b07dde 100644 --- a/src/Microsoft.ML.Transforms/Text/WordEmbeddingsExtractor.cs +++ b/src/Microsoft.ML.Transforms/Text/WordEmbeddingsExtractor.cs @@ -13,11 +13,10 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Model.OnnxConverter; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.Text; [assembly: LoadableClass(WordEmbeddingsExtractingTransformer.Summary, typeof(IDataTransform), typeof(WordEmbeddingsExtractingTransformer), typeof(WordEmbeddingsExtractingTransformer.Options), diff --git a/src/Microsoft.ML.Transforms/Text/WordHashBagProducingTransform.cs b/src/Microsoft.ML.Transforms/Text/WordHashBagProducingTransform.cs index 8f96a9dd47..8cb9d2ed13 100644 --- a/src/Microsoft.ML.Transforms/Text/WordHashBagProducingTransform.cs +++ b/src/Microsoft.ML.Transforms/Text/WordHashBagProducingTransform.cs @@ -11,6 +11,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.Text; [assembly: LoadableClass(WordHashBagProducingTransformer.Summary, typeof(IDataTransform), typeof(WordHashBagProducingTransformer), typeof(WordHashBagProducingTransformer.Options), typeof(SignatureDataTransform), @@ -330,7 +331,7 @@ internal static IDataTransform Create(IHostEnvironment env, Options options, IDa if (termLoaderArgs != null) termCols = new List(); - var hashColumns = new List(); + var hashColumns = new List(); var ngramHashColumns = new NgramHashingEstimator.ColumnOptions[options.Columns.Length]; var colCount = options.Columns.Length; diff --git a/src/Microsoft.ML.Transforms/Text/WordTokenizing.cs b/src/Microsoft.ML.Transforms/Text/WordTokenizing.cs index 09971fb0d0..6cc72d22c6 100644 --- a/src/Microsoft.ML.Transforms/Text/WordTokenizing.cs +++ b/src/Microsoft.ML.Transforms/Text/WordTokenizing.cs @@ -10,11 +10,10 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Model.Pfa; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms.Text; using Newtonsoft.Json.Linq; diff --git a/src/Microsoft.ML.Transforms/Text/WrappedTextTransformers.cs b/src/Microsoft.ML.Transforms/Text/WrappedTextTransformers.cs index 8d0308c63a..cf8722495a 100644 --- a/src/Microsoft.ML.Transforms/Text/WrappedTextTransformers.cs +++ b/src/Microsoft.ML.Transforms/Text/WrappedTextTransformers.cs @@ -7,6 +7,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.DataLoadSave; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.Transforms.Text { @@ -269,7 +270,7 @@ public ITransformer Fit(IDataView input) // Create arguments. var options = new WordHashBagProducingTransformer.Options { - Columns = _columns.Select(x => new WordHashBagProducingTransformer.Column { Name = x.outputColumnName ,Source = x.inputColumnNames}).ToArray(), + Columns = _columns.Select(x => new WordHashBagProducingTransformer.Column { Name = x.outputColumnName, Source = x.inputColumnNames }).ToArray(), HashBits = _hashBits, NgramLength = _ngramLength, SkipLength = _skipLength, diff --git a/src/Microsoft.ML.Transforms/UngroupTransform.cs b/src/Microsoft.ML.Transforms/UngroupTransform.cs index 22e7b231a5..6ea33ee565 100644 --- a/src/Microsoft.ML.Transforms/UngroupTransform.cs +++ b/src/Microsoft.ML.Transforms/UngroupTransform.cs @@ -12,7 +12,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; [assembly: LoadableClass(UngroupTransform.Summary, typeof(UngroupTransform), typeof(UngroupTransform.Options), typeof(SignatureDataTransform), diff --git a/test/Microsoft.ML.Benchmarks.Tests/BenchmarksTest.cs b/test/Microsoft.ML.Benchmarks.Tests/BenchmarksTest.cs index 9dc6854e8b..ccf1898dce 100644 --- a/test/Microsoft.ML.Benchmarks.Tests/BenchmarksTest.cs +++ b/test/Microsoft.ML.Benchmarks.Tests/BenchmarksTest.cs @@ -3,10 +3,8 @@ // See the LICENSE file in the project root for more information. using System; -using System.Collections.Generic; using System.Linq; using System.Reflection; -using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Loggers; diff --git a/test/Microsoft.ML.Benchmarks/CacheDataViewBench.cs b/test/Microsoft.ML.Benchmarks/CacheDataViewBench.cs index f4844070c5..558f05ef79 100644 --- a/test/Microsoft.ML.Benchmarks/CacheDataViewBench.cs +++ b/test/Microsoft.ML.Benchmarks/CacheDataViewBench.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; using Microsoft.Data.DataView; using Microsoft.ML.Benchmarks.Harness; diff --git a/test/Microsoft.ML.Benchmarks/HashBench.cs b/test/Microsoft.ML.Benchmarks/HashBench.cs index 26ce298920..ef5f58d567 100644 --- a/test/Microsoft.ML.Benchmarks/HashBench.cs +++ b/test/Microsoft.ML.Benchmarks/HashBench.cs @@ -8,6 +8,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Benchmarks.Harness; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; namespace Microsoft.ML.Benchmarks diff --git a/test/Microsoft.ML.Benchmarks/Helpers/CIBenchmark.cs b/test/Microsoft.ML.Benchmarks/Helpers/CIBenchmark.cs index 02371ad0d5..6de9ecb88a 100644 --- a/test/Microsoft.ML.Benchmarks/Helpers/CIBenchmark.cs +++ b/test/Microsoft.ML.Benchmarks/Helpers/CIBenchmark.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System; - namespace Microsoft.ML.Benchmarks.Harness { /// diff --git a/test/Microsoft.ML.Benchmarks/Helpers/EnvironmentFactory.cs b/test/Microsoft.ML.Benchmarks/Helpers/EnvironmentFactory.cs index 7f7d98069a..52398ca4e0 100644 --- a/test/Microsoft.ML.Benchmarks/Helpers/EnvironmentFactory.cs +++ b/test/Microsoft.ML.Benchmarks/Helpers/EnvironmentFactory.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Microsoft.ML.Transforms; diff --git a/test/Microsoft.ML.Benchmarks/Helpers/ExecuteMaml.cs b/test/Microsoft.ML.Benchmarks/Helpers/ExecuteMaml.cs index 20ae1f2201..be81171210 100644 --- a/test/Microsoft.ML.Benchmarks/Helpers/ExecuteMaml.cs +++ b/test/Microsoft.ML.Benchmarks/Helpers/ExecuteMaml.cs @@ -2,9 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using Microsoft.ML.Tools; using System; - +using Microsoft.ML.Tools; namespace Microsoft.ML.Benchmarks { internal static class ExecuteMaml diff --git a/test/Microsoft.ML.Benchmarks/KMeansAndLogisticRegressionBench.cs b/test/Microsoft.ML.Benchmarks/KMeansAndLogisticRegressionBench.cs index f57247d65e..a1b11352d5 100644 --- a/test/Microsoft.ML.Benchmarks/KMeansAndLogisticRegressionBench.cs +++ b/test/Microsoft.ML.Benchmarks/KMeansAndLogisticRegressionBench.cs @@ -4,8 +4,8 @@ using BenchmarkDotNet.Attributes; using Microsoft.ML.Benchmarks.Harness; -using Microsoft.ML.Data; using Microsoft.ML.Calibrators; +using Microsoft.ML.Data; using Microsoft.ML.TestFramework; using Microsoft.ML.Trainers; diff --git a/test/Microsoft.ML.Benchmarks/Numeric/Ranking.cs b/test/Microsoft.ML.Benchmarks/Numeric/Ranking.cs index 57acba7e90..33aee9e6ba 100644 --- a/test/Microsoft.ML.Benchmarks/Numeric/Ranking.cs +++ b/test/Microsoft.ML.Benchmarks/Numeric/Ranking.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.IO; using BenchmarkDotNet.Attributes; using Microsoft.ML.Data; using Microsoft.ML.LightGBM; @@ -10,7 +11,6 @@ using Microsoft.ML.Trainers; using Microsoft.ML.Trainers.FastTree; using Microsoft.ML.Transforms; -using System.IO; namespace Microsoft.ML.Benchmarks { diff --git a/test/Microsoft.ML.Benchmarks/PredictionEngineBench.cs b/test/Microsoft.ML.Benchmarks/PredictionEngineBench.cs index ffdfced85a..0453fc07dd 100644 --- a/test/Microsoft.ML.Benchmarks/PredictionEngineBench.cs +++ b/test/Microsoft.ML.Benchmarks/PredictionEngineBench.cs @@ -9,7 +9,6 @@ using Microsoft.ML.TestFramework; using Microsoft.ML.Trainers; using Microsoft.ML.Transforms; -using Microsoft.ML.Transforms.Text; namespace Microsoft.ML.Benchmarks { diff --git a/test/Microsoft.ML.Benchmarks/Text/MultiClassClassification.cs b/test/Microsoft.ML.Benchmarks/Text/MultiClassClassification.cs index 816e04627c..e8ba6dcacc 100644 --- a/test/Microsoft.ML.Benchmarks/Text/MultiClassClassification.cs +++ b/test/Microsoft.ML.Benchmarks/Text/MultiClassClassification.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.IO; using BenchmarkDotNet.Attributes; using Microsoft.ML.Data; using Microsoft.ML.LightGBM; @@ -9,7 +10,6 @@ using Microsoft.ML.TestFramework; using Microsoft.ML.Trainers; using Microsoft.ML.Transforms; -using System.IO; namespace Microsoft.ML.Benchmarks { diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs index 6ea2adc007..7748572bad 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs @@ -67,7 +67,7 @@ public async Task ContractsCheckDecoy() // except the namespace is distinct so it is a different type. We should not find // diagnostics on a class like this! const string decoySource = @" -using System; +using System; using Microsoft.ML.Runtime; namespace TestNamespace { public static class Contracts diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs index d2d4eb1e49..cdbd80e262 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs @@ -90,7 +90,7 @@ public async Task MoreNameTests() } internal const string TestSource = @" -using System; +using System; using Microsoft.ML.Runtime; namespace silly { } namespace NotSilly { } namespace foo.bar.Biz @@ -132,7 +132,7 @@ struct marco { public int polo; } public async Task ExternName() { const string source = @" -using System; +using System; using Microsoft.ML.Runtime; using System.Runtime.InteropServices; namespace TestNamespace @@ -157,7 +157,7 @@ public void masterBlaster() {} } private const string FixedTestSource = @" -using System; +using System; using Microsoft.ML.Runtime; namespace silly { } namespace NotSilly { } namespace foo.bar.Biz diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Helpers/AdditionalMetadataReferences.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Helpers/AdditionalMetadataReferences.cs index 96f0224662..9f21c04597 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Helpers/AdditionalMetadataReferences.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Helpers/AdditionalMetadataReferences.cs @@ -6,6 +6,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.Data.DataView; +using Microsoft.ML.Runtime; using Microsoft.ML.StaticPipe; namespace Microsoft.ML.CodeAnalyzer.Tests.Helpers diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendDeclaration.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendDeclaration.cs index bb7e717e99..629470d49f 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendDeclaration.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendDeclaration.cs @@ -1,5 +1,5 @@ using System.Runtime.CompilerServices; -using Microsoft.ML; +using Microsoft.ML.Runtime; using Microsoft.ML; [assembly: InternalsVisibleTo("ProjectB")] [assembly: WantsToBeBestFriends] diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendOnPublicDeclaration.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendOnPublicDeclaration.cs index 1515f21e1f..a308f5da44 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendOnPublicDeclaration.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendOnPublicDeclaration.cs @@ -1,5 +1,5 @@ -using System; -using Microsoft.ML; +using System; using Microsoft.ML.Runtime; +using Microsoft.ML.Runtime; using Microsoft.ML; namespace TestNamespace { diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendUser.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendUser.cs index b44a919c6e..334436ac42 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendUser.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendUser.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.ML.Runtime; using Bubba; namespace McGee diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckAfterFix.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckAfterFix.cs index 1783bdf1bc..03c79b37bc 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckAfterFix.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckAfterFix.cs @@ -1,6 +1,6 @@ -using Microsoft.ML; +using Microsoft.ML.Runtime; using Microsoft.ML; using Microsoft.ML.CommandLine; -using System; +using System; using Microsoft.ML.Runtime; namespace Bubba { public class Foo diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckBeforeFix.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckBeforeFix.cs index 6c6cc61c47..8303756fb7 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckBeforeFix.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckBeforeFix.cs @@ -1,6 +1,6 @@ -using Microsoft.ML; +using Microsoft.ML.Runtime; using Microsoft.ML; using Microsoft.ML.CommandLine; -using System; +using System; using Microsoft.ML.Runtime; namespace Bubba { public class Foo diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckResource.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckResource.cs index 05aed26e5f..a8fdbb1d10 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckResource.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckResource.cs @@ -3,8 +3,8 @@ // code, as well as code for "Contracts" derived from and intended to resemble // the corresponding code in ML.NET. -using System; -using Microsoft.ML; +using System; using Microsoft.ML.Runtime; +using Microsoft.ML.Runtime; using Microsoft.ML; using Microsoft.ML.Model; namespace TestNamespace diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeClassResource.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeClassResource.cs index 54526c133d..8370f70856 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeClassResource.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeClassResource.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.DataView; -using Microsoft.ML; -using Microsoft.ML.Data; +using System; using Microsoft.ML.Runtime; +using Microsoft.Data.DataView; using Microsoft.ML.Runtime; +using Microsoft.ML.Runtime; using Microsoft.ML; +using Microsoft.ML.Runtime; using Microsoft.ML.Data; using Microsoft.ML.StaticPipe; namespace Bubba diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResource.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResource.cs index 23fef3c12c..bbaf6f0d2f 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResource.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResource.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.ML; +using System; using Microsoft.ML.Runtime; +using Microsoft.ML.Runtime; using Microsoft.ML; using Microsoft.ML.CommandLine; -using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Data; using Microsoft.ML.StaticPipe; namespace Bubba diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResourceChained.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResourceChained.cs index 780365f135..9c75cb70af 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResourceChained.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResourceChained.cs @@ -1,8 +1,8 @@ -using System; +using System; using Microsoft.ML.Runtime; using System.Collections.Generic; -using Microsoft.ML; +using Microsoft.ML.Runtime; using Microsoft.ML; using Microsoft.ML.CommandLine; -using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Data; using Microsoft.ML.StaticPipe; namespace Bubba diff --git a/test/Microsoft.ML.Core.Tests/UnitTests/CoreBaseTestClass.cs b/test/Microsoft.ML.Core.Tests/UnitTests/CoreBaseTestClass.cs index ce2fe30e43..28da63d7ad 100644 --- a/test/Microsoft.ML.Core.Tests/UnitTests/CoreBaseTestClass.cs +++ b/test/Microsoft.ML.Core.Tests/UnitTests/CoreBaseTestClass.cs @@ -9,6 +9,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.RunTests; +using Microsoft.ML.Runtime; using Xunit.Abstractions; namespace Microsoft.ML.Core.Tests.UnitTests diff --git a/test/Microsoft.ML.Core.Tests/UnitTests/TestContracts.cs b/test/Microsoft.ML.Core.Tests/UnitTests/TestContracts.cs index 3a539ce216..d9412c767a 100644 --- a/test/Microsoft.ML.Core.Tests/UnitTests/TestContracts.cs +++ b/test/Microsoft.ML.Core.Tests/UnitTests/TestContracts.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using Microsoft.ML.Runtime; using Xunit; namespace Microsoft.ML.RunTests { diff --git a/test/Microsoft.ML.Core.Tests/UnitTests/TestEntryPoints.cs b/test/Microsoft.ML.Core.Tests/UnitTests/TestEntryPoints.cs index 62cd3d97de..4077d932bb 100644 --- a/test/Microsoft.ML.Core.Tests/UnitTests/TestEntryPoints.cs +++ b/test/Microsoft.ML.Core.Tests/UnitTests/TestEntryPoints.cs @@ -18,6 +18,7 @@ using Microsoft.ML.LightGBM; using Microsoft.ML.Model; using Microsoft.ML.Model.OnnxConverter; +using Microsoft.ML.Runtime; using Microsoft.ML.TestFramework.Attributes; using Microsoft.ML.Trainers; using Microsoft.ML.Trainers.Ensemble; diff --git a/test/Microsoft.ML.Core.Tests/UnitTests/TestHosts.cs b/test/Microsoft.ML.Core.Tests/UnitTests/TestHosts.cs index 5adceb7ec9..186c0b7621 100644 --- a/test/Microsoft.ML.Core.Tests/UnitTests/TestHosts.cs +++ b/test/Microsoft.ML.Core.Tests/UnitTests/TestHosts.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Threading; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Xunit; namespace Microsoft.ML.RunTests diff --git a/test/Microsoft.ML.Core.Tests/UnitTests/TestLoss.cs b/test/Microsoft.ML.Core.Tests/UnitTests/TestLoss.cs index 4daa225d92..b313da4592 100644 --- a/test/Microsoft.ML.Core.Tests/UnitTests/TestLoss.cs +++ b/test/Microsoft.ML.Core.Tests/UnitTests/TestLoss.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using Microsoft.ML.Trainers; using Xunit; namespace Microsoft.ML.RunTests diff --git a/test/Microsoft.ML.Core.Tests/UnitTests/TestVBuffer.cs b/test/Microsoft.ML.Core.Tests/UnitTests/TestVBuffer.cs index d8119458eb..837be7975e 100644 --- a/test/Microsoft.ML.Core.Tests/UnitTests/TestVBuffer.cs +++ b/test/Microsoft.ML.Core.Tests/UnitTests/TestVBuffer.cs @@ -10,6 +10,7 @@ using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Numeric; using Microsoft.ML.RunTests; +using Microsoft.ML.Runtime; using Xunit; using Xunit.Abstractions; diff --git a/test/Microsoft.ML.CpuMath.PerformanceTests/AvxPerformanceTests.cs b/test/Microsoft.ML.CpuMath.PerformanceTests/AvxPerformanceTests.cs index af89929c71..2391ec7cfb 100644 --- a/test/Microsoft.ML.CpuMath.PerformanceTests/AvxPerformanceTests.cs +++ b/test/Microsoft.ML.CpuMath.PerformanceTests/AvxPerformanceTests.cs @@ -2,10 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Running; -using Microsoft.ML.Internal.CpuMath; namespace Microsoft.ML.CpuMath.PerformanceTests { diff --git a/test/Microsoft.ML.CpuMath.PerformanceTests/NativePerformanceTests.cs b/test/Microsoft.ML.CpuMath.PerformanceTests/NativePerformanceTests.cs index 1e3efb7ee1..4db3b6390e 100644 --- a/test/Microsoft.ML.CpuMath.PerformanceTests/NativePerformanceTests.cs +++ b/test/Microsoft.ML.CpuMath.PerformanceTests/NativePerformanceTests.cs @@ -2,11 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Running; -using Microsoft.ML.Internal.CpuMath; -using Microsoft.ML.Internal.CpuMath.Core; namespace Microsoft.ML.CpuMath.PerformanceTests { diff --git a/test/Microsoft.ML.CpuMath.PerformanceTests/PerformanceTests.cs b/test/Microsoft.ML.CpuMath.PerformanceTests/PerformanceTests.cs index a03e1cc95b..35597e42bd 100644 --- a/test/Microsoft.ML.CpuMath.PerformanceTests/PerformanceTests.cs +++ b/test/Microsoft.ML.CpuMath.PerformanceTests/PerformanceTests.cs @@ -2,10 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Running; -using Microsoft.ML.Internal.CpuMath; namespace Microsoft.ML.CpuMath.PerformanceTests { diff --git a/test/Microsoft.ML.CpuMath.PerformanceTests/Program.cs b/test/Microsoft.ML.CpuMath.PerformanceTests/Program.cs index 9ff474a9a1..88cd2bd729 100644 --- a/test/Microsoft.ML.CpuMath.PerformanceTests/Program.cs +++ b/test/Microsoft.ML.CpuMath.PerformanceTests/Program.cs @@ -2,10 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using BenchmarkDotNet.Configs; -using BenchmarkDotNet.Jobs; -using BenchmarkDotNet.Running; -using BenchmarkDotNet.Toolchains.InProcess; namespace Microsoft.ML.CpuMath.PerformanceTests { diff --git a/test/Microsoft.ML.CpuMath.PerformanceTests/SmallInputCpuMathPerformanceTests.cs b/test/Microsoft.ML.CpuMath.PerformanceTests/SmallInputCpuMathPerformanceTests.cs index 2e663598ed..ca1b2355a1 100644 --- a/test/Microsoft.ML.CpuMath.PerformanceTests/SmallInputCpuMathPerformanceTests.cs +++ b/test/Microsoft.ML.CpuMath.PerformanceTests/SmallInputCpuMathPerformanceTests.cs @@ -2,9 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; -using BenchmarkDotNet.Attributes; -using Microsoft.ML.Internal.CpuMath; namespace Microsoft.ML.CpuMath.PerformanceTests { diff --git a/test/Microsoft.ML.CpuMath.PerformanceTests/SsePerformanceTests.cs b/test/Microsoft.ML.CpuMath.PerformanceTests/SsePerformanceTests.cs index 0c48ea04c6..875c8fa59e 100644 --- a/test/Microsoft.ML.CpuMath.PerformanceTests/SsePerformanceTests.cs +++ b/test/Microsoft.ML.CpuMath.PerformanceTests/SsePerformanceTests.cs @@ -2,10 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Running; -using Microsoft.ML.Internal.CpuMath; namespace Microsoft.ML.CpuMath.PerformanceTests { diff --git a/test/Microsoft.ML.Functional.Tests/DataIO.cs b/test/Microsoft.ML.Functional.Tests/DataIO.cs index 6f6b334aa1..07fc36bf42 100644 --- a/test/Microsoft.ML.Functional.Tests/DataIO.cs +++ b/test/Microsoft.ML.Functional.Tests/DataIO.cs @@ -4,7 +4,6 @@ using System.IO; using Microsoft.Data.DataView; -using Microsoft.ML.Data; using Microsoft.ML.Functional.Tests.Datasets; using Microsoft.ML.TestFramework; using Xunit; diff --git a/test/Microsoft.ML.Functional.Tests/Datasets/FeatureContributionOutput.cs b/test/Microsoft.ML.Functional.Tests/Datasets/FeatureContributionOutput.cs index 482a955282..6aa8dcbb11 100644 --- a/test/Microsoft.ML.Functional.Tests/Datasets/FeatureContributionOutput.cs +++ b/test/Microsoft.ML.Functional.Tests/Datasets/FeatureContributionOutput.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using Microsoft.ML.Data; namespace Microsoft.ML.Functional.Tests.Datasets { diff --git a/test/Microsoft.ML.Functional.Tests/Datasets/TrivialMatrixFactorization.cs b/test/Microsoft.ML.Functional.Tests/Datasets/TrivialMatrixFactorization.cs index 9c76b70054..23836d3d04 100644 --- a/test/Microsoft.ML.Functional.Tests/Datasets/TrivialMatrixFactorization.cs +++ b/test/Microsoft.ML.Functional.Tests/Datasets/TrivialMatrixFactorization.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. -using System; using Microsoft.Data.DataView; using Microsoft.ML.Data; diff --git a/test/Microsoft.ML.Functional.Tests/Datasets/TypeTestData.cs b/test/Microsoft.ML.Functional.Tests/Datasets/TypeTestData.cs index 6b87a3947f..1d3eee5955 100644 --- a/test/Microsoft.ML.Functional.Tests/Datasets/TypeTestData.cs +++ b/test/Microsoft.ML.Functional.Tests/Datasets/TypeTestData.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; -using Microsoft.Data.DataView; using Microsoft.ML.Data; namespace Microsoft.ML.Functional.Tests.Datasets diff --git a/test/Microsoft.ML.Functional.Tests/Explainability.cs b/test/Microsoft.ML.Functional.Tests/Explainability.cs index d8200870f4..b268bf468d 100644 --- a/test/Microsoft.ML.Functional.Tests/Explainability.cs +++ b/test/Microsoft.ML.Functional.Tests/Explainability.cs @@ -2,12 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.Functional.Tests.Datasets; using Microsoft.ML.RunTests; using Microsoft.ML.TestFramework; -using Microsoft.ML.Trainers; using Microsoft.ML.Trainers.FastTree; using Xunit; using Xunit.Abstractions; diff --git a/test/Microsoft.ML.OnnxTransformerTest/OnnxTransformTests.cs b/test/Microsoft.ML.OnnxTransformerTest/OnnxTransformTests.cs index cc1e9a873d..84ec16bb8c 100644 --- a/test/Microsoft.ML.OnnxTransformerTest/OnnxTransformTests.cs +++ b/test/Microsoft.ML.OnnxTransformerTest/OnnxTransformTests.cs @@ -10,6 +10,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Model; using Microsoft.ML.RunTests; +using Microsoft.ML.Runtime; using Microsoft.ML.StaticPipe; using Microsoft.ML.TestFramework.Attributes; using Microsoft.ML.Tools; diff --git a/test/Microsoft.ML.Predictor.Tests/CmdLine/CmdIndenterTest.cs b/test/Microsoft.ML.Predictor.Tests/CmdLine/CmdIndenterTest.cs index 3fe49d07af..5976a1f793 100644 --- a/test/Microsoft.ML.Predictor.Tests/CmdLine/CmdIndenterTest.cs +++ b/test/Microsoft.ML.Predictor.Tests/CmdLine/CmdIndenterTest.cs @@ -6,6 +6,7 @@ using System.CodeDom.Compiler; using System.IO; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Xunit; using Xunit.Abstractions; diff --git a/test/Microsoft.ML.Predictor.Tests/CmdLine/CmdLine.cs b/test/Microsoft.ML.Predictor.Tests/CmdLine/CmdLine.cs index a87fa8171c..cebfdbe01a 100644 --- a/test/Microsoft.ML.Predictor.Tests/CmdLine/CmdLine.cs +++ b/test/Microsoft.ML.Predictor.Tests/CmdLine/CmdLine.cs @@ -13,6 +13,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Xunit; using Xunit.Abstractions; diff --git a/test/Microsoft.ML.Predictor.Tests/CmdLine/CmdLineReverseTest.cs b/test/Microsoft.ML.Predictor.Tests/CmdLine/CmdLineReverseTest.cs index f5d8c9e18d..199d7fa1b2 100644 --- a/test/Microsoft.ML.Predictor.Tests/CmdLine/CmdLineReverseTest.cs +++ b/test/Microsoft.ML.Predictor.Tests/CmdLine/CmdLineReverseTest.cs @@ -4,6 +4,7 @@ using System.Reflection; using Microsoft.ML.CommandLine; +using Microsoft.ML.Runtime; using Xunit; namespace Microsoft.ML.RunTests diff --git a/test/Microsoft.ML.Predictor.Tests/CompareBaselines.cs b/test/Microsoft.ML.Predictor.Tests/CompareBaselines.cs index 654dd97ee7..56981d34e4 100644 --- a/test/Microsoft.ML.Predictor.Tests/CompareBaselines.cs +++ b/test/Microsoft.ML.Predictor.Tests/CompareBaselines.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Text.RegularExpressions; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Xunit; using Xunit.Abstractions; diff --git a/test/Microsoft.ML.Predictor.Tests/TestConcurrency.cs b/test/Microsoft.ML.Predictor.Tests/TestConcurrency.cs index 0d3566e500..6d7c49612b 100644 --- a/test/Microsoft.ML.Predictor.Tests/TestConcurrency.cs +++ b/test/Microsoft.ML.Predictor.Tests/TestConcurrency.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Xunit; using Xunit.Abstractions; diff --git a/test/Microsoft.ML.Predictor.Tests/TestIniModels.cs b/test/Microsoft.ML.Predictor.Tests/TestIniModels.cs index 451fdae46f..fc20c7b95c 100644 --- a/test/Microsoft.ML.Predictor.Tests/TestIniModels.cs +++ b/test/Microsoft.ML.Predictor.Tests/TestIniModels.cs @@ -6,10 +6,9 @@ using System.IO; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Internal.Internallearn; +using Microsoft.ML.Model; using Xunit; using Xunit.Abstractions; -using Microsoft.ML.Model; namespace Microsoft.ML.RunTests { diff --git a/test/Microsoft.ML.Predictor.Tests/TestPredictors.cs b/test/Microsoft.ML.Predictor.Tests/TestPredictors.cs index 29351175f9..61ddf638b1 100644 --- a/test/Microsoft.ML.Predictor.Tests/TestPredictors.cs +++ b/test/Microsoft.ML.Predictor.Tests/TestPredictors.cs @@ -17,6 +17,7 @@ namespace Microsoft.ML.RunTests using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.LightGBM; + using Microsoft.ML.Runtime; using Microsoft.ML.TestFramework; using Microsoft.ML.Trainers; using Microsoft.ML.Trainers.FastTree; diff --git a/test/Microsoft.ML.Predictor.Tests/TestTransposer.cs b/test/Microsoft.ML.Predictor.Tests/TestTransposer.cs index 5c347dd1f4..7278e95786 100644 --- a/test/Microsoft.ML.Predictor.Tests/TestTransposer.cs +++ b/test/Microsoft.ML.Predictor.Tests/TestTransposer.cs @@ -5,11 +5,11 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.TestFramework; using Xunit; using Xunit.Abstractions; diff --git a/test/Microsoft.ML.StaticPipelineTesting/StaticPipeFakes.cs b/test/Microsoft.ML.StaticPipelineTesting/StaticPipeFakes.cs index 58af21a082..f2a4c0a74d 100644 --- a/test/Microsoft.ML.StaticPipelineTesting/StaticPipeFakes.cs +++ b/test/Microsoft.ML.StaticPipelineTesting/StaticPipeFakes.cs @@ -7,6 +7,7 @@ using System.Linq; using Microsoft.Data.DataView; using Microsoft.ML; +using Microsoft.ML.Runtime; using Microsoft.ML.StaticPipe; // Holds some classes that superficially represent classes, at least sufficiently to give the idea of the diff --git a/test/Microsoft.ML.StaticPipelineTesting/StaticPipeTests.cs b/test/Microsoft.ML.StaticPipelineTesting/StaticPipeTests.cs index 363fdde96a..813ec4c352 100644 --- a/test/Microsoft.ML.StaticPipelineTesting/StaticPipeTests.cs +++ b/test/Microsoft.ML.StaticPipelineTesting/StaticPipeTests.cs @@ -16,7 +16,6 @@ using Microsoft.ML.RunTests; using Microsoft.ML.StaticPipe; using Microsoft.ML.TestFramework; -using Microsoft.ML.Transforms; using Microsoft.ML.Transforms.Text; using Xunit; using Xunit.Abstractions; diff --git a/test/Microsoft.ML.Sweeper.Tests/TestSweeper.cs b/test/Microsoft.ML.Sweeper.Tests/TestSweeper.cs index 7e460fc712..ec54cd116c 100644 --- a/test/Microsoft.ML.Sweeper.Tests/TestSweeper.cs +++ b/test/Microsoft.ML.Sweeper.Tests/TestSweeper.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.RunTests; +using Microsoft.ML.Runtime; using Microsoft.ML.Sweeper.Algorithms; using Xunit; using Xunit.Abstractions; diff --git a/test/Microsoft.ML.TestFramework/Attributes/LessThanNetCore30OrNotNetCoreAndX64FactAttribute.cs b/test/Microsoft.ML.TestFramework/Attributes/LessThanNetCore30OrNotNetCoreAndX64FactAttribute.cs index 4d8814b5d6..3685d6de0c 100644 --- a/test/Microsoft.ML.TestFramework/Attributes/LessThanNetCore30OrNotNetCoreAndX64FactAttribute.cs +++ b/test/Microsoft.ML.TestFramework/Attributes/LessThanNetCore30OrNotNetCoreAndX64FactAttribute.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System; - namespace Microsoft.ML.TestFramework.Attributes { /// diff --git a/test/Microsoft.ML.TestFramework/Attributes/LessThanNetCore30OrNotNetCoreFactAttribute.cs b/test/Microsoft.ML.TestFramework/Attributes/LessThanNetCore30OrNotNetCoreFactAttribute.cs index 7fdfdf2708..d2a2e20663 100644 --- a/test/Microsoft.ML.TestFramework/Attributes/LessThanNetCore30OrNotNetCoreFactAttribute.cs +++ b/test/Microsoft.ML.TestFramework/Attributes/LessThanNetCore30OrNotNetCoreFactAttribute.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System; - namespace Microsoft.ML.TestFramework.Attributes { /// diff --git a/test/Microsoft.ML.TestFramework/Attributes/LightGBMFactAttribute.cs b/test/Microsoft.ML.TestFramework/Attributes/LightGBMFactAttribute.cs index 726d50e970..37002d545a 100644 --- a/test/Microsoft.ML.TestFramework/Attributes/LightGBMFactAttribute.cs +++ b/test/Microsoft.ML.TestFramework/Attributes/LightGBMFactAttribute.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System; - namespace Microsoft.ML.TestFramework.Attributes { /// diff --git a/test/Microsoft.ML.TestFramework/Attributes/MatrixFactorizationFactAttribute.cs b/test/Microsoft.ML.TestFramework/Attributes/MatrixFactorizationFactAttribute.cs index 8ba0bba3e1..9104008ce2 100644 --- a/test/Microsoft.ML.TestFramework/Attributes/MatrixFactorizationFactAttribute.cs +++ b/test/Microsoft.ML.TestFramework/Attributes/MatrixFactorizationFactAttribute.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System; - namespace Microsoft.ML.TestFramework.Attributes { /// diff --git a/test/Microsoft.ML.TestFramework/Attributes/TensorflowFactAttribute.cs b/test/Microsoft.ML.TestFramework/Attributes/TensorflowFactAttribute.cs index 7711e4d05f..5a84fba1b3 100644 --- a/test/Microsoft.ML.TestFramework/Attributes/TensorflowFactAttribute.cs +++ b/test/Microsoft.ML.TestFramework/Attributes/TensorflowFactAttribute.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System; - namespace Microsoft.ML.TestFramework.Attributes { /// diff --git a/test/Microsoft.ML.TestFramework/Attributes/X64FactAttribute.cs b/test/Microsoft.ML.TestFramework/Attributes/X64FactAttribute.cs index dcf8814bb8..ca654d93da 100644 --- a/test/Microsoft.ML.TestFramework/Attributes/X64FactAttribute.cs +++ b/test/Microsoft.ML.TestFramework/Attributes/X64FactAttribute.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System; - namespace Microsoft.ML.TestFramework.Attributes { /// diff --git a/test/Microsoft.ML.TestFramework/BaseTestBaseline.cs b/test/Microsoft.ML.TestFramework/BaseTestBaseline.cs index b0d1ab472e..649496d17c 100644 --- a/test/Microsoft.ML.TestFramework/BaseTestBaseline.cs +++ b/test/Microsoft.ML.TestFramework/BaseTestBaseline.cs @@ -8,8 +8,8 @@ using System.Text; using System.Text.RegularExpressions; using System.Threading; -using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.TestFramework; using Microsoft.ML.Tools; using Xunit; diff --git a/test/Microsoft.ML.TestFramework/BaseTestPredictorsMaml.cs b/test/Microsoft.ML.TestFramework/BaseTestPredictorsMaml.cs index a386878dea..179e3b3839 100644 --- a/test/Microsoft.ML.TestFramework/BaseTestPredictorsMaml.cs +++ b/test/Microsoft.ML.TestFramework/BaseTestPredictorsMaml.cs @@ -6,6 +6,7 @@ using System.IO; using System.Linq; using System.Runtime.InteropServices; +using Microsoft.ML.Runtime; namespace Microsoft.ML.RunTests { diff --git a/test/Microsoft.ML.TestFramework/BytesStreamSource.cs b/test/Microsoft.ML.TestFramework/BytesStreamSource.cs index 9e6cde69f2..893d4e8967 100644 --- a/test/Microsoft.ML.TestFramework/BytesStreamSource.cs +++ b/test/Microsoft.ML.TestFramework/BytesStreamSource.cs @@ -5,6 +5,7 @@ using System.IO; using System.Text; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; namespace Microsoft.ML.TestFramework { diff --git a/test/Microsoft.ML.TestFramework/DataPipe/TestDataPipe.cs b/test/Microsoft.ML.TestFramework/DataPipe/TestDataPipe.cs index 24458420f1..56ae2fbc0e 100644 --- a/test/Microsoft.ML.TestFramework/DataPipe/TestDataPipe.cs +++ b/test/Microsoft.ML.TestFramework/DataPipe/TestDataPipe.cs @@ -9,6 +9,7 @@ using Microsoft.ML.CommandLine; using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; using Xunit; diff --git a/test/Microsoft.ML.TestFramework/DataPipe/TestDataPipeBase.cs b/test/Microsoft.ML.TestFramework/DataPipe/TestDataPipeBase.cs index 60020c9f03..e89dbdf853 100644 --- a/test/Microsoft.ML.TestFramework/DataPipe/TestDataPipeBase.cs +++ b/test/Microsoft.ML.TestFramework/DataPipe/TestDataPipeBase.cs @@ -12,7 +12,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.TestFramework; using Xunit; diff --git a/test/Microsoft.ML.TestFramework/EnvironmentExtensions.cs b/test/Microsoft.ML.TestFramework/EnvironmentExtensions.cs index 05d9a5f10e..a8af2ec4c6 100644 --- a/test/Microsoft.ML.TestFramework/EnvironmentExtensions.cs +++ b/test/Microsoft.ML.TestFramework/EnvironmentExtensions.cs @@ -4,6 +4,7 @@ using Microsoft.ML.Data; using Microsoft.ML.EntryPoints; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Microsoft.ML.Trainers.Ensemble; using Microsoft.ML.Trainers.FastTree; diff --git a/test/Microsoft.ML.TestFramework/GlobalBase.cs b/test/Microsoft.ML.TestFramework/GlobalBase.cs index 701d6bd4e2..50d4fdcf66 100644 --- a/test/Microsoft.ML.TestFramework/GlobalBase.cs +++ b/test/Microsoft.ML.TestFramework/GlobalBase.cs @@ -12,6 +12,7 @@ using System; using System.Runtime.InteropServices; +using Microsoft.ML.Runtime; using Xunit; namespace Microsoft.ML.Internal.Internallearn.Test diff --git a/test/Microsoft.ML.TestFramework/Learners.cs b/test/Microsoft.ML.TestFramework/Learners.cs index 1f87d0b5b9..0d2015db01 100644 --- a/test/Microsoft.ML.TestFramework/Learners.cs +++ b/test/Microsoft.ML.TestFramework/Learners.cs @@ -4,6 +4,7 @@ using System.Text; using Microsoft.ML.CommandLine; +using Microsoft.ML.Runtime; using Microsoft.ML.TestFramework; using Microsoft.ML.Trainers.FastTree; diff --git a/test/Microsoft.ML.TestFramework/SubComponent.cs b/test/Microsoft.ML.TestFramework/SubComponent.cs index 5d5f177035..bfb6ece074 100644 --- a/test/Microsoft.ML.TestFramework/SubComponent.cs +++ b/test/Microsoft.ML.TestFramework/SubComponent.cs @@ -6,6 +6,7 @@ using System.Text; using Microsoft.ML.CommandLine; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; namespace Microsoft.ML.TestFramework { diff --git a/test/Microsoft.ML.TestFramework/TestCommandBase.cs b/test/Microsoft.ML.TestFramework/TestCommandBase.cs index 16aa66bd5f..24ee937489 100644 --- a/test/Microsoft.ML.TestFramework/TestCommandBase.cs +++ b/test/Microsoft.ML.TestFramework/TestCommandBase.cs @@ -14,6 +14,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.TestFramework; using Microsoft.ML.TestFramework.Attributes; using Microsoft.ML.Tools; diff --git a/test/Microsoft.ML.Tests/BinaryLoaderSaverTests.cs b/test/Microsoft.ML.Tests/BinaryLoaderSaverTests.cs index 087eeb34be..8974b44147 100644 --- a/test/Microsoft.ML.Tests/BinaryLoaderSaverTests.cs +++ b/test/Microsoft.ML.Tests/BinaryLoaderSaverTests.cs @@ -3,8 +3,6 @@ // See the LICENSE file in the project root for more information. using System.IO; -using Microsoft.ML.Data; -using Microsoft.ML.Data.IO; using Microsoft.ML.RunTests; using Xunit; using Xunit.Abstractions; diff --git a/test/Microsoft.ML.Tests/CollectionsDataViewTest.cs b/test/Microsoft.ML.Tests/CollectionsDataViewTest.cs index 4a99f342e0..7866c81d0a 100644 --- a/test/Microsoft.ML.Tests/CollectionsDataViewTest.cs +++ b/test/Microsoft.ML.Tests/CollectionsDataViewTest.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Reflection; using Microsoft.ML.Data; using Microsoft.ML.TestFramework; diff --git a/test/Microsoft.ML.Tests/FeatureContributionTests.cs b/test/Microsoft.ML.Tests/FeatureContributionTests.cs index 2625caf4ae..fc6469f809 100644 --- a/test/Microsoft.ML.Tests/FeatureContributionTests.cs +++ b/test/Microsoft.ML.Tests/FeatureContributionTests.cs @@ -7,7 +7,6 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.Data.IO; -using Microsoft.ML.Internal.Internallearn; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Model; using Microsoft.ML.RunTests; diff --git a/test/Microsoft.ML.Tests/ImagesTests.cs b/test/Microsoft.ML.Tests/ImagesTests.cs index 80c5923b57..c6fe354e6e 100644 --- a/test/Microsoft.ML.Tests/ImagesTests.cs +++ b/test/Microsoft.ML.Tests/ImagesTests.cs @@ -4,7 +4,6 @@ using System; using System.Drawing; -using System.Drawing.Imaging; using System.IO; using System.Linq; using Microsoft.Data.DataView; @@ -12,6 +11,7 @@ using Microsoft.ML.ImageAnalytics; using Microsoft.ML.Model; using Microsoft.ML.RunTests; +using Microsoft.ML.Runtime; using Xunit; using Xunit.Abstractions; diff --git a/test/Microsoft.ML.Tests/OnnxConversionTest.cs b/test/Microsoft.ML.Tests/OnnxConversionTest.cs index 7645ddfbe9..bac121f2a0 100644 --- a/test/Microsoft.ML.Tests/OnnxConversionTest.cs +++ b/test/Microsoft.ML.Tests/OnnxConversionTest.cs @@ -13,6 +13,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Model.OnnxConverter; using Microsoft.ML.RunTests; +using Microsoft.ML.Runtime; using Microsoft.ML.TestFramework.Attributes; using Microsoft.ML.Tools; using Microsoft.ML.Trainers; diff --git a/test/Microsoft.ML.Tests/Scenarios/Api/Estimators/MultithreadedPrediction.cs b/test/Microsoft.ML.Tests/Scenarios/Api/Estimators/MultithreadedPrediction.cs index 1cbb1bbb95..843795ed75 100644 --- a/test/Microsoft.ML.Tests/Scenarios/Api/Estimators/MultithreadedPrediction.cs +++ b/test/Microsoft.ML.Tests/Scenarios/Api/Estimators/MultithreadedPrediction.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System.Threading.Tasks; -using Microsoft.ML.Data; using Microsoft.ML.RunTests; using Microsoft.ML.Trainers; using Xunit; diff --git a/test/Microsoft.ML.Tests/Scenarios/Api/Estimators/SimpleTrainAndPredict.cs b/test/Microsoft.ML.Tests/Scenarios/Api/Estimators/SimpleTrainAndPredict.cs index 389adc9ca5..154bac9986 100644 --- a/test/Microsoft.ML.Tests/Scenarios/Api/Estimators/SimpleTrainAndPredict.cs +++ b/test/Microsoft.ML.Tests/Scenarios/Api/Estimators/SimpleTrainAndPredict.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System.Linq; -using Microsoft.ML.Data; using Microsoft.ML.RunTests; using Microsoft.ML.Trainers; using Xunit; diff --git a/test/Microsoft.ML.Tests/Scenarios/Api/TestApi.cs b/test/Microsoft.ML.Tests/Scenarios/Api/TestApi.cs index 5428dd8dba..a1fb6691e0 100644 --- a/test/Microsoft.ML.Tests/Scenarios/Api/TestApi.cs +++ b/test/Microsoft.ML.Tests/Scenarios/Api/TestApi.cs @@ -10,6 +10,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Data.IO; using Microsoft.ML.Internal.Utilities; +using Microsoft.ML.Runtime; using Microsoft.ML.TestFramework; using Microsoft.ML.Trainers; using Microsoft.ML.Transforms; diff --git a/test/Microsoft.ML.Tests/Scenarios/GetColumnTests.cs b/test/Microsoft.ML.Tests/Scenarios/GetColumnTests.cs index e3e76ae7b5..0d0e191046 100644 --- a/test/Microsoft.ML.Tests/Scenarios/GetColumnTests.cs +++ b/test/Microsoft.ML.Tests/Scenarios/GetColumnTests.cs @@ -7,6 +7,7 @@ using System.Reflection; using Microsoft.ML.Data; using Microsoft.ML.RunTests; +using Microsoft.ML.Runtime; using Microsoft.ML.StaticPipe; using Microsoft.ML.TestFramework; using Xunit; diff --git a/test/Microsoft.ML.Tests/TextLoaderTests.cs b/test/Microsoft.ML.Tests/TextLoaderTests.cs index 51b79fc643..6e95e1aff4 100644 --- a/test/Microsoft.ML.Tests/TextLoaderTests.cs +++ b/test/Microsoft.ML.Tests/TextLoaderTests.cs @@ -9,6 +9,7 @@ using Microsoft.ML.Data; using Microsoft.ML.Model; using Microsoft.ML.RunTests; +using Microsoft.ML.Runtime; using Microsoft.ML.TestFramework; using Newtonsoft.Json.Linq; using Xunit; diff --git a/test/Microsoft.ML.Tests/TrainerEstimators/LbfgsTests.cs b/test/Microsoft.ML.Tests/TrainerEstimators/LbfgsTests.cs index 0e63507710..d8483f6ee5 100644 --- a/test/Microsoft.ML.Tests/TrainerEstimators/LbfgsTests.cs +++ b/test/Microsoft.ML.Tests/TrainerEstimators/LbfgsTests.cs @@ -3,13 +3,13 @@ // See the LICENSE file in the project root for more information. using Microsoft.Data.DataView; -using Microsoft.ML.Data; using Microsoft.ML.Calibrators; +using Microsoft.ML.Data; using Microsoft.ML.Trainers; using Xunit; namespace Microsoft.ML.Tests.TrainerEstimators - { +{ public partial class TrainerEstimators { [Fact] diff --git a/test/Microsoft.ML.Tests/TrainerEstimators/OnlineLinearTests.cs b/test/Microsoft.ML.Tests/TrainerEstimators/OnlineLinearTests.cs index a4c91e954e..73f4d85ddb 100644 --- a/test/Microsoft.ML.Tests/TrainerEstimators/OnlineLinearTests.cs +++ b/test/Microsoft.ML.Tests/TrainerEstimators/OnlineLinearTests.cs @@ -3,8 +3,8 @@ // See the LICENSE file in the project root for more information. using Microsoft.ML; -using Microsoft.ML.StaticPipe; using Microsoft.ML.Trainers; +using Microsoft.ML.StaticPipe; using Xunit; namespace Microsoft.ML.Tests.TrainerEstimators diff --git a/test/Microsoft.ML.Tests/TrainerEstimators/SymSgdClassificationTests.cs b/test/Microsoft.ML.Tests/TrainerEstimators/SymSgdClassificationTests.cs index 4074049b07..de14f52c56 100644 --- a/test/Microsoft.ML.Tests/TrainerEstimators/SymSgdClassificationTests.cs +++ b/test/Microsoft.ML.Tests/TrainerEstimators/SymSgdClassificationTests.cs @@ -4,6 +4,7 @@ using System.Linq; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.Trainers; using Xunit; diff --git a/test/Microsoft.ML.Tests/TrainerEstimators/TreeEstimators.cs b/test/Microsoft.ML.Tests/TrainerEstimators/TreeEstimators.cs index d1394255e8..21d6eedf92 100644 --- a/test/Microsoft.ML.Tests/TrainerEstimators/TreeEstimators.cs +++ b/test/Microsoft.ML.Tests/TrainerEstimators/TreeEstimators.cs @@ -10,6 +10,7 @@ using Microsoft.ML.Internal.Utilities; using Microsoft.ML.LightGBM; using Microsoft.ML.RunTests; +using Microsoft.ML.Runtime; using Microsoft.ML.TestFramework.Attributes; using Microsoft.ML.Trainers.FastTree; using Microsoft.ML.Transforms; diff --git a/test/Microsoft.ML.Tests/Transformers/CopyColumnEstimatorTests.cs b/test/Microsoft.ML.Tests/Transformers/CopyColumnEstimatorTests.cs index a6fa96f258..382b257868 100644 --- a/test/Microsoft.ML.Tests/Transformers/CopyColumnEstimatorTests.cs +++ b/test/Microsoft.ML.Tests/Transformers/CopyColumnEstimatorTests.cs @@ -7,6 +7,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; using Microsoft.ML.Tools; using Microsoft.ML.Transforms; using Xunit; diff --git a/test/Microsoft.ML.Tests/Transformers/CustomMappingTests.cs b/test/Microsoft.ML.Tests/Transformers/CustomMappingTests.cs index e478c757aa..91c2bfc0c9 100644 --- a/test/Microsoft.ML.Tests/Transformers/CustomMappingTests.cs +++ b/test/Microsoft.ML.Tests/Transformers/CustomMappingTests.cs @@ -7,6 +7,7 @@ using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.RunTests; +using Microsoft.ML.Runtime; using Microsoft.ML.Transforms; using Xunit; using Xunit.Abstractions; diff --git a/test/Microsoft.ML.Tests/Transformers/FeatureSelectionTests.cs b/test/Microsoft.ML.Tests/Transformers/FeatureSelectionTests.cs index 55d802bc83..2739b9e41a 100644 --- a/test/Microsoft.ML.Tests/Transformers/FeatureSelectionTests.cs +++ b/test/Microsoft.ML.Tests/Transformers/FeatureSelectionTests.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System.IO; -using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.Data.IO; using Microsoft.ML.Model; diff --git a/test/Microsoft.ML.Tests/Transformers/GroupUngroup.cs b/test/Microsoft.ML.Tests/Transformers/GroupUngroup.cs index e69dd1c7bf..50a0414cca 100644 --- a/test/Microsoft.ML.Tests/Transformers/GroupUngroup.cs +++ b/test/Microsoft.ML.Tests/Transformers/GroupUngroup.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.Linq; -using Microsoft.ML.Data; using Microsoft.ML.RunTests; using Microsoft.ML.Transforms; using Xunit; diff --git a/test/Microsoft.ML.Tests/Transformers/NAIndicatorTests.cs b/test/Microsoft.ML.Tests/Transformers/NAIndicatorTests.cs index 369495ebf5..fe1b0a8d9f 100644 --- a/test/Microsoft.ML.Tests/Transformers/NAIndicatorTests.cs +++ b/test/Microsoft.ML.Tests/Transformers/NAIndicatorTests.cs @@ -8,6 +8,7 @@ using Microsoft.ML.Data.IO; using Microsoft.ML.Model; using Microsoft.ML.RunTests; +using Microsoft.ML.Runtime; using Microsoft.ML.StaticPipe; using Microsoft.ML.Tools; using Xunit; diff --git a/test/Microsoft.ML.Tests/Transformers/NormalizerTests.cs b/test/Microsoft.ML.Tests/Transformers/NormalizerTests.cs index 36a316aba9..af9cd61078 100644 --- a/test/Microsoft.ML.Tests/Transformers/NormalizerTests.cs +++ b/test/Microsoft.ML.Tests/Transformers/NormalizerTests.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Immutable; using System.IO; -using Microsoft.Data.DataView; using Microsoft.ML.Data; using Microsoft.ML.Data.IO; using Microsoft.ML.Model; diff --git a/test/Microsoft.ML.Tests/Transformers/PcaTests.cs b/test/Microsoft.ML.Tests/Transformers/PcaTests.cs index 6c973951fb..2cee00a560 100644 --- a/test/Microsoft.ML.Tests/Transformers/PcaTests.cs +++ b/test/Microsoft.ML.Tests/Transformers/PcaTests.cs @@ -6,7 +6,6 @@ using Microsoft.ML.Data.IO; using Microsoft.ML.RunTests; using Microsoft.ML.StaticPipe; -using Microsoft.ML.Transforms; using Xunit; using Xunit.Abstractions; diff --git a/test/Microsoft.ML.Tests/Transformers/TextFeaturizerTests.cs b/test/Microsoft.ML.Tests/Transformers/TextFeaturizerTests.cs index 673550aaf5..13c97bbcfb 100644 --- a/test/Microsoft.ML.Tests/Transformers/TextFeaturizerTests.cs +++ b/test/Microsoft.ML.Tests/Transformers/TextFeaturizerTests.cs @@ -10,6 +10,7 @@ using Microsoft.ML.Data.IO; using Microsoft.ML.Model; using Microsoft.ML.RunTests; +using Microsoft.ML.Runtime; using Microsoft.ML.StaticPipe; using Microsoft.ML.Tools; using Microsoft.ML.Transforms; diff --git a/test/Microsoft.ML.Tests/Transformers/TextNormalizer.cs b/test/Microsoft.ML.Tests/Transformers/TextNormalizer.cs index 7a0aabea47..2fa94c1cc9 100644 --- a/test/Microsoft.ML.Tests/Transformers/TextNormalizer.cs +++ b/test/Microsoft.ML.Tests/Transformers/TextNormalizer.cs @@ -4,12 +4,10 @@ using System.IO; using Microsoft.ML.Data; -using Microsoft.ML.Data.IO; using Microsoft.ML.Model; using Microsoft.ML.RunTests; using Microsoft.ML.StaticPipe; using Microsoft.ML.Tools; -using Microsoft.ML.Transforms; using Microsoft.ML.Transforms.Text; using Xunit; using Xunit.Abstractions; diff --git a/test/Microsoft.ML.Tests/Transformers/WordTokenizeTests.cs b/test/Microsoft.ML.Tests/Transformers/WordTokenizeTests.cs index c6aae98bf6..36f1ea47b9 100644 --- a/test/Microsoft.ML.Tests/Transformers/WordTokenizeTests.cs +++ b/test/Microsoft.ML.Tests/Transformers/WordTokenizeTests.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System.Collections.Generic; using System.IO; using System.Linq; using Microsoft.ML.Data; diff --git a/test/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs b/test/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs index 13adabd9f6..32f3d24606 100644 --- a/test/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs +++ b/test/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs @@ -3,11 +3,9 @@ // See the LICENSE file in the project root for more information. using System; -using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.ExceptionServices; -using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; From 9d34c57eb40a487d9ab86cbd0c491358ebb6a5a0 Mon Sep 17 00:00:00 2001 From: Senja Filipi Date: Thu, 7 Mar 2019 15:06:50 -0800 Subject: [PATCH 4/6] adding back the semingly unused usings. the 115 tests in CpuMathUtilsUnitTests pass locally --- test/Microsoft.ML.Benchmarks.Tests/BenchmarksTest.cs | 2 ++ .../Code/ContractsCheckTest.cs | 2 +- test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs | 6 +++--- .../Resources/BestFriendDeclaration.cs | 2 +- .../Resources/BestFriendOnPublicDeclaration.cs | 4 ++-- .../Resources/BestFriendUser.cs | 2 +- .../Resources/ContractsCheckAfterFix.cs | 4 ++-- .../Resources/ContractsCheckBeforeFix.cs | 4 ++-- .../Resources/ContractsCheckResource.cs | 4 ++-- .../Resources/TypeIsSchemaShapeClassResource.cs | 8 ++++---- .../Resources/TypeIsSchemaShapeResource.cs | 6 +++--- .../Resources/TypeIsSchemaShapeResourceChained.cs | 6 +++--- .../AvxPerformanceTests.cs | 4 ++++ .../NativePerformanceTests.cs | 6 +++++- .../PerformanceTests.cs | 5 ++++- test/Microsoft.ML.CpuMath.PerformanceTests/Program.cs | 5 ++++- .../SmallInputCpuMathPerformanceTests.cs | 4 +++- .../SsePerformanceTests.cs | 5 ++++- test/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs | 2 ++ 19 files changed, 52 insertions(+), 29 deletions(-) diff --git a/test/Microsoft.ML.Benchmarks.Tests/BenchmarksTest.cs b/test/Microsoft.ML.Benchmarks.Tests/BenchmarksTest.cs index ccf1898dce..9dc6854e8b 100644 --- a/test/Microsoft.ML.Benchmarks.Tests/BenchmarksTest.cs +++ b/test/Microsoft.ML.Benchmarks.Tests/BenchmarksTest.cs @@ -3,8 +3,10 @@ // See the LICENSE file in the project root for more information. using System; +using System.Collections.Generic; using System.Linq; using System.Reflection; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Loggers; diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs index 7748572bad..6ea2adc007 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs @@ -67,7 +67,7 @@ public async Task ContractsCheckDecoy() // except the namespace is distinct so it is a different type. We should not find // diagnostics on a class like this! const string decoySource = @" -using System; using Microsoft.ML.Runtime; +using System; namespace TestNamespace { public static class Contracts diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs index cdbd80e262..d2d4eb1e49 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/NameTest.cs @@ -90,7 +90,7 @@ public async Task MoreNameTests() } internal const string TestSource = @" -using System; using Microsoft.ML.Runtime; +using System; namespace silly { } namespace NotSilly { } namespace foo.bar.Biz @@ -132,7 +132,7 @@ struct marco { public int polo; } public async Task ExternName() { const string source = @" -using System; using Microsoft.ML.Runtime; +using System; using System.Runtime.InteropServices; namespace TestNamespace @@ -157,7 +157,7 @@ public void masterBlaster() {} } private const string FixedTestSource = @" -using System; using Microsoft.ML.Runtime; +using System; namespace silly { } namespace NotSilly { } namespace foo.bar.Biz diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendDeclaration.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendDeclaration.cs index 629470d49f..bb7e717e99 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendDeclaration.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendDeclaration.cs @@ -1,5 +1,5 @@ using System.Runtime.CompilerServices; -using Microsoft.ML.Runtime; using Microsoft.ML; +using Microsoft.ML; [assembly: InternalsVisibleTo("ProjectB")] [assembly: WantsToBeBestFriends] diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendOnPublicDeclaration.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendOnPublicDeclaration.cs index a308f5da44..1515f21e1f 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendOnPublicDeclaration.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendOnPublicDeclaration.cs @@ -1,5 +1,5 @@ -using System; using Microsoft.ML.Runtime; -using Microsoft.ML.Runtime; using Microsoft.ML; +using System; +using Microsoft.ML; namespace TestNamespace { diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendUser.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendUser.cs index 334436ac42..b44a919c6e 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendUser.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/BestFriendUser.cs @@ -1,4 +1,4 @@ -using System; using Microsoft.ML.Runtime; +using System; using Bubba; namespace McGee diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckAfterFix.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckAfterFix.cs index 03c79b37bc..1783bdf1bc 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckAfterFix.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckAfterFix.cs @@ -1,6 +1,6 @@ -using Microsoft.ML.Runtime; using Microsoft.ML; +using Microsoft.ML; using Microsoft.ML.CommandLine; -using System; using Microsoft.ML.Runtime; +using System; namespace Bubba { public class Foo diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckBeforeFix.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckBeforeFix.cs index 8303756fb7..6c6cc61c47 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckBeforeFix.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckBeforeFix.cs @@ -1,6 +1,6 @@ -using Microsoft.ML.Runtime; using Microsoft.ML; +using Microsoft.ML; using Microsoft.ML.CommandLine; -using System; using Microsoft.ML.Runtime; +using System; namespace Bubba { public class Foo diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckResource.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckResource.cs index a8fdbb1d10..05aed26e5f 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckResource.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckResource.cs @@ -3,8 +3,8 @@ // code, as well as code for "Contracts" derived from and intended to resemble // the corresponding code in ML.NET. -using System; using Microsoft.ML.Runtime; -using Microsoft.ML.Runtime; using Microsoft.ML; +using System; +using Microsoft.ML; using Microsoft.ML.Model; namespace TestNamespace diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeClassResource.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeClassResource.cs index 8370f70856..54526c133d 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeClassResource.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeClassResource.cs @@ -1,7 +1,7 @@ -using System; using Microsoft.ML.Runtime; -using Microsoft.Data.DataView; using Microsoft.ML.Runtime; -using Microsoft.ML.Runtime; using Microsoft.ML; -using Microsoft.ML.Runtime; using Microsoft.ML.Data; +using System; +using Microsoft.Data.DataView; +using Microsoft.ML; +using Microsoft.ML.Data; using Microsoft.ML.StaticPipe; namespace Bubba diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResource.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResource.cs index bbaf6f0d2f..23fef3c12c 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResource.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResource.cs @@ -1,7 +1,7 @@ -using System; using Microsoft.ML.Runtime; -using Microsoft.ML.Runtime; using Microsoft.ML; +using System; +using Microsoft.ML; using Microsoft.ML.CommandLine; -using Microsoft.ML.Runtime; using Microsoft.ML.Data; +using Microsoft.ML.Data; using Microsoft.ML.StaticPipe; namespace Bubba diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResourceChained.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResourceChained.cs index 9c75cb70af..780365f135 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResourceChained.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResourceChained.cs @@ -1,8 +1,8 @@ -using System; using Microsoft.ML.Runtime; +using System; using System.Collections.Generic; -using Microsoft.ML.Runtime; using Microsoft.ML; +using Microsoft.ML; using Microsoft.ML.CommandLine; -using Microsoft.ML.Runtime; using Microsoft.ML.Data; +using Microsoft.ML.Data; using Microsoft.ML.StaticPipe; namespace Bubba diff --git a/test/Microsoft.ML.CpuMath.PerformanceTests/AvxPerformanceTests.cs b/test/Microsoft.ML.CpuMath.PerformanceTests/AvxPerformanceTests.cs index 2391ec7cfb..af89929c71 100644 --- a/test/Microsoft.ML.CpuMath.PerformanceTests/AvxPerformanceTests.cs +++ b/test/Microsoft.ML.CpuMath.PerformanceTests/AvxPerformanceTests.cs @@ -2,6 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Running; +using Microsoft.ML.Internal.CpuMath; namespace Microsoft.ML.CpuMath.PerformanceTests { diff --git a/test/Microsoft.ML.CpuMath.PerformanceTests/NativePerformanceTests.cs b/test/Microsoft.ML.CpuMath.PerformanceTests/NativePerformanceTests.cs index 4db3b6390e..d59b748517 100644 --- a/test/Microsoft.ML.CpuMath.PerformanceTests/NativePerformanceTests.cs +++ b/test/Microsoft.ML.CpuMath.PerformanceTests/NativePerformanceTests.cs @@ -1,7 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. - +using System; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Running; +using Microsoft.ML.Internal.CpuMath; +using Microsoft.ML.Internal.CpuMath.Core; namespace Microsoft.ML.CpuMath.PerformanceTests { diff --git a/test/Microsoft.ML.CpuMath.PerformanceTests/PerformanceTests.cs b/test/Microsoft.ML.CpuMath.PerformanceTests/PerformanceTests.cs index 35597e42bd..e3948c0ecc 100644 --- a/test/Microsoft.ML.CpuMath.PerformanceTests/PerformanceTests.cs +++ b/test/Microsoft.ML.CpuMath.PerformanceTests/PerformanceTests.cs @@ -1,7 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. - +using System; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Running; +using Microsoft.ML.Internal.CpuMath; namespace Microsoft.ML.CpuMath.PerformanceTests { diff --git a/test/Microsoft.ML.CpuMath.PerformanceTests/Program.cs b/test/Microsoft.ML.CpuMath.PerformanceTests/Program.cs index 88cd2bd729..9883e36501 100644 --- a/test/Microsoft.ML.CpuMath.PerformanceTests/Program.cs +++ b/test/Microsoft.ML.CpuMath.PerformanceTests/Program.cs @@ -1,7 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. - +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Jobs; +using BenchmarkDotNet.Running; +using BenchmarkDotNet.Toolchains.InProcess; namespace Microsoft.ML.CpuMath.PerformanceTests { diff --git a/test/Microsoft.ML.CpuMath.PerformanceTests/SmallInputCpuMathPerformanceTests.cs b/test/Microsoft.ML.CpuMath.PerformanceTests/SmallInputCpuMathPerformanceTests.cs index ca1b2355a1..619bd7948f 100644 --- a/test/Microsoft.ML.CpuMath.PerformanceTests/SmallInputCpuMathPerformanceTests.cs +++ b/test/Microsoft.ML.CpuMath.PerformanceTests/SmallInputCpuMathPerformanceTests.cs @@ -1,7 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. - +using System; +using BenchmarkDotNet.Attributes; +using Microsoft.ML.Internal.CpuMath; namespace Microsoft.ML.CpuMath.PerformanceTests { diff --git a/test/Microsoft.ML.CpuMath.PerformanceTests/SsePerformanceTests.cs b/test/Microsoft.ML.CpuMath.PerformanceTests/SsePerformanceTests.cs index 875c8fa59e..653ed3da7b 100644 --- a/test/Microsoft.ML.CpuMath.PerformanceTests/SsePerformanceTests.cs +++ b/test/Microsoft.ML.CpuMath.PerformanceTests/SsePerformanceTests.cs @@ -1,7 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. - +using System; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Running; +using Microsoft.ML.Internal.CpuMath; namespace Microsoft.ML.CpuMath.PerformanceTests { diff --git a/test/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs b/test/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs index 32f3d24606..13adabd9f6 100644 --- a/test/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs +++ b/test/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs @@ -3,9 +3,11 @@ // See the LICENSE file in the project root for more information. using System; +using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.ExceptionServices; +using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; From 1fdef7c651f6534edf819cc5eb5c305db5455097 Mon Sep 17 00:00:00 2001 From: Senja Filipi Date: Thu, 7 Mar 2019 16:37:12 -0800 Subject: [PATCH 5/6] restoring some readonly and casts. Fixing 3 out of 5 analyzer test failures. --- src/Microsoft.ML.Core/Utilities/Stats.cs | 2 +- .../MultiOutputRegressionEvaluator.cs | 4 +-- .../Prediction/Calibrator.cs | 8 ++--- .../TreeEnsembleFeaturizer.cs | 4 +-- .../PartitionedFileLoader.cs | 4 +-- .../TypeIsSchemaShapeClassResource.cs | 1 + .../Resources/TypeIsSchemaShapeResource.cs | 1 + .../TypeIsSchemaShapeResourceChained.cs | 1 + .../TypeIsSchemaShapeTest.cs | 34 +++++++++---------- .../ContractsCheckAnalyzer.cs | 2 +- 10 files changed, 32 insertions(+), 29 deletions(-) diff --git a/src/Microsoft.ML.Core/Utilities/Stats.cs b/src/Microsoft.ML.Core/Utilities/Stats.cs index a717e9a5b0..a71014e2a0 100644 --- a/src/Microsoft.ML.Core/Utilities/Stats.cs +++ b/src/Microsoft.ML.Core/Utilities/Stats.cs @@ -42,7 +42,7 @@ public static long SampleLong(long rangeSize, Random rand) return result; } - private static readonly double _vScale = 2 * Math.Sqrt(2 / Math.E); + private static double _vScale = 2 * Math.Sqrt(2 / Math.E); /// /// Returns a number sampled from a zero-mean, unit variance Gaussian diff --git a/src/Microsoft.ML.Data/Evaluators/MultiOutputRegressionEvaluator.cs b/src/Microsoft.ML.Data/Evaluators/MultiOutputRegressionEvaluator.cs index c862e868e1..d63df28329 100644 --- a/src/Microsoft.ML.Data/Evaluators/MultiOutputRegressionEvaluator.cs +++ b/src/Microsoft.ML.Data/Evaluators/MultiOutputRegressionEvaluator.cs @@ -550,7 +550,7 @@ private void CheckInputColumnTypes(DataViewSchema schema, out VectorType labelTy var t = schema[LabelIndex].Type as VectorType; if (t == null || !t.IsKnownSize || (t.ItemType != NumberDataViewType.Single && t.ItemType != NumberDataViewType.Double)) throw Host.ExceptSchemaMismatch(nameof(schema), "label", LabelCol, "known-size vector of float or double", t.ToString()); - labelType = new VectorType(t.ItemType, t.Size); + labelType = new VectorType((PrimitiveDataViewType)t.ItemType, t.Size); var slotNamesType = new VectorType(TextDataViewType.Instance, t.Size); var builder = new DataViewSchema.Annotations.Builder(); builder.AddSlotNames(t.Size, CreateSlotNamesGetter(schema, LabelIndex, labelType.Size, "True")); @@ -559,7 +559,7 @@ private void CheckInputColumnTypes(DataViewSchema schema, out VectorType labelTy t = schema[ScoreIndex].Type as VectorType; if (t == null || !t.IsKnownSize || t.ItemType != NumberDataViewType.Single) throw Host.ExceptSchemaMismatch(nameof(schema), "score", ScoreCol, "known-size vector of float", t.ToString()); - scoreType = new VectorType(t.ItemType, t.Size); + scoreType = new VectorType((PrimitiveDataViewType)t.ItemType, t.Size); builder = new DataViewSchema.Annotations.Builder(); builder.AddSlotNames(t.Size, CreateSlotNamesGetter(schema, ScoreIndex, scoreType.Size, "Predicted")); diff --git a/src/Microsoft.ML.Data/Prediction/Calibrator.cs b/src/Microsoft.ML.Data/Prediction/Calibrator.cs index 1504149501..26db83e11b 100644 --- a/src/Microsoft.ML.Data/Prediction/Calibrator.cs +++ b/src/Microsoft.ML.Data/Prediction/Calibrator.cs @@ -472,7 +472,7 @@ private FeatureWeightsCalibratedModelParameters(IHostEnvironment env, ModelLoadC : base(env, RegistrationName, GetPredictor(env, ctx), GetCalibrator(env, ctx)) { Host.Check(SubModel is IPredictorWithFeatureWeights, "Predictor does not implement " + nameof(IPredictorWithFeatureWeights)); - _featureWeights = SubModel; + _featureWeights = (IPredictorWithFeatureWeights)SubModel; } private static FeatureWeightsCalibratedModelParameters Create(IHostEnvironment env, ModelLoadContext ctx) @@ -1630,13 +1630,13 @@ private void SaveCore(ModelSaveContext ctx) if (ctx.InRepository) { - ctx.SaveTextStream("Calibrator.txt", writer => + ctx.SaveTextStream("Calibrator.txt", (Action)(writer => { writer.WriteLine("Platt calibrator"); writer.WriteLine("P(y=1|x) = 1/1+exp(A*x + B)"); - writer.WriteLine("A={0:R}", Slope); + writer.WriteLine("A={0:R}", (object)Slope); writer.WriteLine("B={0:R}", Offset); - }); + })); } } diff --git a/src/Microsoft.ML.FastTree/TreeEnsembleFeaturizer.cs b/src/Microsoft.ML.FastTree/TreeEnsembleFeaturizer.cs index b250fb5e1d..6ff3bb504b 100644 --- a/src/Microsoft.ML.FastTree/TreeEnsembleFeaturizer.cs +++ b/src/Microsoft.ML.FastTree/TreeEnsembleFeaturizer.cs @@ -697,7 +697,7 @@ private static IDataView AppendFloatMapper(IHostEnvironment env, IChanne return; } converter(in src, ref temp); - dst = temp - 1; + dst = (Single)temp - 1; }; } else @@ -713,7 +713,7 @@ private static IDataView AppendFloatMapper(IHostEnvironment env, IChanne return; } converter(in src, ref temp); - dst = permutation[(int)(temp - 1)]; + dst = (Single)permutation[(int)(temp - 1)]; }; } diff --git a/src/Microsoft.ML.Parquet/PartitionedFileLoader.cs b/src/Microsoft.ML.Parquet/PartitionedFileLoader.cs index 6dd7c4ef24..2e1e2ee043 100644 --- a/src/Microsoft.ML.Parquet/PartitionedFileLoader.cs +++ b/src/Microsoft.ML.Parquet/PartitionedFileLoader.cs @@ -369,8 +369,8 @@ private sealed class Cursor : RootCursorBase private readonly bool[] _active; private readonly bool[] _subActive; // Active columns of the sub-cursor. - private readonly Delegate[] _getters; - private readonly Delegate[] _subGetters; // Cached getters of the sub-cursor. + private Delegate[] _getters; + private Delegate[] _subGetters; // Cached getters of the sub-cursor. private readonly IEnumerable _columnsNeeded; private readonly IEnumerable _subActivecolumnsNeeded; diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeClassResource.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeClassResource.cs index 54526c133d..f6c1fea919 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeClassResource.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeClassResource.cs @@ -2,6 +2,7 @@ using Microsoft.Data.DataView; using Microsoft.ML; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.StaticPipe; namespace Bubba diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResource.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResource.cs index 23fef3c12c..a53edf9543 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResource.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResource.cs @@ -2,6 +2,7 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.StaticPipe; namespace Bubba diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResourceChained.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResourceChained.cs index 780365f135..735583db5d 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResourceChained.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/TypeIsSchemaShapeResourceChained.cs @@ -3,6 +3,7 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; +using Microsoft.ML.Runtime; using Microsoft.ML.StaticPipe; namespace Bubba diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/TypeIsSchemaShapeTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/TypeIsSchemaShapeTest.cs index 19bb9336f3..faa8de31d1 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/TypeIsSchemaShapeTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/TypeIsSchemaShapeTest.cs @@ -22,10 +22,10 @@ public sealed class TypeIsSchemaShapeTest public async Task ReturnTypeIsSchemaShape() { var expected = new DiagnosticResult[] { - VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeDiagnostic.Rule).WithLocation(23, 13).WithArguments(""), - VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeDiagnostic.Rule).WithLocation(24, 13).WithArguments(" of item bad"), - VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeDiagnostic.Rule).WithLocation(30, 13).WithArguments(" of item c.Item2"), - VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeDiagnostic.Rule).WithLocation(40, 13).WithArguments(" of item listen"), + VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeDiagnostic.Rule).WithLocation(24, 13).WithArguments(""), + VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeDiagnostic.Rule).WithLocation(25, 13).WithArguments(" of item bad"), + VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeDiagnostic.Rule).WithLocation(31, 13).WithArguments(" of item c.Item2"), + VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeDiagnostic.Rule).WithLocation(41, 13).WithArguments(" of item listen"), }; var test = new VerifyCS.Test { TestCode = Source }; @@ -45,10 +45,10 @@ public async Task ReturnTypeIsSchemaShapeChained() // function where the shape type is a generic type parameter. In this case, we would ideally like the analysis to get // chained out of their function. var expected = new DiagnosticResult[] { - VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeParameterDiagnostic.Rule).WithLocation(18, 24).WithArguments("T"), - new DiagnosticResult("CS8205", DiagnosticSeverity.Error).WithLocation(21, 52).WithMessage("Attributes are not allowed on local function parameters or type parameters"), - VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeParameterDiagnostic.Rule).WithLocation(41, 24).WithArguments("T"), - VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeDiagnostic.Rule).WithLocation(55, 26).WithArguments(" of item text"), + VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeParameterDiagnostic.Rule).WithLocation(19, 24).WithArguments("T"), + new DiagnosticResult("CS8205", DiagnosticSeverity.Error).WithLocation(22, 52).WithMessage("Attributes are not allowed on local function parameters or type parameters"), + VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeParameterDiagnostic.Rule).WithLocation(42, 24).WithArguments("T"), + VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeDiagnostic.Rule).WithLocation(56, 26).WithArguments(" of item text"), }; var test = new VerifyCS.Test { TestCode = SourceChained }; @@ -68,17 +68,17 @@ public async Task ReturnTypeIsSchemaShapeClass() // function where the shape type is a generic type parameter. In this case, we would ideally like the analysis to get // chained out of their function. var expected = new DiagnosticResult[] { - VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeClassDiagnosticField.Rule).WithLocation(33, 13).WithArguments("Class4", "F1"), - VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeClassDiagnosticConstructor.Rule).WithLocation(34, 13).WithArguments("Class5"), - VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeClassDiagnosticConstructor.Rule).WithLocation(35, 13).WithArguments("Class6"), + VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeClassDiagnosticField.Rule).WithLocation(34, 13).WithArguments("Class4", "F1"), + VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeClassDiagnosticConstructor.Rule).WithLocation(35, 13).WithArguments("Class5"), + VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeClassDiagnosticConstructor.Rule).WithLocation(36, 13).WithArguments("Class6"), - VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeClassDiagnosticNoArgsSettable.Rule).WithLocation(36, 13).WithArguments("Class7", "F1"), - VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeClassDiagnosticArgsSettable.Rule).WithLocation(37, 13).WithArguments("Class8", "F2"), - VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeClassDiagnosticGettable.Rule).WithLocation(38, 13).WithArguments("Class9", "F2"), - VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeClassDiagnosticCorrespondence.Rule).WithLocation(39, 13).WithArguments("Class10"), - VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeClassDiagnosticCorrespondence.Rule).WithLocation(40, 13).WithArguments("Class11"), + VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeClassDiagnosticNoArgsSettable.Rule).WithLocation(37, 13).WithArguments("Class7", "F1"), + VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeClassDiagnosticArgsSettable.Rule).WithLocation(38, 13).WithArguments("Class8", "F2"), + VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeClassDiagnosticGettable.Rule).WithLocation(39, 13).WithArguments("Class9", "F2"), + VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeClassDiagnosticCorrespondence.Rule).WithLocation(40, 13).WithArguments("Class10"), + VerifyCS.Diagnostic(TypeIsSchemaShapeAnalyzer.ShapeClassDiagnosticCorrespondence.Rule).WithLocation(41, 13).WithArguments("Class11"), - new DiagnosticResult("CS0246", DiagnosticSeverity.Error).WithLocation(44, 71).WithMessage("The type or namespace name 'MissingClass' could not be found (are you missing a using directive or an assembly reference?)"), + new DiagnosticResult("CS0246", DiagnosticSeverity.Error).WithLocation(45, 71).WithMessage("The type or namespace name 'MissingClass' could not be found (are you missing a using directive or an assembly reference?)"), }; var test = new VerifyCS.Test { TestCode = SourceClass }; diff --git a/tools-local/Microsoft.ML.InternalCodeAnalyzer/ContractsCheckAnalyzer.cs b/tools-local/Microsoft.ML.InternalCodeAnalyzer/ContractsCheckAnalyzer.cs index c5fa8f6b5d..db99ac414c 100644 --- a/tools-local/Microsoft.ML.InternalCodeAnalyzer/ContractsCheckAnalyzer.cs +++ b/tools-local/Microsoft.ML.InternalCodeAnalyzer/ContractsCheckAnalyzer.cs @@ -198,7 +198,7 @@ private static void Analyze(SyntaxNodeAnalysisContext context) // but for some reason cannot reference MLCore. // Contract functions defined Microsoft.ML.Internal.CpuMath.Core are introduced for breaking the dependencies // from CpuMath project to Microsoft.ML.Core. - if (containingSymbolName != "Microsoft.ML.Contracts" && + if (containingSymbolName != "Microsoft.ML.Runtime.Contracts" && containingSymbolName != "Microsoft.ML.Internal.CpuMath.Core.Contracts") { return; From 5af54edb5a478954687579fb239afc772de785c2 Mon Sep 17 00:00:00 2001 From: Senja Filipi Date: Thu, 7 Mar 2019 23:18:16 -0800 Subject: [PATCH 6/6] fixing analyzer Contracts tests. --- .../Code/ContractsCheckTest.cs | 38 +++++++++---------- .../Resources/ContractsCheckAfterFix.cs | 1 + .../Resources/ContractsCheckBeforeFix.cs | 1 + .../Resources/ContractsCheckResource.cs | 5 ++- 4 files changed, 24 insertions(+), 21 deletions(-) diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs index 6ea2adc007..8ef28ab554 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs @@ -24,9 +24,9 @@ public sealed class ContractsCheckTest [Fact] public async Task ContractsCheck() { - const int basis = 10; + const int basis = 11; var expected = new DiagnosticResult[] { - new DiagnosticResult("CS0051", DiagnosticSeverity.Error).WithLocation(14, 16).WithMessage("Inconsistent accessibility: parameter type 'IHostEnvironment' is less accessible than method 'TypeName.TypeName(IHostEnvironment, float, int)'"), + new DiagnosticResult("CS0051", DiagnosticSeverity.Error).WithLocation(15, 16).WithMessage("Inconsistent accessibility: parameter type 'IHostEnvironment' is less accessible than method 'TypeName.TypeName(IHostEnvironment, float, int)'"), VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(basis + 8, 46).WithArguments("CheckParam", "paramName", "\"p\""), VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(basis + 9, 46).WithArguments("CheckParam", "paramName", "nameof(p) + nameof(p)"), VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(basis + 11, 28).WithArguments("CheckValue", "paramName", "\"p\""), @@ -112,20 +112,20 @@ public async Task ContractsCheckFix() }, ExpectedDiagnostics = { - VerifyCS.Diagnostic(ContractsCheckAnalyzer.ExceptionDiagnostic.Rule).WithLocation(8, 43).WithArguments("ExceptParam"), - VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(8, 65).WithArguments("ExceptParam", "paramName", "\"yuck\""), - VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(12, 39).WithArguments("CheckValue", "paramName", "\"str\""), - VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(13, 66).WithArguments("CheckUserArg", "name", "\"Foo\""), - VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(14, 57).WithArguments("CheckUserArg", "name", "\"Bar\""), - VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(15, 57).WithArguments("CheckUserArg", "name", "\"A\""), - VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(16, 52).WithArguments("ExceptParam", "paramName", "\"Bar\""), - VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(19, 17).WithArguments("CheckParam", "paramName", "\"isFive\""), - VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(20, 49).WithArguments("CheckValue", "paramName", "\"Y\""), - VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(21, 52).WithArguments("ExceptParam", "paramName", "\"tom\""), - VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(22, 39).WithArguments("CheckValue", "paramName", "\"noMatch\""), - VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(23, 53).WithArguments("CheckUserArg", "name", "\"chumble\""), - VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(24, 53).WithArguments("CheckUserArg", "name", "\"sp\""), - new DiagnosticResult("CS1503", DiagnosticSeverity.Error).WithLocation("Test1.cs", 752, 91).WithMessage("Argument 2: cannot convert from 'Microsoft.ML.IHostEnvironment' to 'Microsoft.ML.IExceptionContext'"), + VerifyCS.Diagnostic(ContractsCheckAnalyzer.ExceptionDiagnostic.Rule).WithLocation(9, 43).WithArguments("ExceptParam"), + VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(9, 65).WithArguments("ExceptParam", "paramName", "\"yuck\""), + VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(13, 39).WithArguments("CheckValue", "paramName", "\"str\""), + VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(14, 66).WithArguments("CheckUserArg", "name", "\"Foo\""), + VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(15, 57).WithArguments("CheckUserArg", "name", "\"Bar\""), + VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(16, 57).WithArguments("CheckUserArg", "name", "\"A\""), + VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(17, 52).WithArguments("ExceptParam", "paramName", "\"Bar\""), + VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(20, 17).WithArguments("CheckParam", "paramName", "\"isFive\""), + VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(21, 49).WithArguments("CheckValue", "paramName", "\"Y\""), + VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(22, 52).WithArguments("ExceptParam", "paramName", "\"tom\""), + VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(23, 39).WithArguments("CheckValue", "paramName", "\"noMatch\""), + VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(24, 53).WithArguments("CheckUserArg", "name", "\"chumble\""), + VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(25, 53).WithArguments("CheckUserArg", "name", "\"sp\""), + new DiagnosticResult("CS1503", DiagnosticSeverity.Error).WithLocation("Test1.cs", 752, 91).WithMessage("Argument 2: cannot convert from 'Microsoft.ML.Runtime.IHostEnvironment' to 'Microsoft.ML.Runtime.IExceptionContext'"), }, AdditionalReferences = { AdditionalMetadataReferences.RefFromType>() }, }, @@ -142,9 +142,9 @@ public async Task ContractsCheckFix() }, ExpectedDiagnostics = { - VerifyCS.Diagnostic(ContractsCheckAnalyzer.ExceptionDiagnostic.Rule).WithLocation(8, 43).WithArguments("ExceptParam"), - VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(22, 39).WithArguments("CheckValue", "paramName", "\"noMatch\""), - new DiagnosticResult("CS1503", DiagnosticSeverity.Error).WithLocation("Test1.cs", 752, 91).WithMessage("Argument 2: cannot convert from 'Microsoft.ML.IHostEnvironment' to 'Microsoft.ML.IExceptionContext'"), + VerifyCS.Diagnostic(ContractsCheckAnalyzer.ExceptionDiagnostic.Rule).WithLocation(9, 43).WithArguments("ExceptParam"), + VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(23, 39).WithArguments("CheckValue", "paramName", "\"noMatch\""), + new DiagnosticResult("CS1503", DiagnosticSeverity.Error).WithLocation("Test1.cs", 752, 91).WithMessage("Argument 2: cannot convert from 'Microsoft.ML.Runtime.IHostEnvironment' to 'Microsoft.ML.Runtime.IExceptionContext'"), }, }, }; diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckAfterFix.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckAfterFix.cs index 1783bdf1bc..e965c8d1ba 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckAfterFix.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckAfterFix.cs @@ -1,5 +1,6 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; +using Microsoft.ML.Runtime; using System; namespace Bubba { diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckBeforeFix.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckBeforeFix.cs index 6c6cc61c47..e3c4802e16 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckBeforeFix.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckBeforeFix.cs @@ -1,5 +1,6 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; +using Microsoft.ML.Runtime; using System; namespace Bubba { diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckResource.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckResource.cs index 05aed26e5f..f4ab3d02d2 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckResource.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Resources/ContractsCheckResource.cs @@ -6,6 +6,7 @@ using System; using Microsoft.ML; using Microsoft.ML.Model; +using Microsoft.ML.Runtime; namespace TestNamespace { @@ -59,7 +60,7 @@ public static class Messages } // Dummy declarations so that the independent compilation of contracts works as expected. -namespace Microsoft.ML +namespace Microsoft.ML.Runtime { [Flags] internal enum MessageSensitivity @@ -75,7 +76,7 @@ internal interface IHostEnvironment : IExceptionContext } } -namespace Microsoft.ML.Model +namespace Microsoft.ML { public sealed class ModelLoadContext { } } \ No newline at end of file