1 write to Transforms
Microsoft.ML.Data (1)
MLContext.cs (1)
157Transforms = new TransformsCatalog(_env);
1154 references to Transforms
Microsoft.ML.AutoML (36)
API\MulticlassClassificationExperiment.cs (2)
332pipeline = pipeline.Append(Context.Transforms.Conversion.MapValueToKey(label, label)); 334pipeline = pipeline.Append(Context.Transforms.Conversion.MapKeyToValue(DefaultColumnNames.PredictedLabel, DefaultColumnNames.PredictedLabel));
EstimatorExtensions\EstimatorExtensions.cs (14)
26return context.Transforms.Concatenate(outColumn, inColumns); 47return context.Transforms.CopyColumns(outColumn, inColumn); 68return context.Transforms.Conversion.MapKeyToValue(outColumn, inColumn); 89return context.Transforms.Conversion.Hash(outColumn, inColumn); 116return context.Transforms.IndicateMissingValues(pairs); 143return context.Transforms.ReplaceMissingValues(pairs); 164return context.Transforms.NormalizeMinMax(outColumn, inColumn); 190return context.Transforms.Categorical.OneHotEncoding(cols); 221return context.Transforms.Categorical.OneHotHashEncoding(cols); 242return context.Transforms.Text.FeaturizeText(outColumn, inColumn); 268return context.Transforms.Conversion.ConvertType(cols); 290return context.Transforms.Conversion.MapValueToKey(outColumn, inColumn); 315return context.Transforms.LoadRawImageBytes(outColumn, ImageFolder, inColumn); 340return context.Transforms.LoadImages(outColumn, ImageFolder, inColumn);
SweepableEstimator\Estimators\ApplyOnnx.cs (1)
11return context.Transforms.ApplyOnnxModel(outputColumnName: param.OutputColumnName, inputColumnName: param.InputColumnName, modelFile: param.ModelFile, gpuDeviceId: param.GpuDeviceId, fallbackToCpu: param.FallbackToCpu);
SweepableEstimator\Estimators\Concatenate.cs (1)
11return context.Transforms.Concatenate(param.OutputColumnName, param.InputColumnNames);
SweepableEstimator\Estimators\FeaturizeText.cs (1)
11return context.Transforms.Text.FeaturizeText(param.OutputColumnName, param.InputColumnName);
SweepableEstimator\Estimators\Images.cs (8)
13return context.Transforms.LoadImages(param.OutputColumnName, param.ImageFolder, param.InputColumnName); 21return context.Transforms.LoadRawImageBytes(param.OutputColumnName, param.ImageFolder, param.InputColumnName); 29return context.Transforms.ResizeImages(param.OutputColumnName, param.ImageWidth, param.ImageHeight, param.InputColumnName, param.Resizing, param.CropAnchor); 37return context.Transforms.ExtractPixels(param.OutputColumnName, param.InputColumnName, param.ColorsToExtract, param.OrderOfExtraction, outputAsFloatArray: param.OutputAsFloatArray); 65return context.Transforms.DnnFeaturizeImage(param.OutputColumnName, 68return context.Transforms.DnnFeaturizeImage(param.OutputColumnName, 71return context.Transforms.DnnFeaturizeImage(param.OutputColumnName, 74return context.Transforms.DnnFeaturizeImage(param.OutputColumnName,
SweepableEstimator\Estimators\MapValueToKey.cs (2)
11return context.Transforms.Conversion.MapValueToKey(param.OutputColumnName, param.InputColumnName, addKeyValueAnnotationsAsText: param.AddKeyValueAnnotationsAsText, keyData: param.KeyData); 19return context.Transforms.Conversion.MapKeyToValue(param.OutputColumnName, param.InputColumnName);
SweepableEstimator\Estimators\NormalizeMinMax.cs (1)
13return context.Transforms.NormalizeMinMax(inputOutputPairs);
SweepableEstimator\Estimators\NormalizeText.cs (1)
15return context.Transforms.Text.NormalizeText(param.OutputColumnName, param.InputColumnName, param.CaseMode, param.KeepDiacritics, param.KeepPunctuations, param.KeepNumbers);
SweepableEstimator\Estimators\OneHotEncoding.cs (2)
12return context.Transforms.Categorical.OneHotEncoding(inputOutputPairs); 21return context.Transforms.Categorical.OneHotHashEncoding(inputOutputPairs);
SweepableEstimator\Estimators\ReplaceMissingValue.cs (1)
12return context.Transforms.ReplaceMissingValues(inputOutputPairs);
SweepableEstimator\Estimators\TypeConvert.cs (1)
12return context.Transforms.Conversion.ConvertType(inputOutputPairs, param.TargetType);
Utils\SplitUtil.cs (1)
67return context.Transforms.DropColumns(columnsToDrop.ToArray()).Fit(data).Transform(data);
Microsoft.ML.AutoML.Tests (14)
AutoMLExperimentTests.cs (2)
299.Append(context.Transforms.Conversion.MapValueToKey(label, label)) 326.Append(context.Transforms.Conversion.MapValueToKey(label, label))
PurposeInferenceTests.cs (1)
33var normalizer = context.Transforms.NormalizeMinMax(DefaultColumnNames.Features);
SweepableExtensionTest.cs (10)
50var estimator = context.Transforms.Concatenate("output", "input"); 70var pipeline = estimator.Append(context.Transforms.Concatenate("output", "input")); 81SweepablePipeline pipeline = context.Transforms.Concatenate("output", "input") 94SweepablePipeline pipeline = context.Transforms.Concatenate("output", "input") 107SweepablePipeline pipeline = context.Transforms.Concatenate("output", "input") 133SweepablePipeline pipeline = context.Transforms.Concatenate("output", "input") 147SweepablePipeline pipeline = context.Transforms.Concatenate("output", "input") 174SweepablePipeline pipeline = context.Transforms.Concatenate("output", "input") 187var estimator = context.Transforms.Concatenate("output", "input"); 189pipeline = pipeline.Append(context.Transforms.CopyColumns("output", "input"));
UserInputValidationTests.cs (1)
358var convertLabelToBoolEstimator = mlContext.Transforms.Conversion.MapValue(DefaultColumnNames.Label,
Microsoft.ML.Core.Tests (3)
UnitTests\TestEntryPoints.cs (3)
1374var pipeline = mlContext.Transforms.Text.FeaturizeText("Features", "SentimentText") 4724var estimator = ML.Transforms.CountTargetEncode("Text", builder: CountTableBuilderBase.CreateDictionaryCountTableBuilder(), combine: false); 4766var estimator = ML.Transforms.CountTargetEncode("Text", builder: CountTableBuilderBase.CreateDictionaryCountTableBuilder(), combine: false);
Microsoft.ML.Fairlearn (1)
Metrics\FairlearnMetricCatalog.cs (1)
68var convertToString = _context.Transforms.Conversion.ConvertType(sensitiveCol.Name, sensitiveCol.Name, DataKind.String);
Microsoft.ML.Fairlearn.Tests (2)
GridSearchTest.cs (2)
95var pipeline = context.Transforms.Categorical.OneHotHashEncoding("sensitiveFeature_encode", "sensitiveFeature") 96.Append(context.Transforms.Concatenate("Features", "sensitiveFeature_encode", "score_feature"))
Microsoft.ML.IntegrationTests (97)
Datasets\Iris.cs (2)
55var pipeline = mlContext.Transforms.CustomMapping(generateGroupId, null) 56.Append(mlContext.Transforms.Conversion.MapValueToKey("GroupId"));
Datasets\TrivialMatrixFactorization.cs (2)
30var pipeline = mlContext.Transforms.Conversion.MapValueToKey("MatrixColumnIndex") 31.Append(mlContext.Transforms.Conversion.MapValueToKey("MatrixRowIndex"));
DataTransformation.cs (7)
61var pipeline = mlContext.Transforms.CustomMapping(generateGroupId, null); 107var pipeline = mlContext.Transforms.CustomMapping(generateGroupId, null); 137var pipeline = mlContext.Transforms.Text.FeaturizeText("Features", 175var pipeline = mlContext.Transforms.Concatenate("Features", Iris.Features) 176.Append(mlContext.Transforms.NormalizeMinMax("Features")); 202var pipeline = mlContext.Transforms.Concatenate("Features", Iris.Features) 203.Append(mlContext.Transforms.Conversion.Hash(new[] {
Debugging.cs (3)
49var pipeline = mlContext.Transforms.Text.FeaturizeText( 107var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 174var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features)
Evaluation.cs (8)
65var pipeline = mlContext.Transforms.Text.FeaturizeText("Features", "SentimentText") 94var pipeline = mlContext.Transforms.Text.FeaturizeText("Features", "SentimentText") 123var pipeline = mlContext.Transforms.Concatenate("Features", Iris.Features) 151var pipeline = mlContext.Transforms.Concatenate("Features", Iris.Features) 152.Append(mlContext.Transforms.Conversion.MapValueToKey("Label")) 176var pipeline = mlContext.Transforms.Concatenate("Features", Iris.Features) 270var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 300var pipeline = mlContext.Transforms.Text.FeaturizeText("Features", "SentimentText")
Explainability.cs (12)
38var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 96var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 120var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 147var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 174var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 183var featureContributions = mlContext.Transforms.CalculateFeatureContribution(predictor, normalize: false); 211var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 220var featureContributions = mlContext.Transforms.CalculateFeatureContribution(predictor, normalize: false); 248var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 257var featureContributions = mlContext.Transforms.CalculateFeatureContribution(predictor, normalize: false); 286var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 295var featureContributions = mlContext.Transforms.CalculateFeatureContribution(predictor, normalize: false);
IntrospectiveTraining.cs (15)
38var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 81var pipeline = mlContext.Transforms.Text.FeaturizeText("Features", "SentimentText") 143var pipeline = mlContext.Transforms.Concatenate("Features", Iris.Features) 184var pipeline = mlContext.Transforms.Text.ProduceWordBags("SentimentBag", "SentimentText") 185.Append(mlContext.Transforms.Text.LatentDirichletAllocation("Features", "SentimentBag", 225var pipeline = mlContext.Transforms.Text.FeaturizeText("Features", "SentimentText") 264var pipeline = mlContext.Transforms.Concatenate("Features", Iris.Features) 265.Append(mlContext.Transforms.NormalizeMinMax("Features")); 292var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 337var pipeline = mlContext.Transforms.Concatenate("NumericalFeatures", Adult.NumericalFeatures) 338.Append(mlContext.Transforms.Concatenate("CategoricalFeatures", Adult.CategoricalFeatures)) 339.Append(mlContext.Transforms.Categorical.OneHotHashEncoding("CategoricalFeatures", numberOfBits: 8, // get collisions! 394var pipeline = mlContext.Transforms.Concatenate("Features", Iris.Features) 419return mlContext.Transforms.Concatenate("LabelAndFeatures", "Label", "Features") 432return mlContext.Transforms.Conversion.MapValueToKey("Label")
ModelFiles.cs (6)
48var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 95var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 329var pipeline = mlContext.Transforms.NormalizeMinMax("Features"); 388var composite = loader.Append(mlContext.Transforms.NormalizeMinMax("Features")); 426var estimator = mlContext.Transforms.NormalizeMinMax("Features"); 459var estimator = mlContext.Transforms.NormalizeMinMax("Features");
ONNX.cs (10)
40var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 41.Append(mlContext.Transforms.NormalizeMinMax("Features")) 60var onnxEstimator = mlContext.Transforms.ApplyOnnxModel(modelPath, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 90var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 91.Append(mlContext.Transforms.NormalizeMinMax("Features")) 106var onnxEstimator = mlContext.Transforms.ApplyOnnxModel(modelPath, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 112mlContext.Transforms.CopyColumns("Score", "Score").Fit(onnxModel.Transform(data))); 142var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 143.Append(mlContext.Transforms.NormalizeMinMax("Features")) 158var onnxEstimator = mlContext.Transforms.ApplyOnnxModel(modelPath, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu);
Prediction.cs (1)
50var pipeline = mlContext.Transforms.Text.FeaturizeText("Features", "SentimentText")
SchemaDefinitionTests.cs (9)
36var pipeline1 = _ml.Transforms.Categorical.OneHotEncoding("Cat", "Workclass", maximumNumberOfKeys: 3) 37.Append(_ml.Transforms.Concatenate("Features", "Cat", "NumericFeatures")); 40var pipeline2 = _ml.Transforms.Categorical.OneHotEncoding("Cat", "Workclass", maximumNumberOfKeys: 4) 41.Append(_ml.Transforms.Concatenate("Features", "Cat", "NumericFeatures")); 66var pipeline = _ml.Transforms.Categorical.OneHotEncoding("Categories") 67.Append(_ml.Transforms.Categorical.OneHotEncoding("Workclass")) 68.Append(_ml.Transforms.Concatenate("Features", "NumericFeatures", "Categories", "Workclass")) 69.Append(_ml.Transforms.FeatureSelection.SelectFeaturesBasedOnMutualInformation("Features")); 78var custom = _ml.Transforms.CustomMapping(
Training.cs (17)
41var featurizationPipeline = mlContext.Transforms.Text.FeaturizeText("Features", "SentimentText") 92var featurizationPipeline = mlContext.Transforms.Text.FeaturizeText("Features", "SentimentText") 136var featurizationPipeline = mlContext.Transforms.Text.FeaturizeText("Features", "SentimentText") 180var featurizationPipeline = mlContext.Transforms.Text.FeaturizeText("Features", "SentimentText") 224var featurizationPipeline = mlContext.Transforms.Text.FeaturizeText("Features", "SentimentText") 266var featurizationPipeline = mlContext.Transforms.Concatenate("Features", Iris.Features) 267.Append(mlContext.Transforms.Conversion.MapValueToKey("Label")) 317var featurizationPipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 318.Append(mlContext.Transforms.NormalizeMinMax("Features")) 361var featurizationPipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 362.Append(mlContext.Transforms.NormalizeMinMax("Features")) 406var featurizationPipeline = mlContext.Transforms.Text.FeaturizeText("Features", "SentimentText") 455var binaryClassificationPipeline = mlContext.Transforms.Concatenate("Features", Iris.Features) 457.Append(mlContext.Transforms.Conversion.MapValueToKey("Label")) 486var binaryClassificationPipeline = mlContext.Transforms.Concatenate("Features", Iris.Features) 488.Append(mlContext.Transforms.Conversion.MapValueToKey("Label")) 490.Append(mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
Validation.cs (5)
41var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 68var dataProcessPipeline = mlContext.Transforms.Concatenate("Features", new[] { "FeatureVectorA", "FeatureVectorB" }).Append( 69mlContext.Transforms.Conversion.Hash("GroupId", "GroupId")); 112var pipeline = mlContext.Transforms.Concatenate("Features", HousingRegression.Features) 154var pipeline = mlContext.Transforms.Concatenate("Features", Iris.Features)
Microsoft.ML.OnnxTransformerTest (47)
DnnImageFeaturizerTest.cs (14)
78var pipe = ML.Transforms.DnnFeaturizeImage("output_1", m => m.ModelSelector.ResNet18(m.Environment, m.OutputColumn, m.InputColumn), "data_0"); 109var pipe = ML.Transforms.LoadImages("data_0", imageFolder, "imagePath") 110.Append(ML.Transforms.ResizeImages("data_0", imageHeight, imageWidth)) 111.Append(ML.Transforms.ExtractPixels("data_0", interleavePixelColors: true)) 112.Append(ML.Transforms.DnnFeaturizeImage("output_1", m => m.ModelSelector.ResNet18(m.Environment, m.OutputColumn, m.InputColumn), "data_0")); 153var est = ML.Transforms.DnnFeaturizeImage(outputNames, m => m.ModelSelector.ResNet18(m.Environment, m.OutputColumn, m.InputColumn), inputNames); 221var dataProcessPipeline = ML.Transforms.Conversion.MapValueToKey("Label", "Label") 222.Append(ML.Transforms.LoadImages("ImagePath_featurized", imageFolder, "ImagePath")) 223.Append(ML.Transforms.ResizeImages("ImagePath_featurized", 224, 224, "ImagePath_featurized")) 224.Append(ML.Transforms.ExtractPixels("ImagePath_featurized", "ImagePath_featurized")) 225.Append(ML.Transforms.DnnFeaturizeImage("ImagePath_featurized", m => m.ModelSelector.ResNet18(m.Environment, m.OutputColumn, m.InputColumn), "ImagePath_featurized")) 226.Append(ML.Transforms.Concatenate("Features", new[] { "ImagePath_featurized" })) 227.Append(ML.Transforms.NormalizeMinMax("Features", "Features")) 231.Append(ML.Transforms.Conversion.MapKeyToValue("PredictedLabel", "PredictedLabel"));
OnnxTransformTests.cs (33)
157ML.Transforms.ApplyOnnxModel(options) : 158ML.Transforms.ApplyOnnxModel(options.OutputColumns, options.InputColumns, modelFile, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 196var est = ML.Transforms.ApplyOnnxModel(outputNames, inputNames, modelFile, gpuDeviceId, fallbackToCpu); 254var pipe = ML.Transforms.LoadImages("data_0", imageFolder, "imagePath") 255.Append(ML.Transforms.ResizeImages("data_0", imageHeight, imageWidth)) 256.Append(ML.Transforms.ExtractPixels("data_0", interleavePixelColors: true)) 257.Append(ML.Transforms.ApplyOnnxModel("softmaxout_1", "data_0", fileStream, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu)); 305var pipe = ML.Transforms.LoadImages("data_0", imageFolder, "imagePath") 306.Append(ML.Transforms.ResizeImages("data_0", imageHeight, imageWidth)) 307.Append(ML.Transforms.ExtractPixels("data_0", interleavePixelColors: true)) 308.Append(ML.Transforms.ApplyOnnxModel("softmaxout_1", "data_0", modelFile, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu)); 369var pipeline = ML.Transforms.ApplyOnnxModel("softmaxout_1", "data_0", modelFile, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 408var pipeline = ML.Transforms.ApplyOnnxModel("softmaxout_1", "data_0", modelFile, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 417Assert.Throws<InvalidOperationException>(() => ML.Transforms.ApplyOnnxModel("softmaxout_1", "data_0", modelFile, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu)); 436var pipeline = ML.Transforms.ApplyOnnxModel(new[] { "outa", "outb" }, new[] { "ina", "inb" }, modelFile, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 476var pipeline = ML.Transforms.ApplyOnnxModel(new[] { "outb", "outa" }, new[] { "ina", "inb" }, modelFile, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 502pipeline = ML.Transforms.ApplyOnnxModel(new[] { "outb" }, new[] { "ina", "inb" }, modelFile, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 536var pipeline = ML.Transforms.ApplyOnnxModel(modelFile, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 562var pipeline = ML.Transforms.ApplyOnnxModel(modelFile, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 643var pipeline = ML.Transforms.ExtractPixels("data_0", "Image") // Map column "Image" to column "data_0" 644.Append(ML.Transforms.ApplyOnnxModel("softmaxout_1", "data_0", modelFile, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu)); // Map column "data_0" to column "softmaxout_1" 694var pipeline = ML.Transforms.ApplyOnnxModel(new[] { "output" }, new[] { "input" }, modelFile, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 747var pipeline = ML.Transforms.ApplyOnnxModel(new[] { "output" }, new[] { "input" }, modelFile, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 861var pipeline = ML.Transforms.CustomMapping(action, contractName: null); 909pipeline[0] = ML.Transforms.ApplyOnnxModel( 916pipeline[1] = ML.Transforms.ApplyOnnxModel( 923pipeline[2] = ML.Transforms.ApplyOnnxModel(modelFile, shapeDictionary, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 972var pipeline = ML.Transforms.ApplyOnnxModel(new[] { "outa", "outb" }, new[] { "ina", "inb" }, 1072var pipeline = ML.Transforms.ApplyOnnxModel(nameof(PredictionWithCustomShape.argmax), 1134var pipe = ML.Transforms.LoadImages("data_0", imageFolder, "imagePath") 1135.Append(ML.Transforms.ResizeImages("data_0", imageHeight, imageWidth)) 1136.Append(ML.Transforms.ExtractPixels("data_0", interleavePixelColors: true)) 1137.Append(ML.Transforms.ApplyOnnxModel(new[] { "softmaxout_1" }, new[] { "data_0" }, modelFile,
Microsoft.ML.PerformanceTests (17)
FeaturizeTextBench.cs (1)
62var featurizer = _mlContext.Transforms.Text.FeaturizeText(textColumn, new TextFeaturizingEstimator.Options()
ImageClassificationBench.cs (3)
60shuffledFullImagesDataset = _mlContext.Transforms.Conversion 62.Append(_mlContext.Transforms.LoadRawImageBytes("Image", 92.Append(_mlContext.Transforms.Conversion.MapKeyToValue(
KMeansAndLogisticRegressionBench.cs (4)
36var estimatorPipeline = ml.Transforms.Categorical.OneHotEncoding("CatFeatures") 37.Append(ml.Transforms.NormalizeMinMax("NumFeatures")) 38.Append(ml.Transforms.Concatenate("Features", "NumFeatures", "CatFeatures")) 40.Append(ml.Transforms.Concatenate("Features", "Features", "Score"))
PredictionEngineBench.cs (2)
58.Append(env.Transforms.Conversion.MapValueToKey("Label")) 93var pipeline = mlContext.Transforms.Text.FeaturizeText("Features", "SentimentText")
RffTransform.cs (2)
45var pipeline = mlContext.Transforms.ApproximatedKernelMap("FeaturesRFF", "Features") 47.Append(mlContext.Transforms.Concatenate("Features", "FeaturesRFF"))
StochasticDualCoordinateAscentClassifierBench.cs (4)
79.Append(_mlContext.Transforms.Conversion.MapValueToKey("Label")) 102var text = _mlContext.Transforms.Text.FeaturizeText("WordEmbeddings", new TextFeaturizingEstimator.Options 112var trans = _mlContext.Transforms.Text.ApplyWordEmbedding("Features", "WordEmbeddings_TransformedText", 114.Append(_mlContext.Transforms.Conversion.MapValueToKey("Label"))
TextPredictionEngineCreation.cs (1)
28var pipeline = _context.Transforms.Text.FeaturizeText("Features", "SentimentText")
Microsoft.ML.Predictor.Tests (3)
TestIniModels.cs (2)
530var pipeline = mlContext.Transforms.ReplaceMissingValues("Features") 569var pipeline = mlContext.Transforms.ReplaceMissingValues("Features")
TestPredictors.cs (1)
650var cat = ML.Transforms.Categorical.OneHotEncoding("Features", "Categories").Fit(dataView).Transform(dataView);
Microsoft.ML.Samples (224)
Dynamic\DataOperations\FilterRowsByKeyColumnFraction.cs (1)
36var pipeline = mlContext.Transforms.Conversion.MapValueToKey("Age");
Dynamic\ModelOperations\OnnxConversion.cs (11)
49var wholePipeline = mlContext.Transforms.CopyColumns("Label", "IsOver50K") 51.Append(mlContext.Transforms.Categorical.OneHotEncoding("workclass")) 52.Append(mlContext.Transforms.Categorical.OneHotEncoding("education")) 53.Append(mlContext.Transforms.Categorical.OneHotEncoding("marital-status")) 54.Append(mlContext.Transforms.Categorical.OneHotEncoding("occupation")) 55.Append(mlContext.Transforms.Categorical.OneHotEncoding("relationship")) 56.Append(mlContext.Transforms.Categorical.OneHotEncoding("ethnicity")) 57.Append(mlContext.Transforms.Categorical.OneHotEncoding("native-country")) 59.Append(mlContext.Transforms.Concatenate("Features", "workclass", "education", "marital-status", 63.Append(mlContext.Transforms.NormalizeMinMax("Features")) 84var onnxEstimator = mlContext.Transforms.ApplyOnnxModel(onnxModelPath);
Dynamic\ModelOperations\SaveLoadModel.cs (1)
28ITransformer model = mlContext.Transforms.Conversion
Dynamic\ModelOperations\SaveLoadModelFile.cs (1)
28ITransformer model = mlContext.Transforms.Conversion
Dynamic\NgramExtraction.cs (3)
42var charsPipeline = ml.Transforms.Text 46var ngramOnePipeline = ml.Transforms.Text 49var ngramTwpPipeline = ml.Transforms.Text
Dynamic\SimpleDataViewImplementation.cs (1)
36var transformedDataView = mlContext.Transforms.Text.TokenizeIntoWords(
Dynamic\TensorFlow\TextClassification.cs (4)
100mlContext.Transforms.Text.TokenizeIntoWords( 103.Append(mlContext.Transforms.Conversion.MapValue( 109.Append(mlContext.Transforms.CustomMapping( 115.Append(mlContext.Transforms.CopyColumns(
Dynamic\TextTransform.cs (2)
44var default_pipeline = ml.Transforms.Text 50var customized_pipeline = ml.Transforms.Text
Dynamic\Trainers\BinaryClassification\PermutationFeatureImportance.cs (2)
27var pipeline = mlContext.Transforms 29.Append(mlContext.Transforms.NormalizeMinMax("Features"))
Dynamic\Trainers\BinaryClassification\PermutationFeatureImportanceLoadFromDisk.cs (2)
23var pipeline = mlContext.Transforms 25.Append(mlContext.Transforms.NormalizeMinMax("Features"))
Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (3)
49shuffledFullImagesDataset = mlContext.Transforms.Conversion 52.Append(mlContext.Transforms.LoadRawImageBytes("Image", 68.Append(mlContext.Transforms.Conversion.MapKeyToValue(
Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (5)
53trainDataset = mlContext.Transforms.Conversion 56.Append(mlContext.Transforms.LoadRawImageBytes("Image", 69testDataset = mlContext.Transforms.Conversion 72.Append(mlContext.Transforms.LoadRawImageBytes("Image", 104.Append(mlContext.Transforms.Conversion.MapKeyToValue(
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (3)
48shuffledFullImagesDataset = mlContext.Transforms.Conversion 51.Append(mlContext.Transforms.LoadRawImageBytes("Image", 91var pipeline = mlContext.Transforms.LoadRawImageBytes(
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (3)
48shuffledFullImagesDataset = mlContext.Transforms.Conversion 51.Append(mlContext.Transforms.LoadRawImageBytes("Image", 84.Append(mlContext.Transforms.Conversion.MapKeyToValue(
Dynamic\Trainers\MulticlassClassification\LbfgsMaximumEntropy.cs (1)
29mlContext.Transforms.Conversion
Dynamic\Trainers\MulticlassClassification\LbfgsMaximumEntropyWithOptions.cs (1)
38mlContext.Transforms.Conversion.MapValueToKey("Label")
Dynamic\Trainers\MulticlassClassification\LightGbm.cs (1)
32mlContext.Transforms.Conversion
Dynamic\Trainers\MulticlassClassification\LightGbmWithOptions.cs (1)
43mlContext.Transforms.Conversion.MapValueToKey("Label")
Dynamic\Trainers\MulticlassClassification\LogLossPerClass.cs (1)
29mlContext.Transforms.Conversion
Dynamic\Trainers\MulticlassClassification\NaiveBayes.cs (1)
35mlContext.Transforms.Conversion
Dynamic\Trainers\MulticlassClassification\OneVersusAll.cs (1)
29mlContext.Transforms.Conversion.MapValueToKey("Label")
Dynamic\Trainers\MulticlassClassification\PairwiseCoupling.cs (1)
29mlContext.Transforms.Conversion.MapValueToKey("Label")
Dynamic\Trainers\MulticlassClassification\PermutationFeatureImportance.cs (3)
28var pipeline = mlContext.Transforms 30.Append(mlContext.Transforms.Conversion.MapValueToKey("Label")) 31.Append(mlContext.Transforms.NormalizeMinMax("Features"))
Dynamic\Trainers\MulticlassClassification\PermutationFeatureImportanceLoadFromDisk.cs (3)
31var pipeline = mlContext.Transforms 33.Append(mlContext.Transforms.Conversion.MapValueToKey("Label")) 34.Append(mlContext.Transforms.NormalizeMinMax("Features"))
Dynamic\Trainers\MulticlassClassification\SdcaMaximumEntropy.cs (1)
37mlContext.Transforms.Conversion
Dynamic\Trainers\MulticlassClassification\SdcaMaximumEntropyWithOptions.cs (1)
47mlContext.Transforms.Conversion.MapValueToKey("Label")
Dynamic\Trainers\MulticlassClassification\SdcaNonCalibrated.cs (1)
37mlContext.Transforms.Conversion
Dynamic\Trainers\MulticlassClassification\SdcaNonCalibratedWithOptions.cs (1)
47mlContext.Transforms.Conversion.MapValueToKey("Label")
Dynamic\Trainers\Ranking\PermutationFeatureImportance.cs (4)
27var pipeline = mlContext.Transforms.Concatenate("Features", 29.Append(mlContext.Transforms.Conversion.MapValueToKey("Label")) 30.Append(mlContext.Transforms.Conversion.MapValueToKey( 32.Append(mlContext.Transforms.NormalizeMinMax("Features"))
Dynamic\Trainers\Ranking\PermutationFeatureImportanceLoadFromDisk.cs (4)
29var pipeline = mlContext.Transforms.Concatenate("Features", 31.Append(mlContext.Transforms.Conversion.MapValueToKey("Label")) 32.Append(mlContext.Transforms.Conversion.MapValueToKey( 34.Append(mlContext.Transforms.NormalizeMinMax("Features"))
Dynamic\Trainers\Regression\LightGbmAdvanced.cs (1)
39var pipeline = mlContext.Transforms.Concatenate("Features",
Dynamic\Trainers\Regression\LightGbmWithOptionsAdvanced.cs (1)
40var pipeline = mlContext.Transforms.Concatenate(
Dynamic\Trainers\Regression\PermutationFeatureImportance.cs (2)
28var pipeline = mlContext.Transforms.Concatenate( 31.Append(mlContext.Transforms.NormalizeMinMax("Features"))
Dynamic\Trainers\Regression\PermutationFeatureImportanceLoadFromDisk.cs (2)
30var pipeline = mlContext.Transforms.Concatenate( 33.Append(mlContext.Transforms.NormalizeMinMax("Features"))
Dynamic\Transforms\ApplyOnnxModel.cs (1)
28var pipeline = mlContext.Transforms.ApplyOnnxModel(modelPath);
Dynamic\Transforms\ApplyONNXModelWithInMemoryImages.cs (2)
45var pipeline = mlContext.Transforms.ExtractPixels("data_0", "Image") 46.Append(mlContext.Transforms.ApplyOnnxModel("softmaxout_1",
Dynamic\Transforms\ApproximatedKernelMap.cs (1)
31var approximation = mlContext.Transforms.ApproximatedKernelMap(
Dynamic\Transforms\CalculateFeatureContribution.cs (3)
25var transformPipeline = mlContext.Transforms.Concatenate("Features", 27.Append(mlContext.Transforms.NormalizeMeanVariance("Features")); 52var linearFeatureContributionCalculator = mlContext.Transforms
Dynamic\Transforms\CalculateFeatureContributionCalibrated.cs (3)
25var transformPipeline = mlContext.Transforms.Concatenate("Features", 27.Append(mlContext.Transforms.NormalizeMeanVariance("Features")); 54var linearFeatureContributionCalculator = mlContext.Transforms
Dynamic\Transforms\Categorical\OneHotEncoding.cs (2)
30var pipeline = mlContext.Transforms.Categorical.OneHotEncoding( 48var keyPipeline = mlContext.Transforms.Categorical.OneHotEncoding(
Dynamic\Transforms\Categorical\OneHotEncodingMultiColumn.cs (1)
30mlContext.Transforms.Categorical.OneHotEncoding(
Dynamic\Transforms\Categorical\OneHotHashEncoding.cs (2)
30var pipeline = mlContext.Transforms.Categorical.OneHotHashEncoding( 47var keyPipeline = mlContext.Transforms.Categorical.OneHotHashEncoding(
Dynamic\Transforms\Categorical\OneHotHashEncodingMultiColumn.cs (1)
30mlContext.Transforms.Categorical.OneHotHashEncoding(
Dynamic\Transforms\Concatenate.cs (2)
49var pipeline = mlContext.Transforms.Conversion.ConvertType("Feature3", 51.Append(mlContext.Transforms.Concatenate("Features", new[]
Dynamic\Transforms\Conversion\ConvertType.cs (1)
23var pipeline = mlContext.Transforms.Conversion.ConvertType(
Dynamic\Transforms\Conversion\ConvertTypeMultiColumn.cs (1)
40var pipeline = mlContext.Transforms.Conversion.ConvertType(new[]
Dynamic\Transforms\Conversion\Hash.cs (2)
43var pipeline = mlContext.Transforms.Conversion.Hash("CategoryHashed", 45.Append(mlContext.Transforms.Conversion.Hash("AgeHashed", "Age",
Dynamic\Transforms\Conversion\HashWithOptions.cs (1)
45var pipeline = mlContext.Transforms.Conversion.Hash(
Dynamic\Transforms\Conversion\KeyToValueToKey.cs (5)
30var defaultPipeline = mlContext.Transforms.Text.TokenizeIntoWords( 32.Transforms.Conversion.MapValueToKey(nameof(TransformedData.Keys), 41var customizedPipeline = mlContext.Transforms.Text.TokenizeIntoWords( 43.Transforms.Conversion.MapValueToKey(nameof(TransformedData.Keys), 85var pipeline = defaultPipeline.Append(mlContext.Transforms.Conversion
Dynamic\Transforms\Conversion\MapKeyToBinaryVector.cs (1)
35var pipeline = mlContext.Transforms.Conversion.MapKeyToBinaryVector(
Dynamic\Transforms\Conversion\MapKeyToValueMultiColumn.cs (2)
32mlContext.Transforms.Conversion.MapValueToKey("Label") 46var newPipeline = mlContext.Transforms.Conversion.MapKeyToValue(new[]
Dynamic\Transforms\Conversion\MapKeyToVector.cs (5)
42var pipeline = mlContext.Transforms.Conversion.MapKeyToVector( 44.Append(mlContext.Transforms.Concatenate("Parts", "PartA", "PartB")) 45.Append(mlContext.Transforms.Conversion.MapValueToKey("Parts")) 46.Append(mlContext.Transforms.Conversion.MapKeyToVector( 48.Append(mlContext.Transforms.Conversion.MapKeyToVector(
Dynamic\Transforms\Conversion\MapKeyToVectorMultiColumn.cs (1)
34var pipeline = mlContext.Transforms.Conversion.MapKeyToVector(new[]{
Dynamic\Transforms\Conversion\MapValue.cs (3)
56var pipeline = mlContext.Transforms.Conversion.MapValue( 58Transforms.Conversion.MapValue("ScoreCategory", scoreMap, "Score")) 63.Append(mlContext.Transforms.Conversion.MapValue("Label",
Dynamic\Transforms\Conversion\MapValueIdvLookup.cs (1)
45var pipeline = mlContext.Transforms.Conversion.MapValue("PriceCategory",
Dynamic\Transforms\Conversion\MapValueToArray.cs (1)
43var pipeline = mlContext.Transforms.Conversion.MapValue("Features",
Dynamic\Transforms\Conversion\MapValueToKeyMultiColumn.cs (2)
30var pipeline = mlContext.Transforms.Conversion.MapValueToKey(new[] { 81var pipelineWithLookupMap = mlContext.Transforms.Conversion
Dynamic\Transforms\CopyColumns.cs (1)
47var pipeline = mlContext.Transforms.CopyColumns("Label", "ImageId");
Dynamic\Transforms\CustomMapping.cs (1)
38var pipeline = mlContext.Transforms.CustomMapping(mapping, contractName:
Dynamic\Transforms\CustomMappingSaveAndLoad.cs (1)
38var pipeline = mlContext.Transforms.CustomMapping(new
Dynamic\Transforms\CustomMappingWithInMemoryCustomType.cs (1)
30var pipeline = mlContext.Transforms.CustomMapping(AlienFusionProcess
Dynamic\Transforms\DropColumns.cs (1)
41var pipeline = mlContext.Transforms.DropColumns("ExtraColumn");
Dynamic\Transforms\Expression.cs (4)
32var pipeline = mlContext.Transforms.Expression("Expr1", "(x,y)=>log(y)+x", 34.Append(mlContext.Transforms.Expression("Expr2", "(b,s,i)=>b ? len(s) : i", 36.Append(mlContext.Transforms.Expression("Expr3", "(s,f1,f2,i)=>len(concat(s,\"a\"))+f1+f2+i", 38.Append(mlContext.Transforms.Expression("Expr4", "(x,y)=>cos(x+pi())*y",
Dynamic\Transforms\FeatureSelection\SelectFeaturesBasedOnCount.cs (2)
37mlContext.Transforms.FeatureSelection.SelectFeaturesBasedOnCount( 40.Append(mlContext.Transforms.FeatureSelection
Dynamic\Transforms\FeatureSelection\SelectFeaturesBasedOnCountMultiColumn.cs (1)
39var pipeline = mlContext.Transforms.FeatureSelection
Dynamic\Transforms\FeatureSelection\SelectFeaturesBasedOnMutualInformation.cs (1)
36var pipeline = mlContext.Transforms.FeatureSelection
Dynamic\Transforms\FeatureSelection\SelectFeaturesBasedOnMutualInformationMultiColumn.cs (1)
39var pipeline = mlContext.Transforms.FeatureSelection
Dynamic\Transforms\ImageAnalytics\ConvertToGrayScale.cs (2)
45var pipeline = mlContext.Transforms.LoadImages("ImageObject", 47.Append(mlContext.Transforms.ConvertToGrayscale("Grayscale",
Dynamic\Transforms\ImageAnalytics\ConvertToGrayScaleInMemory.cs (1)
24var pipeline = mlContext.Transforms.ConvertToGrayscale("GrayImage", "Image");
Dynamic\Transforms\ImageAnalytics\ConvertToImage.cs (2)
32var pipeline = mlContext.Transforms.ConvertToImage(imageHeight, 34.Append(mlContext.Transforms.ExtractPixels("Pixels", "Image"));
Dynamic\Transforms\ImageAnalytics\DnnFeaturizeImage.cs (4)
47var pipeline = mlContext.Transforms.LoadImages("ImageObject", 49.Append(mlContext.Transforms.ResizeImages("ImageObject", imageWidth: 51.Append(mlContext.Transforms.ExtractPixels("Pixels", "ImageObject")) 52.Append(mlContext.Transforms.DnnFeaturizeImage("FeaturizedImage",
Dynamic\Transforms\ImageAnalytics\ExtractPixels.cs (3)
47var pipeline = mlContext.Transforms.LoadImages("ImageObject", 49.Append(mlContext.Transforms.ResizeImages("ImageObjectResized", 52.Append(mlContext.Transforms.ExtractPixels("Pixels",
Dynamic\Transforms\ImageAnalytics\LoadImages.cs (1)
44var pipeline = mlContext.Transforms.LoadImages("ImageObject",
Dynamic\Transforms\ImageAnalytics\ResizeImages.cs (2)
44var pipeline = mlContext.Transforms.LoadImages("ImageObject", 46.Append(mlContext.Transforms.ResizeImages("ImageObjectResized",
Dynamic\Transforms\IndicateMissingValues.cs (1)
29var pipeline = mlContext.Transforms.IndicateMissingValues(
Dynamic\Transforms\IndicateMissingValuesMultiColumn.cs (1)
35var pipeline = mlContext.Transforms.IndicateMissingValues(new[] {
Dynamic\Transforms\NormalizeBinning.cs (2)
32var normalize = mlContext.Transforms.NormalizeBinning("Features", 39var normalizeFixZero = mlContext.Transforms.NormalizeBinning("Features",
Dynamic\Transforms\NormalizeBinningMulticolumn.cs (1)
37var normalize = mlContext.Transforms.NormalizeBinning(new[]{
Dynamic\Transforms\NormalizeGlobalContrast.cs (1)
26var approximation = mlContext.Transforms.NormalizeGlobalContrast(
Dynamic\Transforms\NormalizeLogMeanVariance.cs (2)
31var normalize = mlContext.Transforms.NormalizeLogMeanVariance( 36var normalizeNoCdf = mlContext.Transforms.NormalizeLogMeanVariance(
Dynamic\Transforms\NormalizeLogMeanVarianceFixZero.cs (2)
29var normalize = mlContext.Transforms.NormalizeLogMeanVariance("Features", true, useCdf: true); 32var normalizeNoCdf = mlContext.Transforms.NormalizeLogMeanVariance("Features", true, useCdf: false);
Dynamic\Transforms\NormalizeLpNorm.cs (1)
27var approximation = mlContext.Transforms.NormalizeLpNorm("Features",
Dynamic\Transforms\NormalizeMeanVariance.cs (2)
31var normalize = mlContext.Transforms.NormalizeMeanVariance("Features", 36var normalizeNoCdf = mlContext.Transforms.NormalizeMeanVariance(
Dynamic\Transforms\NormalizeMinMax.cs (2)
29var normalize = mlContext.Transforms.NormalizeMinMax("Features", 35var normalizeFixZero = mlContext.Transforms.NormalizeMinMax("Features",
Dynamic\Transforms\NormalizeMinMaxMulticolumn.cs (2)
53var normalize = mlContext.Transforms.NormalizeMinMax(columnPair, 59var normalizeFixZero = mlContext.Transforms.NormalizeMinMax(columnPair,
Dynamic\Transforms\NormalizeSupervisedBinning.cs (3)
39data = mlContext.Transforms.Conversion.MapValueToKey("Bin").Fit(data) 44var normalize = mlContext.Transforms.NormalizeSupervisedBinning( 52var normalizeFixZero = mlContext.Transforms.NormalizeSupervisedBinning(
Dynamic\Transforms\Projection\VectorWhiten.cs (1)
48var whiteningPipeline = ml.Transforms.VectorWhiten(nameof(
Dynamic\Transforms\Projection\VectorWhitenWithOptions.cs (1)
48var whiteningPipeline = ml.Transforms.VectorWhiten(nameof(
Dynamic\Transforms\ReplaceMissingValues.cs (2)
32var defaultPipeline = mlContext.Transforms.ReplaceMissingValues( 63var meanPipeline = mlContext.Transforms.ReplaceMissingValues(
Dynamic\Transforms\ReplaceMissingValuesMultiColumn.cs (2)
36var defaultPipeline = mlContext.Transforms.ReplaceMissingValues(new[] { 71var meanPipeline = mlContext.Transforms.ReplaceMissingValues(new[] {
Dynamic\Transforms\SelectColumns.cs (1)
41var pipeline = mlContext.Transforms.SelectColumns("Age", "Education");
Dynamic\Transforms\StatefulCustomMapping.cs (1)
53var pipeline = mlContext.Transforms.StatefulCustomMapping(mapping, init, contractName: null);
Dynamic\Transforms\Text\ApplyCustomWordEmbedding.cs (3)
47var textPipeline = mlContext.Transforms.Text.NormalizeText("Text") 48.Append(mlContext.Transforms.Text.TokenizeIntoWords("Tokens", 50.Append(mlContext.Transforms.Text.ApplyWordEmbedding("Features",
Dynamic\Transforms\Text\ApplyWordEmbedding.cs (3)
36var textPipeline = mlContext.Transforms.Text.NormalizeText("Text") 37.Append(mlContext.Transforms.Text.TokenizeIntoWords("Tokens", 39.Append(mlContext.Transforms.Text.ApplyWordEmbedding("Features",
Dynamic\Transforms\Text\FeaturizeText.cs (1)
53var textPipeline = mlContext.Transforms.Text.FeaturizeText("Features",
Dynamic\Transforms\Text\FeaturizeTextWithOptions.cs (1)
71var textPipeline = mlContext.Transforms.Text.FeaturizeText("Features",
Dynamic\Transforms\Text\LatentDirichletAllocation.cs (6)
40var pipeline = mlContext.Transforms.Text.NormalizeText("NormalizedText", 42.Append(mlContext.Transforms.Text.TokenizeIntoWords("Tokens", 44.Append(mlContext.Transforms.Text.RemoveDefaultStopWords("Tokens")) 45.Append(mlContext.Transforms.Conversion.MapValueToKey("Tokens")) 46.Append(mlContext.Transforms.Text.ProduceNgrams("Tokens")) 47.Append(mlContext.Transforms.Text.LatentDirichletAllocation(
Dynamic\Transforms\Text\NormalizeText.cs (1)
26var normTextPipeline = mlContext.Transforms.Text.NormalizeText(
Dynamic\Transforms\Text\ProduceHashedNgrams.cs (3)
45var textPipeline = mlContext.Transforms.Text.TokenizeIntoWords("Tokens", 47.Append(mlContext.Transforms.Conversion.MapValueToKey("Tokens")) 48.Append(mlContext.Transforms.Text.ProduceHashedNgrams(
Dynamic\Transforms\Text\ProduceHashedWordBags.cs (1)
47var textPipeline = mlContext.Transforms.Text.ProduceHashedWordBags(
Dynamic\Transforms\Text\ProduceNgrams.cs (3)
52var textPipeline = mlContext.Transforms.Text.TokenizeIntoWords("Tokens", 56.Append(mlContext.Transforms.Conversion.MapValueToKey("Tokens")) 57.Append(mlContext.Transforms.Text.ProduceNgrams("NgramFeatures",
Dynamic\Transforms\Text\ProduceWordBags.cs (1)
55var textPipeline = mlContext.Transforms.Text.ProduceWordBags(
Dynamic\Transforms\Text\RemoveDefaultStopWords.cs (2)
30var textPipeline = mlContext.Transforms.Text.TokenizeIntoWords("Words", 32.Append(mlContext.Transforms.Text.RemoveDefaultStopWords(
Dynamic\Transforms\Text\RemoveStopWords.cs (2)
29var textPipeline = mlContext.Transforms.Text.TokenizeIntoWords("Words", 31.Append(mlContext.Transforms.Text.RemoveStopWords(
Dynamic\Transforms\Text\TokenizeIntoCharactersAsKeys.cs (2)
28var textPipeline = mlContext.Transforms.Text 31.Append(mlContext.Transforms.Conversion.MapKeyToValue(
Dynamic\Transforms\Text\TokenizeIntoWords.cs (1)
29var textPipeline = mlContext.Transforms.Text.TokenizeIntoWords("Words",
Dynamic\Transforms\TimeSeries\DetectAnomalyBySrCnn.cs (1)
41ITransformer model = ml.Transforms.DetectAnomalyBySrCnn(
Dynamic\Transforms\TimeSeries\DetectAnomalyBySrCnnBatchPrediction.cs (1)
37var transformedData = ml.Transforms.DetectAnomalyBySrCnn(
Dynamic\Transforms\TimeSeries\DetectChangePointBySsa.cs (1)
59ITransformer model = ml.Transforms.DetectChangePointBySsa(
Dynamic\Transforms\TimeSeries\DetectChangePointBySsaBatchPrediction.cs (1)
61var transformedData = ml.Transforms.DetectChangePointBySsa(
Dynamic\Transforms\TimeSeries\DetectChangePointBySsaStream.cs (1)
59ITransformer model = ml.Transforms.DetectChangePointBySsa(
Dynamic\Transforms\TimeSeries\DetectIidChangePoint.cs (1)
57ITransformer model = ml.Transforms.DetectIidChangePoint(
Dynamic\Transforms\TimeSeries\DetectIidChangePointBatchPrediction.cs (1)
55var transformedData = ml.Transforms.DetectIidChangePoint(
Dynamic\Transforms\TimeSeries\DetectIidSpike.cs (1)
49ITransformer model = ml.Transforms.DetectIidSpike(outputColumnName,
Dynamic\Transforms\TimeSeries\DetectIidSpikeBatchPrediction.cs (1)
47var transformedData = ml.Transforms.DetectIidSpike(outputColumnName,
Dynamic\Transforms\TimeSeries\DetectSpikeBySsa.cs (1)
55ITransformer model = ml.Transforms.DetectSpikeBySsa(outputColumnName,
Dynamic\Transforms\TimeSeries\DetectSpikeBySsaBatchPrediction.cs (1)
63var transformedData = ml.Transforms.DetectSpikeBySsa(outputColumnName,
Dynamic\Transforms\TreeFeaturization\FastForestBinaryFeaturizationWithOptions.cs (1)
71var pipeline = mlContext.Transforms.FeaturizeByFastForestBinary(
Dynamic\Transforms\TreeFeaturization\FastForestRegressionFeaturizationWithOptions.cs (1)
71var pipeline = mlContext.Transforms.FeaturizeByFastForestRegression(
Dynamic\Transforms\TreeFeaturization\FastTreeBinaryFeaturizationWithOptions.cs (1)
73var pipeline = mlContext.Transforms.FeaturizeByFastTreeBinary(
Dynamic\Transforms\TreeFeaturization\FastTreeRankingFeaturizationWithOptions.cs (1)
69var pipeline = mlContext.Transforms.FeaturizeByFastTreeRanking(
Dynamic\Transforms\TreeFeaturization\FastTreeRegressionFeaturizationWithOptions.cs (1)
71var pipeline = mlContext.Transforms.FeaturizeByFastTreeRegression(
Dynamic\Transforms\TreeFeaturization\FastTreeTweedieFeaturizationWithOptions.cs (1)
71var pipeline = mlContext.Transforms.FeaturizeByFastTreeTweedie(
Dynamic\Transforms\TreeFeaturization\PretrainedTreeEnsembleFeaturizationWithOptions.cs (1)
65var treeFeaturizer = mlContext.Transforms
Dynamic\WithOnFitDelegate.cs (1)
44mlContext.Transforms
Microsoft.ML.Samples.GPU (18)
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\TextClassification.cs (4)
100mlContext.Transforms.Text.TokenizeIntoWords( 103.Append(mlContext.Transforms.Conversion.MapValue( 109.Append(mlContext.Transforms.CustomMapping( 115.Append(mlContext.Transforms.CopyColumns(
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (3)
49shuffledFullImagesDataset = mlContext.Transforms.Conversion 52.Append(mlContext.Transforms.LoadRawImageBytes("Image", 68.Append(mlContext.Transforms.Conversion.MapKeyToValue(
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (5)
53trainDataset = mlContext.Transforms.Conversion 56.Append(mlContext.Transforms.LoadRawImageBytes("Image", 69testDataset = mlContext.Transforms.Conversion 72.Append(mlContext.Transforms.LoadRawImageBytes("Image", 104.Append(mlContext.Transforms.Conversion.MapKeyToValue(
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (3)
48shuffledFullImagesDataset = mlContext.Transforms.Conversion 51.Append(mlContext.Transforms.LoadRawImageBytes("Image", 91var pipeline = mlContext.Transforms.LoadRawImageBytes(
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (3)
48shuffledFullImagesDataset = mlContext.Transforms.Conversion 51.Append(mlContext.Transforms.LoadRawImageBytes("Image", 84.Append(mlContext.Transforms.Conversion.MapKeyToValue(
Microsoft.ML.Samples.OneDal (3)
Program.cs (3)
67var preprocessingPipeline = mlContext.Transforms.Concatenate("Features", featuresArray); 99var preprocessingPipeline = mlContext.Transforms.Concatenate("Features", featuresArray); 131var preprocessingPipeline = mlContext.Transforms.Concatenate("Features", featuresArray);
Microsoft.ML.SamplesUtils (10)
SamplesDatasetUtils.cs (10)
91var pipeline = mlContext.Transforms.CopyColumns("Label", "IsOver50K") 93.Append(mlContext.Transforms.Categorical.OneHotEncoding("workclass")) 94.Append(mlContext.Transforms.Categorical.OneHotEncoding("education")) 95.Append(mlContext.Transforms.Categorical.OneHotEncoding("marital-status")) 96.Append(mlContext.Transforms.Categorical.OneHotEncoding("occupation")) 97.Append(mlContext.Transforms.Categorical.OneHotEncoding("relationship")) 98.Append(mlContext.Transforms.Categorical.OneHotEncoding("ethnicity")) 99.Append(mlContext.Transforms.Categorical.OneHotEncoding("native-country")) 101.Append(mlContext.Transforms.Concatenate("Features", "workclass", "education", "marital-status", 105.Append(mlContext.Transforms.NormalizeMinMax("Features"));
Microsoft.ML.TensorFlow.Tests (55)
TensorFlowEstimatorTests.cs (12)
162var pipe = ML.Transforms.LoadImages("Input", imageFolder, "imagePath") 163.Append(ML.Transforms.ResizeImages("Input", imageHeight, imageWidth)) 164.Append(ML.Transforms.ExtractPixels("Input", interleavePixelColors: true)) 205var pipe = ML.Transforms.LoadImages("Input", imageFolder, "imagePath") 206.Append(ML.Transforms.ResizeImages("Input", imageHeight, imageWidth)) 207.Append(ML.Transforms.ExtractPixels("Input", interleavePixelColors: true)) 219pipe = ML.Transforms.LoadImages("Input", imageFolder, "imagePath") 220.Append(ML.Transforms.ResizeImages("Input", imageHeight, imageWidth)) 221.Append(ML.Transforms.ExtractPixels("Input", interleavePixelColors: true)) 255var pipe = ML.Transforms.LoadImages("Input", imageFolder, "imagePath") 256.Append(ML.Transforms.ResizeImages("Input", imageHeight, imageWidth)) 257.Append(ML.Transforms.ExtractPixels("Input", interleavePixelColors: true))
TensorflowTests.cs (43)
509var pixels = _mlContext.Transforms.ExtractPixels("image_tensor", "ImageCropped", outputAsFloatArray: false).Fit(cropped).Transform(cropped); 553var images = _mlContext.Transforms.LoadImages("ImageReal", "ImagePath", imageFolder).Fit(data).Transform(data); 554var cropped = _mlContext.Transforms.ResizeImages("ImageCropped", 224, 224, "ImageReal").Fit(images).Transform(images); 555var pixels = _mlContext.Transforms.ExtractPixels(inputName, "ImageCropped", interleavePixelColors: true).Fit(cropped).Transform(cropped); 668var pipe = _mlContext.Transforms.CopyColumns("reshape_input", "Placeholder") 670.Append(_mlContext.Transforms.Concatenate("Features", "Softmax", "dense/Relu")) 709var pipe = _mlContext.Transforms.Categorical.OneHotEncoding("OneHotLabel", "Label") 710.Append(_mlContext.Transforms.Normalize(new NormalizingEstimator.MinMaxColumnOptions("Features", "Placeholder"))) 723.Append(_mlContext.Transforms.Concatenate("Features", "Prediction")) 724.Append(_mlContext.Transforms.Conversion.MapValueToKey("KeyLabel", "Label", maximumNumberOfKeys: 10)) 823var pipe = _mlContext.Transforms.CopyColumns("Features", "Placeholder") 837.Append(_mlContext.Transforms.Concatenate("Features", "Prediction")) 892var pipe = _mlContext.Transforms.CopyColumns("reshape_input", "Placeholder") 894.Append(_mlContext.Transforms.Concatenate("Features", new[] { "Softmax", "dense/Relu" })) 1076var images = _mlContext.Transforms.LoadImages("ImageReal", imageFolder, "ImagePath").Fit(data).Transform(data); 1077var cropped = _mlContext.Transforms.ResizeImages("ImageCropped", imageWidth, imageHeight, "ImageReal").Fit(images).Transform(images); 1078var pixels = _mlContext.Transforms.ExtractPixels("Input", "ImageCropped", interleavePixelColors: true).Fit(cropped).Transform(cropped); 1116var pipeline = _mlContext.Transforms.ResizeImages("ResizedImage", imageWidth, imageHeight, nameof(InMemoryImage.LoadedImage)) 1117.Append(_mlContext.Transforms.ExtractPixels("Input", "ResizedImage", interleavePixelColors: true)) 1119.Append(_mlContext.Transforms.Conversion.MapValueToKey("Label")) 1280var estimator = _mlContext.Transforms.Text.TokenizeIntoWords("TokenizedWords", "Sentiment_Text") 1281.Append(_mlContext.Transforms.Conversion.MapValue(lookupMap, lookupMap.Schema["Words"], lookupMap.Schema["Ids"], 1290.Append(_mlContext.Transforms.CopyColumns("Prediction", "Prediction/Softmax")) 1351.Append(_mlContext.Transforms.CopyColumns(new[] { new InputOutputColumnPair("AOut", "Original_A"), new InputOutputColumnPair("BOut", "Joined_Splited_Text") })); 1406shuffledFullImagesDataset = _mlContext.Transforms.Conversion 1418var pipeline = _mlContext.Transforms.LoadRawImageBytes("Image", _fullImagesetFolderPath, "ImagePath") 1420.Append(_mlContext.Transforms.Conversion.MapKeyToValue(outputColumnName: "PredictedLabel", inputColumnName: "PredictedLabel"))); ; 1481shuffledFullImagesDataset = _mlContext.Transforms.Conversion 1492var validationSet = _mlContext.Transforms.LoadRawImageBytes("Image", _fullImagesetFolderPath, "ImagePath") 1521var pipeline = _mlContext.Transforms.LoadRawImageBytes("Image", _fullImagesetFolderPath, "ImagePath") 1523.Append(_mlContext.Transforms.Conversion.MapKeyToValue(outputColumnName: "PredictedLabel", inputColumnName: "PredictedLabel"))); 1613shuffledFullImagesDataset = _mlContext.Transforms.Conversion 1624var validationSet = _mlContext.Transforms.LoadRawImageBytes("Image", _fullImagesetFolderPath, "ImagePath") 1679var pipeline = _mlContext.Transforms.LoadRawImageBytes("Image", _fullImagesetFolderPath, "ImagePath") 1681.Append(_mlContext.Transforms.Conversion.MapKeyToValue( 1768shuffledFullImagesDataset = _mlContext.Transforms.Conversion 1781var validationSet = _mlContext.Transforms.LoadRawImageBytes("Image", _fullImagesetFolderPath, "ImagePath") 1813var pipeline = _mlContext.Transforms.LoadRawImageBytes("Image", _fullImagesetFolderPath, "ImagePath") 1857shuffledFullImagesDataset = _mlContext.Transforms.Conversion 1859.Append(_mlContext.Transforms.LoadRawImageBytes("Image", fullImagesetFolderPath, "ImagePath")) 2062var pipeline = _mlContext.Transforms.LoadImages("Input", imageFolder, "imagePath") 2063.Append(_mlContext.Transforms.ResizeImages("Input", imageHeight, imageWidth)) 2064.Append(_mlContext.Transforms.ExtractPixels("Input", interleavePixelColors: true))
Microsoft.ML.TestFramework (4)
DataPipe\TestDataPipe.cs (4)
858IDataView view1 = ML.Transforms.SelectColumns(colsChoose).Fit(pipe).Transform(pipe); 859view2 = ML.Transforms.SelectColumns(colsChoose).Fit(view2).Transform(view2); 1549var est = ML.Transforms.Text.LatentDirichletAllocation(opt); 1606var lda = ML.Transforms.Text.LatentDirichletAllocation("Zeros").Fit(srcView).Transform(srcView);
Microsoft.ML.Tests (583)
CachingTests.cs (9)
45var pipe = ML.Transforms.CopyColumns("F1", "Features") 46.Append(ML.Transforms.NormalizeMinMax("Norm1", "F1")) 47.Append(ML.Transforms.NormalizeMeanVariance("Norm2", "F1")); 54pipe = ML.Transforms.CopyColumns("F1", "Features") 56.Append(ML.Transforms.NormalizeMinMax("Norm1", "F1")) 57.Append(ML.Transforms.NormalizeMeanVariance("Norm2", "F1")); 75.Append(ML.Transforms.CopyColumns("F1", "Features")) 76.Append(ML.Transforms.NormalizeMinMax("Norm1", "F1")) 77.Append(ML.Transforms.NormalizeMeanVariance("Norm2", "F1"));
CalibratedModelParametersTests.cs (3)
133var pipeline = ML.Transforms.Concatenate("Features", "X1", "X2Important", "X3", "X4Rand") 134.Append(ML.Transforms.NormalizeMinMax("Features")); 136return pipeline.Append(ML.Transforms.Conversion.ConvertType("Label", outputKind: DataKind.Boolean))
DatabaseLoaderTests.cs (15)
67IEstimator<ITransformer> pipeline = mlContext.Transforms.Conversion.MapValueToKey("Label") 68.Append(mlContext.Transforms.Concatenate("Features", "SepalLength", "SepalWidth", "PetalLength", "PetalWidth")) 71.Append(mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel")); 103IEstimator<ITransformer> pipeline = mlContext.Transforms.Conversion.MapValueToKey("Label") 104.Append(mlContext.Transforms.Concatenate("Features", "SepalLength", "SepalWidth", "PetalLength", "PetalWidth")) 107.Append(mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel")); 139IEstimator<ITransformer> pipeline = mlContext.Transforms.Conversion.MapValueToKey("Label") 140.Append(mlContext.Transforms.Concatenate("Features", "SepalInfo", "PetalInfo")) 143.Append(mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel")); 171IEstimator<ITransformer> pipeline = mlContext.Transforms.Conversion.MapValueToKey("Label") 172.Append(mlContext.Transforms.Concatenate("Features", "SepalInfo", "PetalInfo")) 175.Append(mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel")); 203var pipeline = mlContext.Transforms.Conversion.MapValueToKey("Label") 204.Append(mlContext.Transforms.Concatenate("Features", "SepalLength", "SepalWidth", "PetalLength", "PetalWidth")) 207.Append(mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
FeatureContributionTests.cs (26)
33var estPipe = ML.Transforms.CalculateFeatureContribution(model) 34.Append(ML.Transforms.CalculateFeatureContribution(model, normalize: false)) 35.Append(ML.Transforms.CalculateFeatureContribution(model, numberOfPositiveContributions: 0)) 36.Append(ML.Transforms.CalculateFeatureContribution(model, numberOfNegativeContributions: 0)) 37.Append(ML.Transforms.CalculateFeatureContribution(model, numberOfPositiveContributions: 0, numberOfNegativeContributions: 0)); 201var est = ML.Transforms.CalculateFeatureContribution(model, numberOfPositiveContributions: 3, numberOfNegativeContributions: 0) 202.Append(ML.Transforms.CalculateFeatureContribution(model, numberOfPositiveContributions: 0, numberOfNegativeContributions: 3)) 203.Append(ML.Transforms.CalculateFeatureContribution(model, numberOfPositiveContributions: 1, numberOfNegativeContributions: 1)) 204.Append(ML.Transforms.CalculateFeatureContribution(model, numberOfPositiveContributions: 1, numberOfNegativeContributions: 1, normalize: false)); 225var est = ML.Transforms.CalculateFeatureContribution(model, numberOfPositiveContributions: 3, numberOfNegativeContributions: 0) 226.Append(ML.Transforms.CalculateFeatureContribution(model, numberOfPositiveContributions: 0, numberOfNegativeContributions: 3)) 227.Append(ML.Transforms.CalculateFeatureContribution(model, numberOfPositiveContributions: 1, numberOfNegativeContributions: 1)) 228.Append(ML.Transforms.CalculateFeatureContribution(model, numberOfPositiveContributions: 1, numberOfNegativeContributions: 1, normalize: false)); 314var pipeline = ML.Transforms.Concatenate("Features", "X1", "X2VBuffer", "X3Important") 315.Append(ML.Transforms.NormalizeMinMax("Features")); 318return pipeline.Append(ML.Transforms.Conversion.ConvertType("Label", outputKind: DataKind.Boolean)) 321return pipeline.Append(ML.Transforms.Conversion.MapValueToKey("Label")) 324return pipeline.Append(ML.Transforms.Conversion.MapValueToKey("GroupId")) 424var dataProcessPipeline = ML.Transforms.CopyColumns(outputColumnName: DefaultColumnNames.Label, inputColumnName: nameof(TaxiTrip.FareAmount)) 425.Append(ML.Transforms.Categorical.OneHotEncoding(outputColumnName: vendorIdEncoded, inputColumnName: nameof(TaxiTrip.VendorId))) 426.Append(ML.Transforms.Categorical.OneHotEncoding(outputColumnName: rateCodeEncoded, inputColumnName: nameof(TaxiTrip.RateCode))) 427.Append(ML.Transforms.Categorical.OneHotEncoding(outputColumnName: paymentTypeEncoded, inputColumnName: nameof(TaxiTrip.PaymentType))) 428.Append(ML.Transforms.NormalizeMeanVariance(outputColumnName: nameof(TaxiTrip.PassengerCount))) 429.Append(ML.Transforms.NormalizeMeanVariance(outputColumnName: nameof(TaxiTrip.TripTime))) 430.Append(ML.Transforms.NormalizeMeanVariance(outputColumnName: nameof(TaxiTrip.TripDistance))) 431.Append(ML.Transforms.Concatenate(DefaultColumnNames.Features, vendorIdEncoded, rateCodeEncoded, paymentTypeEncoded,
ImagesTests.cs (3)
239var pipeline = ML.Transforms.ConvertToGrayscale("GrayImage", "Image"); 1093var pipeline = mlContext.Transforms.ConvertToImage(224, 224, "Features"); 1183var pipeline = mlContext.Transforms.ResizeImages("ResizedImage", 100, 100, nameof(InMemoryImage.LoadedImage));
OnnxConversionTest.cs (172)
77mlContext.Transforms.NormalizeMinMax("FeatureVector") 153var pipeline = mlContext.Transforms.NormalizeMinMax("Features"). 245var initialPipeline = mlContext.Transforms.ReplaceMissingValues("Features"). 246Append(mlContext.Transforms.NormalizeMinMax("Features")); 300var initialPipeline = ML.Transforms.ReplaceMissingValues("Features"). 301Append(ML.Transforms.NormalizeMinMax("Features")); 425var pipeline = mlContext.Transforms.NormalizeLpNorm(nameof(DataPoint.Features), norm: norm, ensureZeroMean: ensureZeroMean); 481var pipeline = mlContext.Transforms.Categorical.OneHotEncoding("Vector", "Key", outputKind); 573mlContext.Transforms.NormalizeMinMax("FeatureVector") 604mlContext.Transforms.NormalizeMinMax("FeatureVector") 628var pipeline = mlContext.Transforms.ReplaceMissingValues("Features"). 629Append(mlContext.Transforms.NormalizeMinMax("Features")). 630Append(mlContext.Transforms.Conversion.MapValueToKey("Label")). 774var pipeline = mlContext.Transforms.Concatenate("Features", "VectorDouble1", "VectorDouble2"); 792var pipeline = mlContext.Transforms.Categorical.OneHotEncoding("F2", "F2", Transforms.OneHotEncodingEstimator.OutputKind.Bag) 793.Append(mlContext.Transforms.ReplaceMissingValues(new MissingValueReplacingEstimator.ColumnOptions("F2"))) 794.Append(mlContext.Transforms.Concatenate("Features", "F1", "F2")) 795.Append(mlContext.Transforms.NormalizeMinMax("Features")) 826var onnxEstimator = mlContext.Transforms.ApplyOnnxModel(onnxModelPath, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 853var pipeline = mlContext.Transforms.Text.ApplyWordEmbedding("Embed", embedNetworkPath, "Tokens"); 949var pipeline = mlContext.Transforms.Conversion.ConvertType("ValueConverted", "Value", outputKind: toKind); 975var pipeline = ML.Transforms.ProjectToPrincipalComponents("pca", "features", rank: 5, seed: 1, ensureZeroMean: zeroMean); 988var onnxEstimator = mlContext.Transforms.ApplyOnnxModel(onnxModelPath, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 1005var pipeline = mlContext.Transforms.Categorical.OneHotHashEncoding(new[]{ 1042var pipeline = ML.Transforms.Conversion.Hash("ValueHashed", "Value"); 1167var pipeline = mlContext.Transforms.IndicateMissingValues(new[] { new InputOutputColumnPair("MissingIndicator", "Features"), }) 1168.Append(mlContext.Transforms.Conversion.ConvertType("MissingIndicator", outputKind: DataKind.Int32)); 1208var pipeline = mlContext.Transforms.Conversion.MapValueToKey("Key", "Value", 1247pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<float, int> { { 3, 6 }, { 23, 46 } }, "Keys", treatValuesAsKeyType)); 1248pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<float, long> { { 3, 6 }, { 23, 46 } }, "Keys", treatValuesAsKeyType)); 1249pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<float, short> { { 3, 6 }, { 23, 46 } }, "Keys", treatValuesAsKeyType)); 1250pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<float, uint> { { 3, 6 }, { 23, 46 } }, "Keys", treatValuesAsKeyType)); 1251pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<float, ushort> { { 3, 6 }, { 23, 46 } }, "Keys", treatValuesAsKeyType)); 1252pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<float, ulong> { { 3, 6 }, { 23, 46 } }, "Keys", treatValuesAsKeyType)); 1253pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<float, string> { { 3, "True" }, { 23, "False" } }, "Keys", treatValuesAsKeyType)); 1254pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<float, float> { { 3, 6 }, { 23, 46 } }, "Keys", treatValuesAsKeyType)); 1255pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<float, double> { { 3, 698 }, { 23, 7908 } }, "Keys", treatValuesAsKeyType)); 1256pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<float, bool> { { 3, false }, { 23, true } }, "Keys", treatValuesAsKeyType)); 1260pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<double, int> { { 3, 6 }, { 23, 46 } }, "Keys")); 1261pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<double, uint> { { 3, 6 }, { 23, 46 } }, "Keys")); 1262pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<double, ushort> { { 3, 6 }, { 23, 46 } }, "Keys")); 1263pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<double, ulong> { { 3, 6 }, { 23, 46 } }, "Keys")); 1264pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<double, string> { { 3, "True" }, { 23, "False" } }, "Keys")); 1265pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<double, float> { { 3, 6 }, { 23, 46 } }, "Keys")); 1266pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<double, long> { { 3, 698 }, { 23, 7908 } }, "Keys")); 1267pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<double, double> { { 3, 698 }, { 23, 7908 } }, "Keys")); 1268pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<double, bool> { { 3, true }, { 23, false } }, "Keys")); 1272pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<bool, int> { { true, 6 }, { false, 46 } }, "Keys")); 1273pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<bool, short> { { true, 6 }, { false, 46 } }, "Keys")); 1274pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<bool, uint> { { true, 6 }, { false, 46 } }, "Keys")); 1275pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<bool, ushort> { { true, 6 }, { false, 46 } }, "Keys")); 1276pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<bool, ulong> { { true, 6 }, { false, 46 } }, "Keys")); 1277pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<bool, string> { { true, "True" }, { false, "False" } }, "Keys")); 1278pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<bool, float> { { true, 6 }, { false, 46 } }, "Keys")); 1279pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<bool, long> { { true, 698 }, { false, 7908 } }, "Keys")); 1280pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<bool, double> { { true, 698 }, { false, 7908 } }, "Keys")); 1281pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<bool, bool> { { false, true }, { true, false } }, "Keys")); 1285pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<string, int> { { "3", 3 }, { "23", 23 } }, "Keys")); 1286pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<string, short> { { "3", 3 }, { "23", 23 } }, "Keys")); 1287pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<string, uint> { { "3", 6 }, { "23", 46 } }, "Keys")); 1288pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<string, ushort> { { "3", 6 }, { "23", 46 } }, "Keys")); 1289pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<string, ulong> { { "3", 6 }, { "23", 46 } }, "Keys")); 1290pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<string, float> { { "3", 6 }, { "23", 23 } }, "Keys")); 1291pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<string, double> { { "3", 6 }, { "23", 23 } }, "Keys")); 1292pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<string, long> { { "3", 3 }, { "23", 23 } }, "Keys")); 1293pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<string, bool> { { "3", true }, { "23", false } }, "Keys")); 1297pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<int, short> { { 3, 6 }, { 23, 46 } }, "Keys")); 1298pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<int, int> { { 3, 6 }, { 23, 46 } }, "Keys")); 1299pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<int, long> { { 3, 6 }, { 23, 46 } }, "Keys")); 1300pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<int, ushort> { { 3, 6 }, { 23, 46 } }, "Keys")); 1301pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<int, uint> { { 3, 6 }, { 23, 46 } }, "Keys")); 1302pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<int, ulong> { { 3, 6 }, { 23, 46 } }, "Keys")); 1303pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<int, string> { { 3, "True" }, { 23, "False" } }, "Keys")); 1304pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<int, float> { { 3, 6.435f }, { 23, 23.534f } }, "Keys")); 1305pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<int, double> { { 3, 6.435f }, { 23, 23.534f } }, "Keys")); 1309pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<short, short> { { 3, 6 }, { 23, 46 } }, "Keys")); 1310pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<short, int> { { 3, 6 }, { 23, 46 } }, "Keys")); 1311pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<short, long> { { 3, 6 }, { 23, 46 } }, "Keys")); 1312pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<short, ushort> { { 3, 6 }, { 23, 46 } }, "Keys")); 1313pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<short, uint> { { 3, 6 }, { 23, 46 } }, "Keys")); 1314pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<short, ulong> { { 3, 6 }, { 23, 46 } }, "Keys")); 1315pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<short, string> { { 3, "True" }, { 23, "False" } }, "Keys")); 1316pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<short, float> { { 3, 6.435f }, { 23, 23.534f } }, "Keys")); 1317pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<short, double> { { 3, 6.435f }, { 23, 23.534f } }, "Keys")); 1321pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<long, short> { { 3, 6 }, { 23, 46 } }, "Keys")); 1322pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<long, int> { { 3, 6 }, { 23, 46 } }, "Keys")); 1323pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<long, long> { { 3, 6 }, { 23, 46 } }, "Keys")); 1324pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<long, ushort> { { 3, 6 }, { 23, 46 } }, "Keys")); 1325pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<long, uint> { { 3, 6 }, { 23, 46 } }, "Keys")); 1326pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<long, ulong> { { 3, 6 }, { 23, 46 } }, "Keys")); 1327pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<long, string> { { 3, "True" }, { 23, "False" } }, "Keys")); 1328pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<long, float> { { 3, 6.435f }, { 23, 23.534f } }, "Keys")); 1329pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<long, double> { { 3, 6.435f }, { 23, 23.534f } }, "Keys")); 1333pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<uint, short> { { 3, 6 }, { 23, 46 } }, "Keys")); 1334pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<uint, int> { { 3, 6 }, { 23, 46 } }, "Keys")); 1335pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<uint, long> { { 3, 6 }, { 23, 46 } }, "Keys")); 1336pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<uint, ushort> { { 3, 6 }, { 23, 46 } }, "Keys")); 1337pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<uint, uint> { { 3, 6 }, { 23, 46 } }, "Keys")); 1338pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<uint, ulong> { { 3, 6 }, { 23, 46 } }, "Keys")); 1339pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<uint, string> { { 3, "True" }, { 23, "False" } }, "Keys")); 1340pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<uint, float> { { 3, 6.435f }, { 23, 23.534f } }, "Keys")); 1341pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<uint, double> { { 3, 6.435f }, { 23, 23.534f } }, "Keys")); 1345pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<ushort, short> { { 3, 6 }, { 23, 46 } }, "Keys")); 1346pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<ushort, int> { { 3, 6 }, { 23, 46 } }, "Keys")); 1347pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<ushort, long> { { 3, 6 }, { 23, 46 } }, "Keys")); 1348pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<ushort, ushort> { { 3, 6 }, { 23, 46 } }, "Keys")); 1349pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<ushort, uint> { { 3, 6 }, { 23, 46 } }, "Keys")); 1350pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<ushort, ulong> { { 3, 6 }, { 23, 46 } }, "Keys")); 1351pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<ushort, string> { { 3, "True" }, { 23, "False" } }, "Keys")); 1352pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<ushort, float> { { 3, 6.435f }, { 23, 23.534f } }, "Keys")); 1353pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<ushort, double> { { 3, 6.435f }, { 23, 23.534f } }, "Keys")); 1357pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<ulong, short> { { 3, 6 }, { 23, 46 } }, "Keys")); 1358pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<ulong, int> { { 3, 6 }, { 23, 46 } }, "Keys")); 1359pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<ulong, long> { { 3, 6 }, { 23, 46 } }, "Keys")); 1360pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<ulong, ushort> { { 3, 6 }, { 23, 46 } }, "Keys")); 1361pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<ulong, uint> { { 3, 6 }, { 23, 46 } }, "Keys")); 1362pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<ulong, ulong> { { 3, 6 }, { 23, 46 } }, "Keys")); 1363pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<ulong, string> { { 3, "True" }, { 23, "False" } }, "Keys")); 1364pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<ulong, float> { { 3, 6.435f }, { 23, 23.534f } }, "Keys")); 1365pipelines.Add(mlContext.Transforms.Conversion.MapValue("Value", new Dictionary<ulong, double> { { 3, 6.435f }, { 23, 23.534f } }, "Keys")); 1410mlContext.Transforms.Conversion.MapValueToKey("Key", "Value"). 1411Append(mlContext.Transforms.Conversion.MapKeyToValue("Value", "Key")), 1413mlContext.Transforms.Conversion.MapValueToKey("Value"). 1414Append(mlContext.Transforms.Conversion.MapKeyToValue("Value")) 1448var pipeline = mlContext.Transforms.Text.TokenizeIntoWords("Tokens", "Text", new[] { ' ' }); 1478mlContext.Transforms.Text.TokenizeIntoWords("Tokens", "Text", new[] { ' ' }) 1479.Append(mlContext.Transforms.Conversion.MapValueToKey("Tokens")) 1480.Append(mlContext.Transforms.Text.ProduceNgrams("NGrams", "Tokens", 1485mlContext.Transforms.Text.TokenizeIntoCharactersAsKeys("Tokens", "Text") 1486.Append(mlContext.Transforms.Text.ProduceNgrams("NGrams", "Tokens", 1491mlContext.Transforms.Text.ProduceWordBags("Tokens", "Text", 1496mlContext.Transforms.Text.TokenizeIntoWords("Tokens0", "Text") 1497.Append(mlContext.Transforms.Text.ProduceWordBags("Tokens", "Tokens0")) 1515var onnxEstimator = mlContext.Transforms.ApplyOnnxModel(onnxFilePath, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 1541var pipeline = mlContext.Transforms.Text.TokenizeIntoWords("Words", "Text") 1542.Append(mlContext.Transforms.Text.RemoveStopWords( 1565var pipeline = mlContext.Transforms.Text.TokenizeIntoWords("Words", "Text") 1566.Append(mlContext.Transforms.Text.RemoveDefaultStopWords( 1632var onnxEstimator = mlContext.Transforms.ApplyOnnxModel(outputNames, inputNames, onnxModelPath, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 1680var initialPipeline = mlContext.Transforms.ReplaceMissingValues("Features") 1681.Append(mlContext.Transforms.NormalizeMinMax("Features")) 1682.Append(mlContext.Transforms.Conversion.MapValueToKey("Label")); 1705var pipeline = mlContext.Transforms.CopyColumns("Target1", "Target"); 1723var mlpipeline = mlContext.Transforms.CopyColumns("Target1", "Target"); 1743var pipeline = mlContext.Transforms.ApplyOnnxModel(onnxModelPath); 1776var pipeline1 = mlContext.Transforms.Conversion.MapValueToKey("Label"); 1791var pipeline2 = mlContext.Transforms.CopyColumns("Label", "Label"); 1806var onnxEstimator = mlContext.Transforms.ApplyOnnxModel(outputNames, inputNames, onnxModelPath, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 1819var onnxEstimator2 = mlContext.Transforms.ApplyOnnxModel(outputNames, inputNames, onnxModelPath2, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu); 1856mlContext.Transforms.FeatureSelection.SelectFeaturesBasedOnCount("VectorOutput", "Vector", count: 690). 1857Append(mlContext.Transforms.FeatureSelection.SelectFeaturesBasedOnCount("ScalarOutput", "Scalar", count: 100)), 1860mlContext.Transforms.FeatureSelection.SelectFeaturesBasedOnCount("VectorOutput", "Vector", count: 800). 1861Append(mlContext.Transforms.FeatureSelection.SelectFeaturesBasedOnCount("ScalarOutput", "Scalar", count: 800)), 1863mlContext.Transforms.FeatureSelection.SelectFeaturesBasedOnMutualInformation("VectorOutput", "Vector"). 1864Append(mlContext.Transforms.FeatureSelection.SelectFeaturesBasedOnMutualInformation("ScalarOutput", "Scalar")) 1898var pipeline = mlContext.Transforms.ReplaceMissingValues("Size").Append(mlContext.Transforms.SelectColumns(new[] { "Size", "Shape", "Thickness", "Label" })); 1956var initialPipeline = mlContext.Transforms.ReplaceMissingValues("MyFeatureVector"). 1957Append(mlContext.Transforms.NormalizeMinMax("MyFeatureVector")); 2005var initialPipeline = mlContext.Transforms.ReplaceMissingValues("MyFeatureVector") 2006.Append(mlContext.Transforms.NormalizeMinMax("MyFeatureVector")) 2007.Append(mlContext.Transforms.Conversion.MapValueToKey("Label")); 2026var pipe = ML.Transforms.Categorical.OneHotHashEncoding(new[]{ 2114pipe = ML.Transforms.NormalizeMinMax(nameof(DataPoint.Features), fixZero: fixZero); 2119pipe = ML.Transforms.NormalizeMinMax(nameof(DataPoint.Features), fixZero: fixZero); 2124pipe = ML.Transforms.NormalizeMeanVariance(nameof(DataPoint.Features), fixZero: fixZero); 2129pipe = ML.Transforms.NormalizeMeanVariance(nameof(DataPoint.Features), fixZero: fixZero); 2134pipe = ML.Transforms.NormalizeLogMeanVariance(nameof(DataPoint.Features), fixZero: fixZero, useCdf: false); 2139pipe = ML.Transforms.NormalizeLogMeanVariance(nameof(DataPoint.Features), fixZero: fixZero, useCdf: false); 2144pipe = ML.Transforms.NormalizeRobustScaling(nameof(DataPoint.Features), centerData: fixZero); 2149pipe = ML.Transforms.NormalizeRobustScaling(nameof(DataPoint.Features), centerData: fixZero); 2254var onnxEstimator = ML.Transforms.ApplyOnnxModel(onnxModelPath, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu);
OnnxSequenceTypeWithAttributesTest.cs (2)
46var pipeline = ctx.Transforms.ApplyOnnxModel( 85var pipeline = ctx.Transforms.ApplyOnnxModel(
PermutationFeatureImportanceTests.cs (11)
106var model = ML.Transforms.CopyColumns("Label", "Label").Append(ML.Regression.Trainers.OnlineGradientDescent()).Fit(data); 858var pipeline = ML.Transforms.Concatenate("Features", "X1", "X2Important", "X3", "X4Rand") 859.Append(ML.Transforms.NormalizeMinMax("Features")); 861return pipeline.Append(ML.Transforms.Conversion.ConvertType("Label", outputKind: DataKind.Boolean)) 864return pipeline.Append(ML.Transforms.Conversion.MapValueToKey("Label")) 867return pipeline.Append(ML.Transforms.Conversion.MapValueToKey("GroupId")) 938var pipeline = ML.Transforms.Concatenate("Features", "X1", "X2VBuffer", "X3Important") 939.Append(ML.Transforms.NormalizeMinMax("Features")); 942return pipeline.Append(ML.Transforms.Conversion.ConvertType("Label", outputKind: DataKind.Boolean)) 947return pipeline.Append(ML.Transforms.Conversion.MapValueToKey("Label")) 951return pipeline.Append(ML.Transforms.Conversion.MapValueToKey("GroupId"))
RangeFilterTests.cs (1)
31data = ML.Transforms.Conversion.Hash("Key", "Strings", numberOfBits: 20).Fit(data).Transform(data);
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (30)
48var pipeline = mlContext.Transforms.Concatenate("AllFeatures", "Education", "MaritalStatus"); 102mlContext.Transforms 170mlContext.Transforms.NormalizeMinMax("FeatureVector") 230mlContext.Transforms.Concatenate("Features", "SepalLength", "SepalWidth", "PetalLength", "PetalWidth") 232.Append(mlContext.Transforms.Conversion.MapValueToKey("Label"), TransformerScope.TrainTest) 264var finalPipeline = pipeline.Append(mlContext.Transforms.Conversion.MapKeyToValue("Data", "PredictedLabel")); 311mlContext.Transforms.Normalize( 351var pipeline = context.Transforms.Concatenate("Features", "CrimesPerCapita", "PercentResidental", "PercentNonRetail", "CharlesRiver", "NitricOxides", 391var pipeline = context.Transforms.Concatenate("Features", "CrimesPerCapita", "PercentResidental", "PercentNonRetail", "CharlesRiver", "NitricOxides", 426var pipeline = context.Transforms.Concatenate("Features", "CrimesPerCapita", "PercentResidental", "PercentNonRetail", "CharlesRiver", "NitricOxides", 462var pipeline = context.Transforms.Concatenate("Features", "CrimesPerCapita", "PercentResidental", "PercentNonRetail", "CharlesRiver", "NitricOxides", 472var featureContributionCalculation = context.Transforms.CalculateFeatureContribution(linearModel, normalize: false); 521mlContext.Transforms.Text.FeaturizeText("TextFeatures", "Message") 524.Append(mlContext.Transforms.Text.NormalizeText("NormalizedMessage", "Message")) 527.Append(mlContext.Transforms.Text.ProduceWordBags("BagOfWords", "NormalizedMessage")) 530.Append(mlContext.Transforms.Text.ProduceHashedWordBags("BagOfBigrams", "NormalizedMessage", 534.Append(mlContext.Transforms.Text.TokenizeIntoCharactersAsKeys("MessageChars", "Message")) 535.Append(mlContext.Transforms.Text.ProduceNgrams("BagOfTrichar", "MessageChars", 541.Append(mlContext.Transforms.Text.TokenizeIntoWords("TokenizedMessage", "NormalizedMessage")) 542.Append(mlContext.Transforms.Text.ApplyWordEmbedding("Embeddings", "TokenizedMessage", 595mlContext.Transforms.Categorical.OneHotEncoding("CategoricalOneHot", "CategoricalFeatures") 597.Append(mlContext.Transforms.Categorical.OneHotEncoding("CategoricalBag", "CategoricalFeatures", OneHotEncodingEstimator.OutputKind.Bag)) 599.Append(mlContext.Transforms.Categorical.OneHotEncoding("WorkclassOneHot", "Workclass")) 600.Append(mlContext.Transforms.FeatureSelection.SelectFeaturesBasedOnCount("WorkclassOneHotTrimmed", "WorkclassOneHot", count: 10)); 614.Append(mlContext.Transforms.Concatenate("Features", "NumericalFeatures", "CategoricalBag", "WorkclassOneHotTrimmed")) 644mlContext.Transforms.Concatenate("Features", "SepalLength", "SepalWidth", "PetalLength", "PetalWidth") 646.Append(mlContext.Transforms.Conversion.MapValueToKey("Label"), TransformerScope.TrainTest) 741var estimator = mlContext.Transforms.CustomMapping<InputRow, OutputRow>(CustomMappings.IncomeMapping, nameof(CustomMappings.IncomeMapping)) 770var estimator = mlContext.Transforms.CustomMapping(mapping, null); 779var estimator = mlContext.Transforms.CustomMapping(mapping, null)
Scenarios\Api\Estimators\MultithreadedPrediction.cs (1)
31var pipeline = ml.Transforms.Text.FeaturizeText("Features", "SentimentText")
Scenarios\Api\Estimators\PredictAndMetadata.cs (5)
31var pipeline = ml.Transforms.Concatenate("Features", "SepalLength", "SepalWidth", "PetalLength", "PetalWidth") 32.Append(ml.Transforms.Conversion.MapValueToKey("Label"), TransformerScope.TrainTest) 80var pipeline = mlContext.Transforms.Concatenate("Features", "SepalLength", "SepalWidth", "PetalLength", "PetalWidth") 81.Append(mlContext.Transforms.Conversion.MapValueToKey("Label")) 115var pipelineUnamed = mlContext.Transforms.Conversion.MapValueToKey("Label")
Scenarios\Api\Estimators\SimpleTrainAndPredict.cs (2)
29var pipeline = ml.Transforms.Text.FeaturizeText("Features", "SentimentText") 66var pipeline = ml.Transforms.Text.FeaturizeText("Features", "SentimentText")
Scenarios\Api\Estimators\TrainWithInitialPredictor.cs (1)
28var pipeline = ml.Transforms.Text.FeaturizeText("Features", "SentimentText");
Scenarios\Api\TestApi.cs (2)
180xf = mlContext.Transforms.Conversion.ConvertType("Label", outputKind: DataKind.Boolean).Fit(xf).Transform(xf); 481var inputWithKey = mlContext.Transforms.Conversion.MapValueToKey("KeyStrat", "TextStrat").Fit(input).Transform(input);
Scenarios\IrisPlantClassificationTests.cs (3)
32var pipe = mlContext.Transforms.Concatenate("Features", "SepalLength", "SepalWidth", "PetalLength", "PetalWidth") 33.Append(mlContext.Transforms.NormalizeMinMax("Features")) 34.Append(mlContext.Transforms.Conversion.MapValueToKey("Label"))
Scenarios\IrisPlantClassificationWithStringLabelTests.cs (4)
36var pipe = mlContext.Transforms.Concatenate("Features", "SepalLength", "SepalWidth", "PetalLength", "PetalWidth") 37.Append(mlContext.Transforms.NormalizeMinMax("Features")) 38.Append(mlContext.Transforms.Conversion.MapValueToKey("Label", "IrisPlantType"), TransformerScope.TrainTest) 42.Append(mlContext.Transforms.Conversion.MapKeyToValue("Plant", "PredictedLabel"));
Scenarios\OvaTest.cs (4)
32var data = mlContext.Data.Cache(mlContext.Transforms.Conversion.MapValueToKey("Label") 66var data = mlContext.Data.Cache(mlContext.Transforms.Conversion.MapValueToKey("Label") 102var data = mlContext.Data.Cache(mlContext.Transforms.Conversion.MapValueToKey("Label") 136var data = mlContext.Data.Cache(mlContext.Transforms.Conversion.MapValueToKey("Label")
Scenarios\RegressionTest.cs (8)
27var dataProcessPipeline = context.Transforms.CopyColumns(outputColumnName: "Label", inputColumnName: "FareAmount") 28.Append(context.Transforms.Categorical.OneHotEncoding(outputColumnName: "VendorIdEncoded", inputColumnName: "VendorId")) 29.Append(context.Transforms.Categorical.OneHotEncoding(outputColumnName: "RateCodeEncoded", inputColumnName: "RateCode")) 30.Append(context.Transforms.Categorical.OneHotEncoding(outputColumnName: "PaymentTypeEncoded", inputColumnName: "PaymentType")) 31.Append(context.Transforms.NormalizeMeanVariance(outputColumnName: "PassengerCount")) 32.Append(context.Transforms.NormalizeMeanVariance(outputColumnName: "TripTime")) 33.Append(context.Transforms.NormalizeMeanVariance(outputColumnName: "TripDistance")) 34.Append(context.Transforms.Concatenate("Features", "VendorIdEncoded", "RateCodeEncoded", "PaymentTypeEncoded", "PassengerCount",
Scenarios\WordBagTest.cs (4)
32mlContext.Transforms.Text.ProduceWordBags("Text", "Text", 34mlContext.Transforms.Text.ProduceWordBags("Text2", new[] { "Text2", "Text2" }, 69mlContext.Transforms.Text.ProduceHashedWordBags("Text", "Text", ngramLength: 3, useAllLengths: false).Append( 70mlContext.Transforms.Text.ProduceHashedWordBags("Text2", new[] { "Text2", "Text2" }, ngramLength: 3, useAllLengths: false));
ScenariosWithDirectInstantiation\IrisPlantClassificationTests.cs (3)
30var pipe = mlContext.Transforms.Concatenate("Features", "SepalLength", "SepalWidth", "PetalLength", "PetalWidth") 31.Append(mlContext.Transforms.NormalizeMinMax("Features")) 32.Append(mlContext.Transforms.Conversion.MapValueToKey("Label"))
TrainerEstimators\FAFMEstimator.cs (1)
25var pipeline = mlContext.Transforms.CopyColumns(DefaultColumnNames.Features, nameof(FfmExample.Field0))
TrainerEstimators\MetalinearEstimators.cs (1)
68.Append(ML.Transforms.Conversion.MapKeyToValue("PredictedLabelValue", "PredictedLabel"));
TrainerEstimators\OneDalEstimators.cs (1)
57var preprocessingPipeline = ML.Transforms.Concatenate("Features", new string[] { "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7" });
TrainerEstimators\OnlineLinearTests.cs (2)
25var regressionPipe = ML.Transforms.NormalizeMinMax("Features"); 39var binaryPipe = ML.Transforms.NormalizeMinMax("Features");
TrainerEstimators\SdcaTests.cs (6)
28var binaryData = ML.Transforms.Conversion.ConvertType("Label", outputKind: DataKind.Boolean) 43var mcData = ML.Transforms.Conversion.MapValueToKey("Label").Fit(data).Transform(data); 174var sdcaWithoutWeightMulticlass = mlContext.Transforms.Conversion.MapValueToKey("LabelIndex", "Label"). 178var sdcaWithWeightMulticlass = mlContext.Transforms.Conversion.MapValueToKey("LabelIndex", "Label"). 277var pipeline = mlContext.Transforms.Conversion.MapValueToKey("LabelIndex", "Label"). 311var pipeline = mlContext.Transforms.Conversion.MapValueToKey("LabelIndex", "Label").
TrainerEstimators\TrainerEstimators.cs (2)
218var oneHotPipeline = pipeline.Append(ML.Transforms.Categorical.OneHotEncoding("LoggedIn")); 219oneHotPipeline.Append(ML.Transforms.Concatenate("Features", "Features", "LoggedIn"));
TrainerEstimators\TreeEnsembleFeaturizerTest.cs (32)
265var treeFeaturizer = ML.Transforms.FeaturizeByPretrainTreeEnsemble(options).Fit(dataView); 330var pipeline = ML.Transforms.FeaturizeByPretrainTreeEnsemble(options) 331.Append(ML.Transforms.Concatenate("CombinedFeatures", "Features", "Trees", "Leaves", "Paths")) 376var pipeline = ML.Transforms.FeaturizeByFastTreeBinary(options) 377.Append(ML.Transforms.Concatenate("CombinedFeatures", "Features", "Trees", "Leaves", "Paths")) 415var pipeline = ML.Transforms.FeaturizeByFastForestBinary(options) 416.Append(ML.Transforms.Concatenate("CombinedFeatures", "Features", "Trees", "Leaves", "Paths")) 454var pipeline = ML.Transforms.FeaturizeByFastTreeRegression(options) 455.Append(ML.Transforms.Concatenate("CombinedFeatures", "Features", "Trees", "Leaves", "Paths")) 492var pipeline = ML.Transforms.FeaturizeByFastForestRegression(options) 493.Append(ML.Transforms.Concatenate("CombinedFeatures", "Features", "Trees", "Leaves", "Paths")) 530var pipeline = ML.Transforms.FeaturizeByFastTreeTweedie(options) 531.Append(ML.Transforms.Concatenate("CombinedFeatures", "Features", "Trees", "Leaves", "Paths")) 568var pipeline = ML.Transforms.FeaturizeByFastTreeRanking(options) 569.Append(ML.Transforms.Concatenate("CombinedFeatures", "Features", "Trees", "Leaves", "Paths")) 606var pipeline = ML.Transforms.FeaturizeByFastForestRegression(options) 607.Append(ML.Transforms.Concatenate("CombinedFeatures", "Features", "Trees", "Leaves", "Paths")) 662var pipeline = ML.Transforms.CopyColumns("CopiedFeatures", "Features") 663.Append(ML.Transforms.FeaturizeByFastForestRegression(options)) 664.Append(ML.Transforms.Concatenate("CombinedFeatures", "Features", "OhMyTrees", "OhMyLeaves", "OhMyPaths")) 693var secondPipeline = ML.Transforms.CopyColumns("CopiedFeatures", "Features") 694.Append(ML.Transforms.NormalizeBinning("CopiedFeatures")) 695.Append(ML.Transforms.FeaturizeByFastForestRegression(options)) 696.Append(ML.Transforms.Concatenate("CombinedFeatures", "Features", "OhMyTrees", "OhMyLeaves", "OhMyPaths")) 739var wrongPipeline = ML.Transforms.FeaturizeByFastTreeBinary(options) 740.Append(ML.Transforms.Concatenate("CombinedFeatures", "Features", "Trees", "Leaves", "Paths")) 750var pipeline = ML.Transforms.FeaturizeByFastTreeBinary(options) 751.Append(ML.Transforms.Concatenate("CombinedFeatures", "Features", "Leaves")) 803var pipeline = ML.Transforms.Conversion.MapValueToKey("KeyLabel", "Label") 804.Append(ML.Transforms.CustomMapping(actionConvertKeyToFloat, "KeyLabel")) 805.Append(ML.Transforms.FeaturizeByFastForestRegression(options)) 806.Append(ML.Transforms.Concatenate("CombinedFeatures", "Trees", "Leaves", "Paths"))
TrainerEstimators\TreeEstimators.cs (2)
745mlContext.Transforms.Conversion 782.Append(ML.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
Transformers\CategoricalHashTests.cs (12)
52var pipe = ML.Transforms.Categorical.OneHotHashEncoding(new[]{ 89var est = ML.Transforms.Text.TokenizeIntoWords("VarVectorString", "ScalarString") 90.Append(ML.Transforms.Categorical.OneHotHashEncoding("A", "ScalarString", outputKind: OneHotEncodingEstimator.OutputKind.Indicator)) 91.Append(ML.Transforms.Categorical.OneHotHashEncoding("B", "VectorString", outputKind: OneHotEncodingEstimator.OutputKind.Indicator)) 92.Append(ML.Transforms.Categorical.OneHotHashEncoding("C", "VectorString", outputKind: OneHotEncodingEstimator.OutputKind.Bag)) 93.Append(ML.Transforms.Categorical.OneHotHashEncoding("D", "ScalarString", outputKind: OneHotEncodingEstimator.OutputKind.Binary)) 94.Append(ML.Transforms.Categorical.OneHotHashEncoding("E", "VectorString", outputKind: OneHotEncodingEstimator.OutputKind.Binary)) 95.Append(ML.Transforms.Categorical.OneHotHashEncoding("F", "VarVectorString", outputKind: OneHotEncodingEstimator.OutputKind.Bag)) 97.Append(ML.Transforms.Categorical.OneHotHashEncoding("G", "SingleVectorString", outputKind: OneHotEncodingEstimator.OutputKind.Bag)); 103var view = ML.Transforms.SelectColumns("A", "B", "C", "D", "E", "F").Fit(savedData).Transform(savedData); 120var bagPipe = ML.Transforms.Categorical.OneHotHashEncoding( 225var pipe = ML.Transforms.Categorical.OneHotHashEncoding(new[]{
Transformers\CategoricalTests.cs (17)
71var pipe = ML.Transforms.Categorical.OneHotEncoding(new[]{ 109var pipe = mlContext.Transforms.Conversion.ConvertType("A", outputKind: DataKind.Single) 110.Append(mlContext.Transforms.Conversion.ConvertType("B", outputKind: DataKind.Single)) 111.Append(mlContext.Transforms.Concatenate("Features", new string[] { "A", "B" })) 112.Append(mlContext.Transforms.Conversion.MapValueToKey("Label")) 113.Append(mlContext.Transforms.NormalizeSupervisedBinning("Features", fixZero: false, maximumBinCount: 5, labelColumnName: "Label")) 114.Append(mlContext.Transforms.Categorical.OneHotEncoding("Features", outputKind: OneHotEncodingEstimator.OutputKind.Indicator)); 138var pipe = mlContext.Transforms.Categorical.OneHotEncoding(new[] { ci }, sideData); 164var est = ML.Transforms.Text.TokenizeIntoWords("VarVectorString", "ScalarString") 165.Append(ML.Transforms.Categorical.OneHotEncoding("A", "ScalarString", outputKind: OneHotEncodingEstimator.OutputKind.Indicator)) 166.Append(ML.Transforms.Categorical.OneHotEncoding("B", "VectorString", outputKind: OneHotEncodingEstimator.OutputKind.Indicator)) 167.Append(ML.Transforms.Categorical.OneHotEncoding("C", "VectorString", outputKind: OneHotEncodingEstimator.OutputKind.Bag)) 168.Append(ML.Transforms.Categorical.OneHotEncoding("D", "ScalarString", outputKind: OneHotEncodingEstimator.OutputKind.Binary)) 169.Append(ML.Transforms.Categorical.OneHotEncoding("E", "VectorString", outputKind: OneHotEncodingEstimator.OutputKind.Binary)); 175var view = ML.Transforms.SelectColumns("A", "B", "C", "D", "E").Fit(savedData).Transform(savedData); 193var pipe = ML.Transforms.Categorical.OneHotEncoding(new[] { 319var pipe = ML.Transforms.Categorical.OneHotEncoding(new[]{
Transformers\ConcatTests.cs (7)
28var pipe = ML.Transforms.Concatenate("Features"); 65var pipe = ML.Transforms.Concatenate("f1", "float1") 66.Append(ML.Transforms.Concatenate("f2", "float1", "float1")) 67.Append(ML.Transforms.Concatenate("f3", "float4", "float1")) 68.Append(ML.Transforms.Concatenate("f4", "float6", "vfloat", "float1")); 83data = ML.Transforms.SelectColumns("f1", "f2", "f3", "f4").Fit(data).Transform(data); 147data = ML.Transforms.SelectColumns("f2", "f3").Fit(data).Transform(data);
Transformers\ConvertTests.cs (8)
130var pipe = ML.Transforms.Conversion.ConvertType(columns: new[] {new TypeConvertingEstimator.ColumnOptions("ConvA", DataKind.Single, "A"), 169var allTypesPipe = ML.Transforms.Conversion.ConvertType(columns: new[] { 254var allInputTypesDataPipe = ML.Transforms.Conversion.ConvertType(columns: new[] {new TypeConvertingEstimator.ColumnOptions("A1", DataKind.String, "A"), 292var pipe = mlContext.Transforms.Conversion.MapValueToKey(new[] { ci }, sideData); 320var pipe = ML.Transforms.Conversion.ConvertType(columns: new[] {new TypeConvertingEstimator.ColumnOptions("ConvA", typeof(double), "A"), 338var pipe = ML.Transforms.Categorical.OneHotEncoding(new[] { 341}).Append(ML.Transforms.Conversion.ConvertType(new[] { 400var modelNew = ML.Transforms.Conversion.ConvertType(new[] { new TypeConvertingEstimator.ColumnOptions("convertedKey",
Transformers\CountTargetEncodingTests.cs (15)
32var estimator = ML.Transforms.CountTargetEncode(new[] { 44var estimator = ML.Transforms.CountTargetEncode("Text", builder: CountTableBuilderBase.CreateCMCountTableBuilder(2, 1 << 6)); 47estimator = ML.Transforms.CountTargetEncode("Text", transformer); 63var estimator = ML.Transforms.CountTargetEncode(new[] { 67estimator = ML.Transforms.CountTargetEncode(new[] { new InputOutputColumnPair("ScalarString"), new InputOutputColumnPair("VectorString") }, transformer); 84var estimator = ML.Transforms.CountTargetEncode(new[] { 86.Append(ML.Transforms.Concatenate("Features", "ScalarString", "VectorString")) 92estimator = ML.Transforms.CountTargetEncode(new[] { 94.Append(ML.Transforms.Concatenate("Features", "ScalarString", "VectorString")) 101estimator = ML.Transforms.CountTargetEncode(new[] { 103.Append(ML.Transforms.Concatenate("Features", "ScalarString", "VectorString")) 115var select = ML.Transforms.SelectColumns("Features").Fit(transformed); 168var estimator = ML.Transforms.CountTargetEncode("VectorString1", "VectorString", builder: CountTableBuilderBase.CreateCMCountTableBuilder(3, 1 << 10), 170ML.Transforms.CountTargetEncode(new[] { new InputOutputColumnPair("ScalarString1", "ScalarString"), new InputOutputColumnPair("VectorString2", "VectorString") }, 172ML.Transforms.CountTargetEncode("ScalarString2", "ScalarString", builder: CountTableBuilderBase.CreateDictionaryCountTableBuilder(1)));
Transformers\CustomMappingTests.cs (4)
101var est = ML.Transforms.CustomMapping(mapping, null); 106var badData1 = ML.Transforms.CopyColumns("Text1", "Float1").Fit(data).Transform(data); 114var badData2 = ML.Transforms.SelectColumns(new[] { "Float1" }).Fit(data).Transform(data); 180var customEst = tempoEnv.Transforms.StatefulCustomMapping<MyStatefulInput, MyStatefulOutput, MyState>(MyStatefulLambda.MyStatefulAction, MyStatefulLambda.MyStateInit, nameof(MyStatefulLambda));
Transformers\ExpressionTransformerTests.cs (6)
40var expr = ML.Transforms.Expression("Expr1", "x=>x/2", "Double"). 41Append(ML.Transforms.Expression("Expr2", "(x,y)=>(x+y)/3", "Float", "FloatVector")). 42Append(ML.Transforms.Expression("Expr3", "(x,y)=>x*y", "Float", "Int")). 43Append(ML.Transforms.Expression("Expr4", "(x,y,z)=>abs(x-y)*z", "Float", "FloatVector", "Double")). 44Append(ML.Transforms.Expression("Expr5", "x=>len(concat(upper(x),lower(x)))", "Text")). 45Append(ML.Transforms.Expression("Expr6", "(x,y)=>right(x,y)", "TextVector", "Int"));
Transformers\FeatureSelectionTests.cs (15)
43.Append(ML.Transforms.FeatureSelection.SelectFeaturesBasedOnCount("bag_of_words_count", "bag_of_words", 10) 44.Append(ML.Transforms.FeatureSelection.SelectFeaturesBasedOnMutualInformation("bag_of_words_mi", "bag_of_words", labelColumnName: "label"))); 51savedData = ML.Transforms.SelectColumns("bag_of_words_count", "bag_of_words_mi").Fit(savedData).Transform(savedData); 120var est = ML.Transforms.FeatureSelection.SelectFeaturesBasedOnCount("FeatureSelect", "VectorFloat", count: 1) 121.Append(ML.Transforms.FeatureSelection.SelectFeaturesBasedOnCount(columns)); 153var pipe = ML.Transforms.FeatureSelection.SelectFeaturesBasedOnCount("FeatureSelect", "VectorFloat", count: 1); 177var est = ML.Transforms.FeatureSelection.SelectFeaturesBasedOnMutualInformation("FeatureSelect", "VectorFloat", slotsInOutput: 1, labelColumnName: "Label") 178.Append(ML.Transforms.FeatureSelection.SelectFeaturesBasedOnMutualInformation(labelColumnName: "Label", slotsInOutput: 2, numberOfBins: 100, 213var pipe = ML.Transforms.FeatureSelection.SelectFeaturesBasedOnMutualInformation("FeatureSelect", "VectorFloat", slotsInOutput: 1, labelColumnName: "Label"); 238var pipeline = ML.Transforms.Text.TokenizeIntoWords("Features") 239.Append(ML.Transforms.FeatureSelection.SelectFeaturesBasedOnCount("Features")); 246var pipeline = ML.Transforms.Text.TokenizeIntoWords("Features") 247.Append(ML.Transforms.FeatureSelection.SelectFeaturesBasedOnMutualInformation("Features", labelColumnName: "BadLabel")); 254var pipeline = ML.Transforms.Text.TokenizeIntoWords("Features") 255.Append(ML.Transforms.FeatureSelection.SelectFeaturesBasedOnMutualInformation("Features"));
Transformers\HashTests.cs (5)
51var pipe = ML.Transforms.Conversion.Hash(new[]{ 73var pipe = ML.Transforms.Conversion.Hash(new[] { 113var pipe = ML.Transforms.Conversion.Hash(new[]{ 383var pipeline = ML.Transforms.Concatenate("D", "A") 384.Append(ML.Transforms.Conversion.Hash(
Transformers\KeyToBinaryVectorEstimatorTest.cs (5)
54var pipe = ML.Transforms.Conversion.MapKeyToBinaryVector(new[] { new InputOutputColumnPair("CatA", "TermA"), new InputOutputColumnPair("CatC", "TermC") }); 74var est = ML.Transforms.Conversion.MapKeyToBinaryVector("ScalarString", "A") 75.Append(ML.Transforms.Conversion.MapKeyToBinaryVector("VectorString", "B")); 100var pipe = ML.Transforms.Conversion.MapKeyToBinaryVector(new[] { 155var pipe = ML.Transforms.Conversion.MapKeyToBinaryVector(new[] { new InputOutputColumnPair("CatA", "TermA"), new InputOutputColumnPair("CatB", "TermB"), new InputOutputColumnPair("CatC", "TermC") });
Transformers\KeyToValueTests.cs (4)
78var est = ML.Transforms.Conversion.MapKeyToValue("ScalarString", "A") 79.Append(ML.Transforms.Conversion.MapKeyToValue("VectorString", "B")); 85var dataLeft = ML.Transforms.SelectColumns(new[] { "ScalarString", "VectorString" }).Fit(data).Transform(data); 86var dataRight = ML.Transforms.SelectColumns(new[] { "ScalarString", "VectorString" }).Fit(data2Transformed).Transform(data2Transformed);
Transformers\KeyToVectorEstimatorTests.cs (8)
61var pipe = ML.Transforms.Conversion.MapKeyToVector(new KeyToVectorMappingEstimator.ColumnOptions("CatA", "TermA", false), 83var est = ML.Transforms.Conversion.MapKeyToVector("ScalarString", "A") 84.Append(ML.Transforms.Conversion.MapKeyToVector("VectorString", "B")) 85.Append(ML.Transforms.Conversion.MapKeyToVector("VectorBaggedString", "B", true)); 114var pipe = ML.Transforms.Conversion.MapKeyToVector( 214var pipe = ML.Transforms.Conversion.MapKeyToVector( 256var pipeline = mlContext.Transforms.Conversion.MapValueToKey("Label") 257.Append(mlContext.Transforms.Categorical.OneHotHashEncoding("ProblematicColumn"));
Transformers\NAIndicatorTests.cs (5)
47var pipe = ML.Transforms.IndicateMissingValues(new[] { 75var pipe = ML.Transforms.IndicateMissingValues(new[] { 104var est = ML.Transforms.IndicateMissingValues(new[] 138var pipe = ML.Transforms.Categorical.OneHotEncoding("CatA", "A"); 139var newpipe = pipe.Append(ML.Transforms.IndicateMissingValues("NAA", "CatA"));
Transformers\NAReplaceTests.cs (9)
67var pipe = ML.Transforms.ReplaceMissingValues( 112var pipe = ML.Transforms.ReplaceMissingValues( 135var est = ML.Transforms.ReplaceMissingValues("A", "ScalarFloat", replacementMode: MissingValueReplacingEstimator.ReplacementMode.Maximum) 136.Append(ML.Transforms.ReplaceMissingValues("B", "ScalarDouble", replacementMode: MissingValueReplacingEstimator.ReplacementMode.Mean)) 137.Append(ML.Transforms.ReplaceMissingValues("C", "VectorFloat", replacementMode: MissingValueReplacingEstimator.ReplacementMode.Mean)) 138.Append(ML.Transforms.ReplaceMissingValues("D", "VectorDouble", replacementMode: MissingValueReplacingEstimator.ReplacementMode.Minimum)) 139.Append(ML.Transforms.ReplaceMissingValues("E", "VectorDouble", replacementMode: MissingValueReplacingEstimator.ReplacementMode.Mode)); 144var view = ML.Transforms.SelectColumns("A", "B", "C", "D", "E").Fit(savedData).Transform(savedData); 170var pipe = ML.Transforms.ReplaceMissingValues(
Transformers\NormalizerTests.cs (43)
91var dataView = ML.Transforms.DropColumns(new[] { "float0" }).Fit(transformedData).Transform(transformedData); 238var est = context.Transforms.NormalizeMinMax( 241.Append(context.Transforms.NormalizeBinning( 244.Append(context.Transforms.NormalizeMeanVariance( 247.Append(context.Transforms.NormalizeLogMeanVariance( 250.Append(context.Transforms.NormalizeSupervisedBinning( 391var robustScalerEstimator = context.Transforms.NormalizeRobustScaling( 430robustScalerEstimator = context.Transforms.NormalizeRobustScaling( 484var est4 = ML.Transforms.NormalizeMinMax("float4", "float4"); 485var est5 = ML.Transforms.NormalizeMinMax("float4"); 505var est8 = ML.Transforms.NormalizeMeanVariance("float4", "float4"); 518var est11 = ML.Transforms.NormalizeLogMeanVariance("float4", "float4"); 531var est14 = ML.Transforms.NormalizeBinning("float4", "float4"); 544var est17 = ML.Transforms.NormalizeSupervisedBinning("float4", "float4"); 557var est20 = ML.Transforms.NormalizeRobustScaling("float4", "float4"); 586var est1 = ML.Transforms.NormalizeMinMax("float4", "float4"); 587var est2 = ML.Transforms.NormalizeMeanVariance("float4", "float4"); 588var est3 = ML.Transforms.NormalizeLogMeanVariance("float4", "float4"); 589var est4 = ML.Transforms.NormalizeBinning("float4", "float4"); 590var est5 = ML.Transforms.NormalizeSupervisedBinning("float4", "float4"); 593var est6 = ML.Transforms.NormalizeMinMax("float4", "float4"); 594var est7 = ML.Transforms.NormalizeMeanVariance("float4", "float4"); 595var est8 = ML.Transforms.NormalizeLogMeanVariance("float4", "float4"); 596var est9 = ML.Transforms.NormalizeBinning("float4", "float4"); 597var est10 = ML.Transforms.NormalizeSupervisedBinning("float4", "float4"); 642var est = ML.Transforms.NormalizeMinMax("output", "input"); 666var est = ML.Transforms.NormalizeLpNorm("lpnorm", "features") 667.Append(ML.Transforms.NormalizeGlobalContrast("gcnorm", "features")) 676savedData = ML.Transforms.SelectColumns("lpnorm", "gcnorm", "whitened").Fit(savedData).Transform(savedData); 710savedData = ML.Transforms.SelectColumns("whitened1", "whitened2").Fit(savedData).Transform(savedData); 764var est = ML.Transforms.NormalizeLpNorm("lpNorm1", "features") 765.Append(ML.Transforms.NormalizeLpNorm("lpNorm2", "features", norm: LpNormNormalizingEstimatorBase.NormFunction.L1, ensureZeroMean: true)); 773savedData = ML.Transforms.SelectColumns("lpNorm1", "lpNorm2").Fit(savedData).Transform(savedData); 798var pipe = ML.Transforms.NormalizeLpNorm("whitened", "features"); 824var est = ML.Transforms.NormalizeGlobalContrast("gcnNorm1", "features") 825.Append(ML.Transforms.NormalizeGlobalContrast("gcnNorm2", "features", ensureZeroMean: false, ensureUnitStandardDeviation: true, scale: 3)); 833savedData = ML.Transforms.SelectColumns("gcnNorm1", "gcnNorm2").Fit(savedData).Transform(savedData); 858var pipe = ML.Transforms.NormalizeGlobalContrast("whitened", "features"); 908var normalize = ML.Transforms.NormalizeLogMeanVariance("Features", true, useCdf: true); 911var normalizeNoCdf = ML.Transforms.NormalizeLogMeanVariance("Features", true, useCdf: false); 949var normalize = ML.Transforms.NormalizeLogMeanVariance("Features", true, useCdf: true); 952var normalizeNoCdf = ML.Transforms.NormalizeLogMeanVariance("Features", true, useCdf: false); 1055var model = ML.Transforms.NormalizeMinMax("output", "input").Fit(data);
Transformers\PcaTests.cs (4)
41var est = ML.Transforms.ProjectToPrincipalComponents("pca", "features", rank: 4, seed: 10); 44var estNonDefaultArgs = ML.Transforms.ProjectToPrincipalComponents("pca", "features", rank: 3, exampleWeightColumnName: "weight", overSampling: 2, ensureZeroMean: false); 58var est = ML.Transforms.ProjectToPrincipalComponents("pca", "features", rank: 5, seed: 1); 61savedData = ML.Transforms.SelectColumns("pca").Fit(savedData).Transform(savedData);
Transformers\RffTests.cs (3)
54var pipe = ML.Transforms.ApproximatedKernelMap(new[]{ 72var est = ML.Transforms.ApproximatedKernelMap("RffVectorFloat", "VectorFloat", 3, true); 100var est = ML.Transforms.ApproximatedKernelMap(new[]{
Transformers\SelectColumnsTests.cs (4)
111var est = ML.Transforms.SelectColumns(new[] { "A", "B" }); 115est = ML.Transforms.SelectColumns(new[] { "A", "B" }, true); 157var chain = est.Append(ML.Transforms.SelectColumns(new[] { "B", "A" }, true)); 199ML.Transforms.SelectColumns(new[] { "A", "B" }, false));
Transformers\TextFeaturizerTests.cs (25)
52var pipeline = ML.Transforms.Text.FeaturizeText("Features", options, "A"); 76var pipeline = ML.Transforms.Text.FeaturizeText("Features", options, "A"); 106var pipeline = ML.Transforms.Text.FeaturizeText("Features", options, null); 148var pipeline = ML.Transforms.Text.FeaturizeText("Features", options); 189var pipeline = ML.Transforms.Text.FeaturizeText("Features", options, "A"); 217var pipeline = ML.Transforms.Text.FeaturizeText("Features", options, "A"); 251var pipeline = ML.Transforms.Text.FeaturizeText("Features", options, "A"); 268var pipeline = ML.Transforms.Text.FeaturizeText("Features", options, "A"); 317var pipeline = ML.Transforms.Text.FeaturizeText("Features", options, "A"); 354var pipeline = ML.Transforms.Text.FeaturizeText("Features", options, "A"); 392var pipeline = ML.Transforms.Text.FeaturizeText("Features", options, "A"); 436var feat = ML.Transforms.Text.FeaturizeText("Data", new TextFeaturizingEstimator.Options { OutputTokensColumnName = "OutputTokens" }, new[] { "text" }); 445savedData = ML.Transforms.SelectColumns("Data", "OutputTokens").Fit(savedData).Transform(savedData); 476savedData = ML.Transforms.SelectColumns("text", "words", "chars").Fit(savedData).Transform(savedData); 496var savedData = ML.Transforms.SelectColumns("words").Fit(outdata).Transform(outdata); 536var est = ML.Transforms.Text.NormalizeText("text") 537.Append(ML.Transforms.Text.TokenizeIntoWords("words", "text")) 538.Append(ML.Transforms.Text.RemoveDefaultStopWords("NoDefaultStopwords", "words")) 539.Append(ML.Transforms.Text.RemoveStopWords("NoStopWords", "words", "xbox", "this", "is", "a", "the", "THAT", "bY")); 545savedData = ML.Transforms.SelectColumns("text", "NoDefaultStopwords", "NoStopWords").Fit(savedData).Transform(savedData); 606savedData = ML.Transforms.SelectColumns("text", "bag_of_words", "bag_of_wordshash").Fit(savedData).Transform(savedData); 641savedData = ML.Transforms.SelectColumns("text", "terms", "ngrams", "ngramshash").Fit(savedData).Transform(savedData); 700savedData = ML.Transforms.SelectColumns("topics").Fit(savedData).Transform(savedData); 737var est = ml.Transforms.Text.LatentDirichletAllocation("F1V", resetRandomGenerator: true); 782var pipeline = ML.Transforms.Text.ProduceWordBags("Features")
Transformers\ValueMappingTests.cs (14)
146Append(ML.Transforms.Conversion.MapValue(keyValuePairs, true, new[] { new InputOutputColumnPair("VecD", "TokenizeA"), new InputOutputColumnPair("E", "B"), new InputOutputColumnPair("F", "C") })); 370var est = ML.Transforms.Conversion.MapValue(keyValuePairs, 402var estimator = ML.Transforms.Conversion.MapValue(keyValuePairs, true, 437var estimator = ML.Transforms.Conversion.MapValue(keyValuePairs, true, new[] { new InputOutputColumnPair("D", "A"), new InputOutputColumnPair("E", "B"), new InputOutputColumnPair("F", "C") }); 478var estimator = ML.Transforms.Conversion.MapValue(keyValuePairs, true, new[] { new InputOutputColumnPair("D", "A"), new InputOutputColumnPair("E", "B"), new InputOutputColumnPair("F", "C") }); 519var estimator = ML.Transforms.Conversion.MapValue(keyValuePairs, true, new[] { new InputOutputColumnPair("D", "A"), new InputOutputColumnPair("E", "B"), new InputOutputColumnPair("F", "C") }); 558var estimator = ML.Transforms.Conversion.MapValue("D", keyValuePairs, "A", true). 559Append(ML.Transforms.Conversion.MapKeyToValue("DOutput", "D")); 601var est = ML.Transforms.Conversion.MapValue(keyValuePairs, new[] { new InputOutputColumnPair("D", "A"), new InputOutputColumnPair("E", "B"), new InputOutputColumnPair("F", "C") }); 620var est = ML.Transforms.Conversion.MapValue(keyValuePairs, new[] { new InputOutputColumnPair("D", "A"), new InputOutputColumnPair("E", "B"), new InputOutputColumnPair("F", "C") }); 640var est = ML.Transforms.Text.TokenizeIntoWords("TokenizeB", "B") 641.Append(ML.Transforms.Conversion.MapValue("VecB", keyValuePairs, "TokenizeB")); 692var est = ML.Transforms.Conversion.MapValue(keyValuePairs, 778var pipeline = ML.Transforms.Conversion.MapValue("PriceCategory", lookupIdvMap, lookupIdvMap.Schema["Value"], lookupIdvMap.Schema["Category"], "Price");
Transformers\WordBagTransformerTests.cs (4)
40mlContext.Transforms.Text.ProduceWordBags("Text", termSeparator: ';', freqSeparator: ':'); 69mlContext.Transforms.Text.ProduceWordBags("Text", termSeparator: ':', freqSeparator: ';'); 107var textPipelineDefault = mlContext.Transforms.Text.ProduceWordBags("Text", termSeparator: ';', freqSeparator: ':'); 108var textPipelineNonDefault = mlContext.Transforms.Text.ProduceWordBags("Text", termSeparator: ':', freqSeparator: ';');
Transformers\WordEmbeddingsTests.cs (10)
41var est = ML.Transforms.Text.NormalizeText("NormalizedText", "SentimentText", keepDiacritics: false, keepPunctuations: false) 42.Append(ML.Transforms.Text.TokenizeIntoWords("Words", "NormalizedText")) 43.Append(ML.Transforms.Text.RemoveDefaultStopWords("CleanWords", "Words")); 46var pipe = ML.Transforms.Text.ApplyWordEmbedding("WordEmbeddings", "CleanWords", modelKind: WordEmbeddingEstimator.PretrainedModelKind.SentimentSpecificWordEmbedding); 52savedData = ML.Transforms.SelectColumns("WordEmbeddings").Fit(savedData).Transform(savedData); 76var est = ML.Transforms.Text.NormalizeText("NormalizedText", "SentimentText", keepDiacritics: false, keepPunctuations: false) 77.Append(ML.Transforms.Text.TokenizeIntoWords("Words", "NormalizedText")) 78.Append(ML.Transforms.Text.RemoveDefaultStopWords("CleanWords", "Words")); 89var pipe = ML.Transforms.Text.ApplyWordEmbedding("WordEmbeddings", pathToCustomModel, "CleanWords"); 95savedData = ML.Transforms.SelectColumns("WordEmbeddings", "CleanWords").Fit(savedData).Transform(savedData);
Microsoft.ML.TimeSeries.Tests (11)
TimeSeriesDirectApi.cs (7)
227var pipeline = ml.Transforms.Text.FeaturizeText("Text_Featurized", "Text") 303var pipeline = ml.Transforms.Text.FeaturizeText("Text_Featurized", "Text") 304.Append(ml.Transforms.Conversion.ConvertType("Value", "Value", DataKind.Single)) 449var model = ml.Transforms.Text.FeaturizeText("Text_Featurized", "Text") 450.Append(ml.Transforms.Conversion.ConvertType("Value", "Value", DataKind.Single)) 454.Append(ml.Transforms.Concatenate("Forecast", "Forecast", "ConfidenceLowerBound", "ConfidenceUpperBound")) 566var transformedData = ml.Transforms.DetectAnomalyBySrCnn(outputColumnName, inputColumnName, 16, 5, 5, 3, 8, 0.35).Fit(dataView).Transform(dataView);
TimeSeriesSimpleApiTests.cs (4)
52var learningPipeline = ML.Transforms.DetectIidChangePoint("Data", "Value", 80.0d, size); 96var learningPipeline = ML.Transforms.DetectChangePointBySsa("Data", "Value", 95.0d, changeHistorySize, maxTrainingSize, seasonalitySize); 137var learningPipeline = ML.Transforms.DetectIidSpike("Data", "Value", 80.0d, pvalHistoryLength); 189var learningPipeline = ML.Transforms.DetectSpikeBySsa("Data", "Value", 80.0d, changeHistoryLength, trainingWindowSize, seasonalityWindowSize);
Microsoft.ML.TorchSharp.Tests (26)
NerTests.cs (6)
70var estimator = chain.Append(ML.Transforms.Conversion.MapValueToKey("Label", keyData: labels)) 72.Append(ML.Transforms.Conversion.MapKeyToValue("outputColumn")); 149var estimator = chain.Append(ML.Transforms.Conversion.MapValueToKey("Label", keyData: labels)) 151.Append(ML.Transforms.Conversion.MapKeyToValue("outputColumn")); 223var estimator = chain.Append(ML.Transforms.Conversion.MapValueToKey("Label", keyData: labels)) 225.Append(ML.Transforms.Conversion.MapKeyToValue("outputColumn"));
ObjectDetectionTests.cs (12)
46var filteredPipeline = chain.Append(ML.Transforms.Text.TokenizeIntoWords("Labels", separators: new char[] { ',' }), TransformerScope.Training) 47.Append(ML.Transforms.Conversion.MapValueToKey("Labels"), TransformerScope.Training) 48.Append(ML.Transforms.Text.TokenizeIntoWords("Box", separators: new char[] { ',' }), TransformerScope.Training) 49.Append(ML.Transforms.Conversion.ConvertType("Box"), TransformerScope.Training) 50.Append(ML.Transforms.LoadImages("Image", imageFolder, "ImagePath")) 52.Append(ML.Transforms.Conversion.MapKeyToValue("PredictedLabel")); 63var pipeline = ML.Transforms.Text.TokenizeIntoWords("Labels", separators: new char[] { ',' }) 64.Append(ML.Transforms.Conversion.MapValueToKey("Labels")) 65.Append(ML.Transforms.Text.TokenizeIntoWords("Box", separators: new char[] { ',' })) 66.Append(ML.Transforms.Conversion.ConvertType("Box")) 67.Append(ML.Transforms.LoadImages("Image", imageFolder, "ImagePath")) 69.Append(ML.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
TextClassificationTests.cs (8)
98var estimator = chain.Append(ML.Transforms.Conversion.MapValueToKey("Label", "Sentiment"), TransformerScope.TrainTest) 100.Append(ML.Transforms.Conversion.MapKeyToValue("outputColumn")); 177mlContext.Transforms.Conversion.MapValueToKey("Label") 179.Append(mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel")); 235var estimator = ML.Transforms.Conversion.MapValueToKey("Label", "Sentiment") 237.Append(ML.Transforms.Conversion.MapKeyToValue("outputColumn")); 316var dataPrep = ML.Transforms.Conversion.MapValueToKey("Label"); 321.Append(ML.Transforms.Conversion.MapKeyToValue("outputColumn"));