Skip to content

Commit d097a49

Browse files
Minor refactoring/rename for pipeline composed by chain of estimators
1 parent 058b915 commit d097a49

File tree

1 file changed

+3
-2
lines changed
  • samples/csharp/getting-started/AnomalyDetection_CreditCardFraudDetection/AnomalyDetection.Train

1 file changed

+3
-2
lines changed

samples/csharp/getting-started/AnomalyDetection_CreditCardFraudDetection/AnomalyDetection.Train/ModelBuilder.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public void TrainFastTreeAndSaveModels( int cvNumFolds = 2, int numLeaves= 20 ,
5555

5656
var logMeanVarNormalizer = new Normalizer(_env,Normalizer.NormalizerMode.MeanVariance ,("Features", "FeaturesNormalizedByMeanVar"));
5757

58-
var estimator = new ConcatEstimator(_env, "Features", new[] { "Amount", "V1", "V2", "V3", "V4", "V5", "V6",
58+
//Create a flexible pipeline (composed by a chain of estimators) for building/traing the model.
59+
var pipeline = new ConcatEstimator(_env, "Features", new[] { "Amount", "V1", "V2", "V3", "V4", "V5", "V6",
5960
"V7", "V8", "V9", "V10", "V11", "V12",
6061
"V13", "V14", "V15", "V16", "V17", "V18",
6162
"V19", "V20", "V21", "V22", "V23", "V24",
@@ -72,7 +73,7 @@ public void TrainFastTreeAndSaveModels( int cvNumFolds = 2, int numLeaves= 20 ,
7273
// Now run the n-fold cross-validation experiment, using the same pipeline.
7374
// Can't do stratification when column type is a boolean
7475
// var cvResults = _context.CrossValidate(_trainData, estimator, labelColumn: "Label", numFolds: numFolds, stratificationColumn: "Label");
75-
var cvResults = _context.CrossValidate(_trainData, estimator, labelColumn: "Label", numFolds: cvNumFolds);
76+
var cvResults = _context.CrossValidate(_trainData, pipeline, labelColumn: "Label", numFolds: cvNumFolds);
7677

7778

7879
// Let's get Cross Validate metrics

0 commit comments

Comments
 (0)