TrainerEstimators\MetalinearEstimators.cs (7)
25var calibrator = new PlattCalibratorEstimator(Env);
33.Append(new KeyToValueMappingEstimator(Env, "PredictedLabel"));
50.Append(new KeyToValueMappingEstimator(Env, "PredictedLabel"));
83var loader = new TextLoader(Env, options: options);
97var pipeline = new ColumnConcatenatingEstimator(Env, "Vars", "SepalLength", "SepalWidth", "PetalLength", "PetalWidth")
98.Append(new ValueToKeyMappingEstimator(Env, "Label"))
100.Append(new KeyToValueMappingEstimator(Env, "PredictedLabel"));
TrainerEstimators\TrainerEstimators.cs (14)
30var reader = new TextLoader(Env, new TextLoader.Options()
44var pipeline = new RandomizedPcaTrainer(Env, featureColumn, rank: 10, seed: 1);
59var reader = new TextLoader(Env, new TextLoader.Options
74var pipeline = new KMeansTrainer(Env, new KMeansTrainer.Options
99var pipeWithTrainer = pipe.AppendCacheCheckpoint(Env).Append(trainer);
130var pipeWithTrainer = pipe.AppendCacheCheckpoint(Env).Append(trainer);
172var pipeWithTrainer = pipe.AppendCacheCheckpoint(Env).Append(trainer);
191var data = new TextLoader(Env,
206var pipeline = new TextFeaturizingEstimator(Env, "Features", "SentimentText");
227var data = new TextLoader(Env, new TextLoader.Options
240var pipeline = new ValueToKeyMappingEstimator(Env, new[]{
249return new TextLoader(Env,
278var data = new TextLoader(Env, new TextLoader.Options()
288var pipeline = new ValueToKeyMappingEstimator(Env, "Label");
Transformers\CharTokenizeTests.cs (5)
44var pipe = new TokenizingByCharactersEstimator(Env, columns: new[] { ("TokenizeA", "A"), ("TokenizeB", "B") });
62var pipe = new TokenizingByCharactersEstimator(Env, columns: new[] { ("TokenizeA", "A"), ("TokenizeB", "B") });
67TrainUtils.SaveModel(Env, Env.Start("saving"), ms, null, resultRoles);
69var loadedView = ModelFileUtils.LoadTransforms(Env, dataView, ms);
Transformers\KeyToBinaryVectorEstimatorTest.cs (7)
48dataView = new ValueToKeyMappingEstimator(Env, new[]{
68var transformedData = new ValueToKeyMappingEstimator(Env, new[] {
92var termEst = new ValueToKeyMappingEstimator(Env, new[] {
148var est = new ValueToKeyMappingEstimator(Env, new[]{
160TrainUtils.SaveModel(Env, Env.Start("saving"), ms, null, resultRoles);
162var loadedView = ModelFileUtils.LoadTransforms(Env, dataView, ms);
Transformers\KeyToValueTests.cs (8)
27var reader = new TextLoader(Env, new TextLoader.Options
39data = new ValueToKeyMappingEstimator(Env, new[] {
43var badData1 = new ColumnCopyingTransformer(Env, ("A", "BareKey")).Transform(data);
44var badData2 = new ColumnCopyingTransformer(Env, ("B", "VectorString")).Transform(data);
46var est = new KeyToValueMappingEstimator(Env, ("A_back", "A"), ("B_back", "B"));
52using (var ch = Env.Start("save"))
54var saver = new TextSaver(Env, new TextSaver.Arguments { Silent = true });
73var transformedData = new ValueToKeyMappingEstimator(Env, new[] {
Transformers\KeyToVectorEstimatorTests.cs (7)
55dataView = new ValueToKeyMappingEstimator(Env, new[]{
78var transformedData = new ValueToKeyMappingEstimator(Env, new[] {
102var termEst = new ValueToKeyMappingEstimator(Env, new[] {
207var est = new ValueToKeyMappingEstimator(Env, new[]{
222TrainUtils.SaveModel(Env, Env.Start("saving"), ms, null, resultRoles);
224var loadedView = ModelFileUtils.LoadTransforms(Env, dataView, ms);
Transformers\NormalizerTests.cs (35)
37var loader = new TextLoader(Env, new TextLoader.Options
50var est = new NormalizingEstimator(Env,
78var badData1 = new ColumnCopyingTransformer(Env, ("float1", "int1")).Transform(data);
79var badData2 = new ColumnCopyingTransformer(Env, ("float4", "float0")).Transform(data);
85using (var ch = Env.Start("save"))
87var saver = new TextSaver(Env, new TextSaver.Arguments { Silent = true });
106var loader = new TextLoader(Env, new TextLoader.Options
119var est = new NormalizingEstimator(Env,
471var loader = new TextLoader(Env, new TextLoader.Options
481var est1 = new NormalizingEstimator(Env, "float4");
482var est2 = new NormalizingEstimator(Env, NormalizingEstimator.NormalizationMode.MinMax, ("float4", "float4"));
483var est3 = new NormalizingEstimator(Env, new NormalizingEstimator.MinMaxColumnOptions("float4"));
503var est6 = new NormalizingEstimator(Env, NormalizingEstimator.NormalizationMode.MeanVariance, ("float4", "float4"));
504var est7 = new NormalizingEstimator(Env, new NormalizingEstimator.MeanVarianceColumnOptions("float4"));
516var est9 = new NormalizingEstimator(Env, NormalizingEstimator.NormalizationMode.LogMeanVariance, ("float4", "float4"));
517var est10 = new NormalizingEstimator(Env, new NormalizingEstimator.LogMeanVarianceColumnOptions("float4"));
529var est12 = new NormalizingEstimator(Env, NormalizingEstimator.NormalizationMode.Binning, ("float4", "float4"));
530var est13 = new NormalizingEstimator(Env, new NormalizingEstimator.BinningColumnOptions("float4"));
542var est15 = new NormalizingEstimator(Env, NormalizingEstimator.NormalizationMode.SupervisedBinning, ("float4", "float4"));
543var est16 = new NormalizingEstimator(Env, new NormalizingEstimator.SupervisedBinningColumOptions("float4"));
555var est18 = new NormalizingEstimator(Env, NormalizingEstimator.NormalizationMode.RobustScaling, ("float4", "float4"));
556var est19 = new NormalizingEstimator(Env, new NormalizingEstimator.RobustScalingColumnOptions("float4"));
575var loader = new TextLoader(Env, new TextLoader.Options
633var loader = new TextLoader(Env, new TextLoader.Options
672using (var ch = Env.Start("save"))
706using (var ch = Env.Start("save"))
743TrainUtils.SaveModel(ML, Env.Start("saving"), ms, null, resultRoles);
769using (var ch = Env.Start("save"))
804TrainUtils.SaveModel(ML, Env.Start("saving"), ms, null, resultRoles);
829using (var ch = Env.Start("save"))
864TrainUtils.SaveModel(ML, Env.Start("saving"), ms, null, resultRoles);
878var result = ModelFileUtils.LoadTransforms(Env, dataView, fs);
991var loader = new TextLoader(Env, new TextLoader.Options
1009using (var ch = Env.Start("save"))
1011var saver = new TextSaver(Env, new TextSaver.Arguments { Silent = true });
Transformers\SelectColumnsTests.cs (13)
49var est = ColumnSelectingEstimator.KeepColumns(Env, "A", "C");
70var est = ColumnSelectingEstimator.KeepColumns(Env, "C", "A");
89var est = ColumnSelectingEstimator.DropColumns(Env, "A", "C");
124var est = ColumnSelectingEstimator.KeepColumns(Env, "D", "G");
133var est = new ColumnCopyingEstimator(Env, new[] { ("A", "A"), ("B", "B") });
134var chain = est.Append(ColumnSelectingEstimator.KeepColumns(Env, "C", "A"));
156var est = new ColumnCopyingEstimator(Env, new[] { ("A", "A"), ("B", "B") });
179var est = ColumnSelectingEstimator.KeepColumns(Env, "A", "B");
198var est = new ColumnCopyingEstimator(Env, new[] { ("A", "A"), ("B", "B") }).Append(
223var result = ModelFileUtils.LoadTransforms(Env, dataView, fs);
251var result = ModelFileUtils.LoadTransforms(Env, dataView, fs);
279var result = ModelFileUtils.LoadTransforms(Env, dataView, fs);
307var result = ModelFileUtils.LoadTransforms(Env, dataView, fs);
Transformers\TextFeaturizerTests.cs (5)
494var est = new WordTokenizingEstimator(Env, "words", "text", separators: new[] { ' ', '?', '!', '.', ',' });
498var saver = new TextSaver(Env, new TextSaver.Arguments { Silent = true });
500using (var ch = Env.Start("save"))
662var result = ModelFileUtils.LoadTransforms(Env, data, fs);
721var builder = new ArrayDataViewBuilder(Env);
Transformers\TextNormalizer.cs (4)
82var pipe = new TextNormalizingEstimator(Env, columns: new[] { ("NormA", "A"), ("NormB", "B") });
88TrainUtils.SaveModel(Env, Env.Start("saving"), ms, null, resultRoles);
90var loadedView = ModelFileUtils.LoadTransforms(Env, dataView, ms);
Transformers\ValueMappingTests.cs (17)
58var lookupMap = DataViewHelper.CreateDataView(Env, keys, values,
62var estimator = new ValueMappingEstimator<string, int>(Env, lookupMap,
96var lookupMap = DataViewHelper.CreateDataView(Env, keys, values,
100var valueMappingEstimator = new ValueMappingEstimator<string, int>(Env, lookupMap,
105var estimator = new WordTokenizingEstimator(Env, new[]{
145var estimator = new WordTokenizingEstimator(Env, new[] { new WordTokenizingEstimator.ColumnOptions("TokenizeA", "A") }).
180var lookupMap = DataViewHelper.CreateDataView(Env, keys, values,
184var estimator = new ValueMappingEstimator<string, int>(Env, lookupMap,
236var estimator = new ValueMappingEstimator(Env, mapView, mapView.Schema["Key"], mapView.Schema["Value"], new[] { ("D", "A"), ("E", "B"), ("F", "C") });
269var lookupMap = DataViewHelper.CreateDataView(Env, keys, values,
273var estimator = new ValueMappingEstimator<string, int>(Env, lookupMap,
310var lookupMap = DataViewHelper.CreateDataView(Env, keys, values,
314var estimator = new ValueMappingEstimator<string, int>(Env, lookupMap,
348var lookupMap = DataViewHelper.CreateDataView(Env, keys, values,
352Assert.Throws<InvalidOperationException>(() => new ValueMappingEstimator<string, int>(Env, lookupMap,
719var result = ModelFileUtils.LoadTransforms(Env, dataView, fs);
736var result = ModelFileUtils.LoadTransforms(Env, dataView, fs);