368 references to Append
Microsoft.ML.AutoML (2)
SweepableEstimator\SweepableEstimatorPipeline.cs (1)
83
pipeline = pipeline.
Append
(_estimators[i].BuildFromOption(context, parameter[ssName]));
SweepableEstimator\SweepablePipeline.cs (1)
101
pipeline = pipeline.
Append
(kv.estimator.BuildFromOption(context, kv.param));
Microsoft.ML.Data (5)
DataLoadSave\CompositeLoaderEstimator.cs (1)
54
return new CompositeLoaderEstimator<TSource, TNewTrans>(_start, _estimatorChain.
Append
(estimator));
DataLoadSave\EstimatorExtensions.cs (4)
55
return est.
Append
(estimator, scope);
57
return new EstimatorChain<ITransformer>().
Append
(start).
Append
(estimator, scope);
71
return new EstimatorChain<ITransformer>().
Append
(start).AppendCacheCheckpoint(env);
Microsoft.ML.DnnImageFeaturizer.AlexNet (5)
AlexNetExtension.cs (5)
48
modelChain = modelChain.
Append
(inputRename);
49
var modelChain2 = modelChain.
Append
(prepEstimator);
50
modelChain = modelChain2.
Append
(midRename);
51
modelChain2 = modelChain.
Append
(mainEstimator);
52
modelChain = modelChain2.
Append
(endRename);
Microsoft.ML.DnnImageFeaturizer.ResNet101 (5)
ResNet101Extension.cs (5)
48
modelChain = modelChain.
Append
(inputRename);
49
var modelChain2 = modelChain.
Append
(prepEstimator);
50
modelChain = modelChain2.
Append
(midRename);
51
modelChain2 = modelChain.
Append
(mainEstimator);
52
modelChain = modelChain2.
Append
(endRename);
Microsoft.ML.DnnImageFeaturizer.ResNet18 (5)
ResNet18Extension.cs (5)
48
modelChain = modelChain.
Append
(inputRename);
49
var modelChain2 = modelChain.
Append
(prepEstimator);
50
modelChain = modelChain2.
Append
(midRename);
51
modelChain2 = modelChain.
Append
(mainEstimator);
52
modelChain = modelChain2.
Append
(endRename);
Microsoft.ML.DnnImageFeaturizer.ResNet50 (5)
ResNet50Extension.cs (5)
48
modelChain = modelChain.
Append
(inputRename);
49
var modelChain2 = modelChain.
Append
(prepEstimator);
50
modelChain = modelChain2.
Append
(midRename);
51
modelChain2 = modelChain.
Append
(mainEstimator);
52
modelChain = modelChain2.
Append
(endRename);
Microsoft.ML.IntegrationTests (24)
DataTransformation.cs (1)
145
.
Append
(mlContext.BinaryClassification.Trainers.SdcaLogisticRegression(
Debugging.cs (2)
109
.
Append
(mlContext.Regression.Trainers.Sdca(
176
.
Append
(mlContext.Regression.Trainers.Sdca(
Evaluation.cs (5)
67
.
Append
(mlContext.BinaryClassification.Trainers.SdcaNonCalibrated(
96
.
Append
(mlContext.BinaryClassification.Trainers.LbfgsLogisticRegression(
125
.
Append
(mlContext.Clustering.Trainers.KMeans(new KMeansTrainer.Options { NumberOfThreads = 1 }));
154
.
Append
(mlContext.MulticlassClassification.Trainers.SdcaMaximumEntropy(
302
.
Append
(mlContext.BinaryClassification.Trainers.LbfgsLogisticRegression(
IntrospectiveTraining.cs (4)
83
.
Append
(mlContext.BinaryClassification.Trainers.FastTree(
227
.
Append
(mlContext.BinaryClassification.Trainers.SdcaNonCalibrated(
339
.
Append
(mlContext.Transforms.Categorical.OneHotHashEncoding("CategoricalFeatures", numberOfBits: 8, // get collisions!
396
.
Append
(StepTwo(mlContext));
ONNX.cs (3)
43
.
Append
(mlContext.Regression.Trainers.FastTree(
93
.
Append
(mlContext.Clustering.Trainers.KMeans(
145
.
Append
(mlContext.Regression.Trainers.Sdca(
Prediction.cs (1)
52
.
Append
(mlContext.BinaryClassification.Trainers.LbfgsLogisticRegression(
SchemaDefinitionTests.cs (2)
68
.
Append
(_ml.Transforms.Concatenate("Features", "NumericFeatures", "Categories", "Workclass"))
69
.
Append
(_ml.Transforms.FeatureSelection.SelectFeaturesBasedOnMutualInformation("Features"));
Training.cs (5)
457
.
Append
(mlContext.Transforms.Conversion.MapValueToKey("Label"))
458
.
Append
(mlContext.MulticlassClassification.Trainers.OneVersusAll(binaryClassificationTrainer));
488
.
Append
(mlContext.Transforms.Conversion.MapValueToKey("Label"))
489
.
Append
(mlContext.MulticlassClassification.Trainers.OneVersusAll(binaryClassificationTrainer))
490
.
Append
(mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
Validation.cs (1)
86
var trainingPipeline = dataProcessPipeline.
Append
(trainer);
Microsoft.ML.OnnxTransformerTest (14)
DnnImageFeaturizerTest.cs (8)
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"));
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"))
233
var trainingPipeline = dataProcessPipeline.
Append
(trainer);
OnnxTransformTests.cs (6)
256
.
Append
(ML.Transforms.ExtractPixels("data_0", interleavePixelColors: true))
257
.
Append
(ML.Transforms.ApplyOnnxModel("softmaxout_1", "data_0", fileStream, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu));
307
.
Append
(ML.Transforms.ExtractPixels("data_0", interleavePixelColors: true))
308
.
Append
(ML.Transforms.ApplyOnnxModel("softmaxout_1", "data_0", modelFile, gpuDeviceId: _gpuDeviceId, fallbackToCpu: _fallbackToCpu));
1136
.
Append
(ML.Transforms.ExtractPixels("data_0", interleavePixelColors: true))
1137
.
Append
(ML.Transforms.ApplyOnnxModel(new[] { "softmaxout_1" }, new[] { "data_0" }, modelFile,
Microsoft.ML.PerformanceTests (10)
KMeansAndLogisticRegressionBench.cs (4)
38
.
Append
(ml.Transforms.Concatenate("Features", "NumFeatures", "CatFeatures"))
39
.
Append
(ml.Clustering.Trainers.KMeans("Features"))
40
.
Append
(ml.Transforms.Concatenate("Features", "Features", "Score"))
41
.
Append
(ml.BinaryClassification.Trainers.LbfgsLogisticRegression(
PredictionEngineBench.cs (1)
59
.
Append
(env.MulticlassClassification.Trainers.SdcaMaximumEntropy(
RffTransform.cs (3)
47
.
Append
(mlContext.Transforms.Concatenate("Features", "FeaturesRFF"))
48
.
Append
(new ValueToKeyMappingEstimator(mlContext, "Label"))
49
.
Append
(mlContext.MulticlassClassification.Trainers.OneVersusAll(mlContext.BinaryClassification.Trainers.AveragedPerceptron(numberOfIterations: 10)));
StochasticDualCoordinateAscentClassifierBench.cs (1)
80
.
Append
(_mlContext.MulticlassClassification.Trainers.SdcaMaximumEntropy());
TextPredictionEngineCreation.cs (1)
30
.
Append
(_context.BinaryClassification.Trainers.SdcaNonCalibrated(
Microsoft.ML.Samples (44)
Dynamic\ModelOperations\OnnxConversion.cs (9)
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"))
64
.
Append
(mlContext.BinaryClassification.Trainers.AveragedPerceptron());
Dynamic\TensorFlow\TextClassification.cs (3)
109
.
Append
(mlContext.Transforms.CustomMapping(
112
.
Append
(tensorFlowModel.ScoreTensorFlowModel(
115
.
Append
(mlContext.Transforms.CopyColumns(
Dynamic\Trainers\BinaryClassification\PermutationFeatureImportance.cs (1)
30
.
Append
(mlContext.BinaryClassification.Trainers
Dynamic\Trainers\BinaryClassification\PermutationFeatureImportanceLoadFromDisk.cs (1)
26
.
Append
(mlContext.BinaryClassification.Trainers.SdcaLogisticRegression()
Dynamic\Trainers\MulticlassClassification\PermutationFeatureImportance.cs (2)
31
.
Append
(mlContext.Transforms.NormalizeMinMax("Features"))
32
.
Append
(mlContext.MulticlassClassification.Trainers
Dynamic\Trainers\MulticlassClassification\PermutationFeatureImportanceLoadFromDisk.cs (2)
34
.
Append
(mlContext.Transforms.NormalizeMinMax("Features"))
35
.
Append
(mlContext.MulticlassClassification.Trainers
Dynamic\Trainers\Ranking\PermutationFeatureImportance.cs (3)
30
.
Append
(mlContext.Transforms.Conversion.MapValueToKey(
32
.
Append
(mlContext.Transforms.NormalizeMinMax("Features"))
33
.
Append
(mlContext.Ranking.Trainers.FastTree());
Dynamic\Trainers\Ranking\PermutationFeatureImportanceLoadFromDisk.cs (3)
32
.
Append
(mlContext.Transforms.Conversion.MapValueToKey(
34
.
Append
(mlContext.Transforms.NormalizeMinMax("Features"))
35
.
Append
(mlContext.Ranking.Trainers.FastTree());
Dynamic\Trainers\Regression\PermutationFeatureImportance.cs (1)
32
.
Append
(mlContext.Regression.Trainers.Ols());
Dynamic\Trainers\Regression\PermutationFeatureImportanceLoadFromDisk.cs (1)
34
.
Append
(mlContext.Regression.Trainers.Ols());
Dynamic\Transforms\Conversion\KeyToValueToKey.cs (1)
85
var pipeline = defaultPipeline.
Append
(mlContext.Transforms.Conversion
Dynamic\Transforms\Conversion\MapKeyToVector.cs (3)
45
.
Append
(mlContext.Transforms.Conversion.MapValueToKey("Parts"))
46
.
Append
(mlContext.Transforms.Conversion.MapKeyToVector(
48
.
Append
(mlContext.Transforms.Conversion.MapKeyToVector(
Dynamic\Transforms\Conversion\MapValue.cs (1)
63
.
Append
(mlContext.Transforms.Conversion.MapValue("Label",
Dynamic\Transforms\Expression.cs (2)
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\ImageAnalytics\DnnFeaturizeImage.cs (2)
51
.
Append
(mlContext.Transforms.ExtractPixels("Pixels", "ImageObject"))
52
.
Append
(mlContext.Transforms.DnnFeaturizeImage("FeaturizedImage",
Dynamic\Transforms\ImageAnalytics\ExtractPixels.cs (1)
52
.
Append
(mlContext.Transforms.ExtractPixels("Pixels",
Dynamic\Transforms\Text\ApplyCustomWordEmbedding.cs (1)
50
.
Append
(mlContext.Transforms.Text.ApplyWordEmbedding("Features",
Dynamic\Transforms\Text\ApplyWordEmbedding.cs (1)
39
.
Append
(mlContext.Transforms.Text.ApplyWordEmbedding("Features",
Dynamic\Transforms\Text\LatentDirichletAllocation.cs (4)
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\ProduceHashedNgrams.cs (1)
48
.
Append
(mlContext.Transforms.Text.ProduceHashedNgrams(
Dynamic\Transforms\Text\ProduceNgrams.cs (1)
57
.
Append
(mlContext.Transforms.Text.ProduceNgrams("NgramFeatures",
Microsoft.ML.Samples.GPU (3)
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\TextClassification.cs (3)
109
.
Append
(mlContext.Transforms.CustomMapping(
112
.
Append
(tensorFlowModel.ScoreTensorFlowModel(
115
.
Append
(mlContext.Transforms.CopyColumns(
Microsoft.ML.SamplesUtils (8)
SamplesDatasetUtils.cs (8)
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 (30)
TensorFlowEstimatorTests.cs (8)
164
.
Append
(ML.Transforms.ExtractPixels("Input", interleavePixelColors: true))
165
.
Append
(ML.Model.LoadTensorFlowModel(modelLocation).ScoreTensorFlowModel("Output", "Input"));
207
.
Append
(ML.Transforms.ExtractPixels("Input", interleavePixelColors: true))
208
.
Append
(ML.Model.LoadTensorFlowModel(modelLocation, false).ScoreTensorFlowModel("Output", "Input"));
221
.
Append
(ML.Transforms.ExtractPixels("Input", interleavePixelColors: true))
222
.
Append
(ML.Model.LoadTensorFlowModel(modelLocation).ScoreTensorFlowModel("Output", "Input"));
257
.
Append
(ML.Transforms.ExtractPixels("Input", interleavePixelColors: true))
258
.
Append
(tensorFlowModel.ScoreTensorFlowModel("Output", "Input"));
TensorflowTests.cs (22)
150
.
Append
(new ImagePixelExtractingEstimator(_mlContext, "Input", "ImageCropped", interleavePixelColors: true))
151
.
Append
(_mlContext.Model.LoadTensorFlowModel(modelLocation).ScoreTensorFlowModel("Output", "Input"))
152
.
Append
(new ColumnConcatenatingEstimator(_mlContext, "Features", "Output"))
153
.
Append
(new ValueToKeyMappingEstimator(_mlContext, "Label"))
155
.
Append
(_mlContext.MulticlassClassification.Trainers.SdcaMaximumEntropy());
670
.
Append
(_mlContext.Transforms.Concatenate("Features", "Softmax", "dense/Relu"))
671
.
Append
(_mlContext.MulticlassClassification.Trainers.LightGbm("Label", "Features"));
841
.
Append
(_mlContext.MulticlassClassification.Trainers.LightGbm(new Trainers.LightGbm.LightGbmMulticlassTrainer.Options()
894
.
Append
(_mlContext.Transforms.Concatenate("Features", new[] { "Softmax", "dense/Relu" }))
895
.
Append
(_mlContext.MulticlassClassification.Trainers.LightGbm("Label", "Features"));
1023
.
Append
(new ImagePixelExtractingEstimator(_mlContext, "Input",
1118
.
Append
(tensorFlowModel.ScoreTensorFlowModel("Output", "Input"))
1119
.
Append
(_mlContext.Transforms.Conversion.MapValueToKey("Label"))
1120
.
Append
(_mlContext.MulticlassClassification.Trainers.NaiveBayes("Label", "Output"));
1160
.
Append
(new ImagePixelExtractingEstimator(_mlContext, "Input", "ImageCropped", interleavePixelColors: true))
1161
.
Append
(_mlContext.Model.LoadTensorFlowModel(modelLocation).ScoreTensorFlowModel("Output", "Input"))
1162
.
Append
(new ColumnConcatenatingEstimator(_mlContext, "Features", "Output"))
1163
.
Append
(new ValueToKeyMappingEstimator(_mlContext, "Label"))
1165
.
Append
(_mlContext.MulticlassClassification.Trainers.NaiveBayes());
1681
.
Append
(_mlContext.Transforms.Conversion.MapKeyToValue(
2064
.
Append
(_mlContext.Transforms.ExtractPixels("Input", interleavePixelColors: true))
2065
.
Append
(tfModel.ScoreTensorFlowModel("Output", "Input"));
Microsoft.ML.Tests (174)
CachingTests.cs (6)
47
.
Append
(ML.Transforms.NormalizeMeanVariance("Norm2", "F1"));
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 (1)
136
return pipeline.
Append
(ML.Transforms.Conversion.ConvertType("Label", outputKind: DataKind.Boolean))
DatabaseLoaderTests.cs (10)
70
.
Append
(mlContext.MulticlassClassification.Trainers.LightGbm())
71
.
Append
(mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
106
.
Append
(mlContext.MulticlassClassification.Trainers.LightGbm())
107
.
Append
(mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
142
.
Append
(mlContext.MulticlassClassification.Trainers.LightGbm())
143
.
Append
(mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
174
.
Append
(mlContext.MulticlassClassification.Trainers.LightGbm())
175
.
Append
(mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
206
.
Append
(mlContext.MulticlassClassification.Trainers.SdcaMaximumEntropy())
207
.
Append
(mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
FeatureContributionTests.cs (16)
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));
203
.
Append
(ML.Transforms.CalculateFeatureContribution(model, numberOfPositiveContributions: 1, numberOfNegativeContributions: 1))
204
.
Append
(ML.Transforms.CalculateFeatureContribution(model, numberOfPositiveContributions: 1, numberOfNegativeContributions: 1, normalize: false));
227
.
Append
(ML.Transforms.CalculateFeatureContribution(model, numberOfPositiveContributions: 1, numberOfNegativeContributions: 1))
228
.
Append
(ML.Transforms.CalculateFeatureContribution(model, numberOfPositiveContributions: 1, numberOfNegativeContributions: 1, normalize: false));
318
return pipeline.
Append
(ML.Transforms.Conversion.ConvertType("Label", outputKind: DataKind.Boolean))
321
return pipeline.
Append
(ML.Transforms.Conversion.MapValueToKey("Label"))
324
return pipeline.
Append
(ML.Transforms.Conversion.MapValueToKey("GroupId"))
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 (4)
52
.
Append
(new ImagePixelExtractingEstimator(env, "ImagePixels", "ImageReal"))
53
.
Append
(new ImageGrayscalingEstimator(env, ("ImageGray", "ImageReal")));
76
.
Append
(new ImagePixelExtractingEstimator(env, "ImagePixels", "ImageReal"))
77
.
Append
(new ImageGrayscalingEstimator(env, ("ImageGray", "ImageReal")));
OnnxConversionTest.cs (19)
79
.
Append
(mlContext.Regression.Trainers.Sdca(new SdcaRegressionTrainer.Options()
249
var pipeline = initialPipeline.
Append
(estimator);
313
var pipelineEstimators = initialPipeline.
Append
(estimator).
Append
(calibrator);
391
new TextNormalizingEstimator(mlContext, keepDiacritics: true, caseMode: TextNormalizingEstimator.CaseMode.Upper, columns: new[] { ("UpperText", "text") })).
Append
(
575
.
Append
(mlContext.Regression.Trainers.Sdca(new SdcaRegressionTrainer.Options()
606
.
Append
(mlContext.Regression.Trainers.LightGbm(labelColumnName: "Target", featureColumnName: "FeatureVector", numberOfIterations: 3, numberOfLeaves: 16, minimumExampleCountPerLeaf: 100));
630
Append
(mlContext.Transforms.Conversion.MapValueToKey("Label")).
631
Append
(mlContext.MulticlassClassification.Trainers.LbfgsMaximumEntropy(new LbfgsMaximumEntropyMulticlassTrainer.Options() { NumberOfThreads = 1 }));
794
.
Append
(mlContext.Transforms.Concatenate("Features", "F1", "F2"))
795
.
Append
(mlContext.Transforms.NormalizeMinMax("Features"))
796
.
Append
(mlContext.BinaryClassification.Trainers.FastTree(labelColumnName: "Label", featureColumnName: "Features", numberOfLeaves: 2, numberOfTrees: 1, minimumExampleCountPerLeaf: 2));
1480
.
Append
(mlContext.Transforms.Text.ProduceNgrams("NGrams", "Tokens",
1682
.
Append
(mlContext.Transforms.Conversion.MapValueToKey("Label"));
1686
var pipeline = initialPipeline.
Append
(estimator);
1960
var pipeline = initialPipeline.
Append
(estimator);
2007
.
Append
(mlContext.Transforms.Conversion.MapValueToKey("Label"));
2011
var pipeline = initialPipeline.
Append
(estimator);
2202
var chain = new EstimatorChain<ITransformer>().
Append
(pipeline);
PermutationFeatureImportanceTests.cs (6)
861
return pipeline.
Append
(ML.Transforms.Conversion.ConvertType("Label", outputKind: DataKind.Boolean))
864
return pipeline.
Append
(ML.Transforms.Conversion.MapValueToKey("Label"))
867
return pipeline.
Append
(ML.Transforms.Conversion.MapValueToKey("GroupId"))
942
return pipeline.
Append
(ML.Transforms.Conversion.ConvertType("Label", outputKind: DataKind.Boolean))
947
return pipeline.
Append
(ML.Transforms.Conversion.MapValueToKey("Label"))
951
return pipeline.
Append
(ML.Transforms.Conversion.MapValueToKey("GroupId"))
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (15)
181
.
Append
(mlContext.Regression.Trainers.Sdca(labelColumnName: "Target", featureColumnName: "FeatureVector"));
236
.
Append
(mlContext.MulticlassClassification.Trainers.SdcaMaximumEntropy());
264
var finalPipeline = pipeline.
Append
(mlContext.Transforms.Conversion.MapKeyToValue("Data", "PredictedLabel"));
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",
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"))
619
.
Append
(mlContext.BinaryClassification.Trainers.FastTree(numberOfTrees: 50));
652
.
Append
(mlContext.MulticlassClassification.Trainers.SdcaMaximumEntropy());
781
.
Append
(mlContext.BinaryClassification.Trainers.FastTree(labelColumnName: "Label"));
Scenarios\Api\Estimators\DecomposableTrainAndPredict.cs (2)
35
.
Append
(ml.MulticlassClassification.Trainers.SdcaMaximumEntropy(
37
.
Append
(new KeyToValueMappingEstimator(ml, "PredictedLabel"));
Scenarios\Api\Estimators\Extensibility.cs (3)
43
.
Append
(new ValueToKeyMappingEstimator(ml, "Label"), TransformerScope.TrainTest)
44
.
Append
(ml.MulticlassClassification.Trainers.SdcaMaximumEntropy(
46
.
Append
(new KeyToValueMappingEstimator(ml, "PredictedLabel"));
Scenarios\Api\Estimators\MultithreadedPrediction.cs (1)
33
.
Append
(ml.BinaryClassification.Trainers.SdcaNonCalibrated(
Scenarios\Api\Estimators\PredictAndMetadata.cs (2)
33
.
Append
(ml.MulticlassClassification.Trainers.SdcaMaximumEntropy(
82
.
Append
(mlContext.MulticlassClassification.Trainers.SdcaMaximumEntropy(
Scenarios\Api\Estimators\SimpleTrainAndPredict.cs (2)
31
.
Append
(ml.BinaryClassification.Trainers.SdcaNonCalibrated(
68
.
Append
(ml.BinaryClassification.Trainers.SymbolicSgdLogisticRegression(new SymbolicSgdLogisticRegressionBinaryTrainer.Options
Scenarios\IrisPlantClassificationTests.cs (2)
34
.
Append
(mlContext.Transforms.Conversion.MapValueToKey("Label"))
36
.
Append
(mlContext.MulticlassClassification.Trainers.SdcaMaximumEntropy(
Scenarios\IrisPlantClassificationWithStringLabelTests.cs (3)
38
.
Append
(mlContext.Transforms.Conversion.MapValueToKey("Label", "IrisPlantType"), TransformerScope.TrainTest)
40
.
Append
(mlContext.MulticlassClassification.Trainers.SdcaMaximumEntropy(
42
.
Append
(mlContext.Transforms.Conversion.MapKeyToValue("Plant", "PredictedLabel"));
Scenarios\RegressionTest.cs (7)
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",
38
var trainingPipeline = dataProcessPipeline.
Append
(trainer);
ScenariosWithDirectInstantiation\IrisPlantClassificationTests.cs (2)
32
.
Append
(mlContext.Transforms.Conversion.MapValueToKey("Label"))
34
.
Append
(mlContext.MulticlassClassification.Trainers.SdcaMaximumEntropy(
TrainerEstimators\MetalinearEstimators.cs (5)
33
.
Append
(new KeyToValueMappingEstimator(Env, "PredictedLabel"));
50
.
Append
(new KeyToValueMappingEstimator(Env, "PredictedLabel"));
68
.
Append
(ML.Transforms.Conversion.MapKeyToValue("PredictedLabelValue", "PredictedLabel"));
99
.
Append
(ML.MulticlassClassification.Trainers.OneVersusAll(sdcaTrainer))
100
.
Append
(new KeyToValueMappingEstimator(Env, "PredictedLabel"));
TrainerEstimators\TrainerEstimators.cs (4)
99
var pipeWithTrainer = pipe.AppendCacheCheckpoint(Env).
Append
(trainer);
130
var pipeWithTrainer = pipe.AppendCacheCheckpoint(Env).
Append
(trainer);
172
var pipeWithTrainer = pipe.AppendCacheCheckpoint(Env).
Append
(trainer);
219
oneHotPipeline.
Append
(ML.Transforms.Concatenate("Features", "Features", "LoggedIn"));
TrainerEstimators\TreeEnsembleFeaturizerTest.cs (18)
332
.
Append
(ML.BinaryClassification.Trainers.SdcaLogisticRegression("Label", "CombinedFeatures"));
378
.
Append
(ML.BinaryClassification.Trainers.SdcaLogisticRegression("Label", "CombinedFeatures"));
417
.
Append
(ML.BinaryClassification.Trainers.SdcaLogisticRegression("Label", "CombinedFeatures"));
456
.
Append
(ML.Regression.Trainers.Sdca("Label", "CombinedFeatures"));
494
.
Append
(ML.Regression.Trainers.Sdca("Label", "CombinedFeatures"));
532
.
Append
(ML.Regression.Trainers.Sdca("Label", "CombinedFeatures"));
570
.
Append
(ML.Regression.Trainers.Sdca("Label", "CombinedFeatures"));
608
.
Append
(ML.Regression.Trainers.Sdca("Label", "CombinedFeatures"));
664
.
Append
(ML.Transforms.Concatenate("CombinedFeatures", "Features", "OhMyTrees", "OhMyLeaves", "OhMyPaths"))
665
.
Append
(ML.Regression.Trainers.Sdca("Label", "CombinedFeatures"));
695
.
Append
(ML.Transforms.FeaturizeByFastForestRegression(options))
696
.
Append
(ML.Transforms.Concatenate("CombinedFeatures", "Features", "OhMyTrees", "OhMyLeaves", "OhMyPaths"))
697
.
Append
(ML.Regression.Trainers.Sdca("Label", "CombinedFeatures"));
741
.
Append
(ML.BinaryClassification.Trainers.SdcaLogisticRegression("Label", "CombinedFeatures"));
752
.
Append
(ML.BinaryClassification.Trainers.SdcaLogisticRegression("Label", "CombinedFeatures"));
805
.
Append
(ML.Transforms.FeaturizeByFastForestRegression(options))
806
.
Append
(ML.Transforms.Concatenate("CombinedFeatures", "Trees", "Leaves", "Paths"))
807
.
Append
(ML.MulticlassClassification.Trainers.SdcaMaximumEntropy("KeyLabel", "CombinedFeatures"));
TrainerEstimators\TreeEstimators.cs (6)
311
.
Append
(new KeyToValueMappingEstimator(Env, "PredictedLabel"));
351
.
Append
(new KeyToValueMappingEstimator(Env, "PredictedLabel"));
371
.
Append
(new KeyToValueMappingEstimator(Env, "PredictedLabel"));
396
.
Append
(new KeyToValueMappingEstimator(Env, "PredictedLabel"));
415
.
Append
(new KeyToValueMappingEstimator(Env, "PredictedLabel"));
782
.
Append
(ML.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
Transformers\CategoricalHashTests.cs (6)
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));
Transformers\CategoricalTests.cs (8)
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));
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));
Transformers\ConcatTests.cs (2)
67
.
Append
(ML.Transforms.Concatenate("f3", "float4", "float1"))
68
.
Append
(ML.Transforms.Concatenate("f4", "float6", "vfloat", "float1"));
Transformers\ExpressionTransformerTests.cs (4)
42
Append
(ML.Transforms.Expression("Expr3", "(x,y)=>x*y", "Float", "Int")).
43
Append
(ML.Transforms.Expression("Expr4", "(x,y,z)=>abs(x-y)*z", "Float", "FloatVector", "Double")).
44
Append
(ML.Transforms.Expression("Expr5", "x=>len(concat(upper(x),lower(x)))", "Text")).
45
Append
(ML.Transforms.Expression("Expr6", "(x,y)=>right(x,y)", "TextVector", "Int"));
Transformers\FeatureSelectionTests.cs (1)
43
.
Append
(ML.Transforms.FeatureSelection.SelectFeaturesBasedOnCount("bag_of_words_count", "bag_of_words", 10)
Transformers\KeyToVectorEstimatorTests.cs (1)
85
.
Append
(ML.Transforms.Conversion.MapKeyToVector("VectorBaggedString", "B", true));
Transformers\NAReplaceTests.cs (3)
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));
Transformers\NormalizerTests.cs (4)
244
.
Append
(context.Transforms.NormalizeMeanVariance(
247
.
Append
(context.Transforms.NormalizeLogMeanVariance(
250
.
Append
(context.Transforms.NormalizeSupervisedBinning(
668
.
Append
(new VectorWhiteningEstimator(ML, "whitened", "features"));
Transformers\TextFeaturizerTests.cs (6)
471
.
Append
(new KeyToValueMappingEstimator(ML, "chars"));
538
.
Append
(ML.Transforms.Text.RemoveDefaultStopWords("NoDefaultStopwords", "words"))
539
.
Append
(ML.Transforms.Text.RemoveStopWords("NoStopWords", "words", "xbox", "this", "is", "a", "the", "THAT", "bY"));
631
.
Append
(new NgramExtractingEstimator(ML, "ngrams", "terms"))
632
.
Append
(new NgramHashingEstimator(ML, "ngramshash", "terms"))
635
.
Append
(new NgramHashingEstimator(ML, "ngramshashinvert", "terms", maximumNumberOfInverts: 2));
Transformers\TextNormalizer.cs (3)
57
new TextNormalizingEstimator(ML, caseMode: TextNormalizingEstimator.CaseMode.Upper, columns: new[] { ("UpperText", "text") })).
Append
(
58
new TextNormalizingEstimator(ML, keepDiacritics: true, columns: new[] { ("WithDiacriticsText", "text") })).
Append
(
59
new TextNormalizingEstimator(ML, keepNumbers: false, columns: new[] { ("NoNumberText", "text") })).
Append
(
Transformers\WordEmbeddingsTests.cs (2)
43
.
Append
(ML.Transforms.Text.RemoveDefaultStopWords("CleanWords", "Words"));
78
.
Append
(ML.Transforms.Text.RemoveDefaultStopWords("CleanWords", "Words"));
Microsoft.ML.TimeSeries.Tests (3)
TimeSeriesDirectApi.cs (3)
305
.
Append
(new SsaChangePointEstimator(ml, new SsaChangePointDetector.Options()
451
.
Append
(ml.Forecasting.ForecastBySsa("Forecast", "Value", 10, 11, 22, 4,
454
.
Append
(ml.Transforms.Concatenate("Forecast", "Forecast", "ConfidenceLowerBound", "ConfidenceUpperBound"))
Microsoft.ML.TorchSharp.Tests (27)
NerTests.cs (9)
70
var estimator = chain.
Append
(ML.Transforms.Conversion.MapValueToKey("Label", keyData: labels))
71
.
Append
(ML.MulticlassClassification.Trainers.NamedEntityRecognition(outputColumnName: "outputColumn"))
72
.
Append
(ML.Transforms.Conversion.MapKeyToValue("outputColumn"));
149
var estimator = chain.
Append
(ML.Transforms.Conversion.MapValueToKey("Label", keyData: labels))
150
.
Append
(ML.MulticlassClassification.Trainers.NamedEntityRecognition(options))
151
.
Append
(ML.Transforms.Conversion.MapKeyToValue("outputColumn"));
223
var estimator = chain.
Append
(ML.Transforms.Conversion.MapValueToKey("Label", keyData: labels))
224
.
Append
(ML.MulticlassClassification.Trainers.NamedEntityRecognition(options))
225
.
Append
(ML.Transforms.Conversion.MapKeyToValue("outputColumn"));
ObjectDetectionTests.cs (12)
46
var 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"))
51
.
Append
(ML.MulticlassClassification.Trainers.ObjectDetection("Labels", boundingBoxColumnName: "Box", maxEpoch: 1))
52
.
Append
(ML.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
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"))
68
.
Append
(ML.MulticlassClassification.Trainers.ObjectDetection(options))
69
.
Append
(ML.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
QATests.cs (1)
43
var estimator = chain.
Append
(ML.MulticlassClassification.Trainers.QuestionAnswer(maxEpochs: 1));
TextClassificationTests.cs (5)
98
var estimator = chain.
Append
(ML.Transforms.Conversion.MapValueToKey("Label", "Sentiment"), TransformerScope.TrainTest)
99
.
Append
(ML.MulticlassClassification.Trainers.TextClassification(outputColumnName: "outputColumn"))
100
.
Append
(ML.Transforms.Conversion.MapKeyToValue("outputColumn"));
179
.
Append
(mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
237
.
Append
(ML.Transforms.Conversion.MapKeyToValue("outputColumn"));
Microsoft.ML.Transforms (4)
Text\WordBagTransform.cs (4)
520
chain = chain.
Append
<ITransformer>(new ValueToKeyMappingEstimator(h, columnOptions.ToArray(), keyData));
522
chain = chain.
Append
<ITransformer>(new MissingValueDroppingEstimator(h, missingDropColumns.Select(x => (x, x)).ToArray()));
538
return chain.
Append
<ITransformer>(new NgramExtractingEstimator(env, ngramColumns));
690
estimator = estimator.
Append
<ITransformer>(new ColumnConcatenatingEstimator(env, col.Name, col.Source));