74 references to TrainUtils
Microsoft.ML.Data (74)
Commands\CrossValidationCommand.cs (13)
110TrainUtils.CheckTrainer(Host, args.Trainer, args.DataFile); 150if (ImplOptions.ContinueTrain && !TrainUtils.TryLoadPredictor(ch, Host, ImplOptions.InputModelFile, out inputPredictor)) 160string name = TrainUtils.MatchNameOrDefaultOrNull(ch, loader.Schema, nameof(ImplOptions.NameColumn), ImplOptions.NameColumn, DefaultColumnNames.Name); 271string label = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(ImplOptions.LabelColumn), ImplOptions.LabelColumn, DefaultColumnNames.Label); 272string features = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(ImplOptions.FeatureColumn), ImplOptions.FeatureColumn, DefaultColumnNames.Features); 273string weight = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(ImplOptions.WeightColumn), ImplOptions.WeightColumn, DefaultColumnNames.Weight); 274string name = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(ImplOptions.NameColumn), ImplOptions.NameColumn, DefaultColumnNames.Name); 275string group = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(ImplOptions.GroupColumn), ImplOptions.GroupColumn, DefaultColumnNames.GroupId); 277TrainUtils.AddNormalizerIfNeeded(env, ch, trainer, ref data, features, ImplOptions.NormalizeFeatures); 280var customCols = TrainUtils.CheckAndGenerateCustomColumns(ch, ImplOptions.CustomColumns); 297string group = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(ImplOptions.GroupColumn), ImplOptions.GroupColumn, DefaultColumnNames.GroupId); 523var predictor = TrainUtils.Train(host, ch, trainData, trainer, validData, 545TrainUtils.SaveModel(host, ch, file, predictor, rmd, _cmd);
Commands\EvaluateCommand.cs (9)
154string label = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(Arguments.LabelColumn), 156string group = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(Arguments.GroupColumn), 158string weight = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(Arguments.WeightColumn), 160var customCols = TrainUtils.CheckAndGenerateCustomColumns(ch, args.CustomColumns); 230string label = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(Arguments.LabelColumn), 232string group = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(Arguments.GroupColumn), 234string weight = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(Arguments.WeightColumn), 236string name = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(Arguments.NameColumn), 238var customCols = TrainUtils.CheckAndGenerateCustomColumns(ch, ImplOptions.CustomColumns);
Commands\ScoreCommand.cs (3)
116string feat = TrainUtils.MatchNameOrDefaultOrNull(ch, loader.Schema, 118string group = TrainUtils.MatchNameOrDefaultOrNull(ch, loader.Schema, 120var customCols = TrainUtils.CheckAndGenerateCustomColumns(ch, ImplOptions.CustomColumns);
Commands\TestCommand.cs (6)
101string label = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(ImplOptions.LabelColumn), 103string features = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(ImplOptions.FeatureColumn), 105string group = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(ImplOptions.GroupColumn), 107string weight = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(ImplOptions.WeightColumn), 109string name = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(ImplOptions.NameColumn), 111var customCols = TrainUtils.CheckAndGenerateCustomColumns(ch, ImplOptions.CustomColumns);
Commands\TrainCommand.cs (11)
101TrainUtils.CheckTrainer(Host, args.Trainer, args.DataFile); 145if (ImplOptions.ContinueTrain && !TrainUtils.TryLoadPredictor(ch, Host, ImplOptions.InputModelFile, out inputPredictor)) 152var label = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(Arguments.LabelColumn), _labelColumn, DefaultColumnNames.Label); 153var feature = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(Arguments.FeatureColumn), _featureColumn, DefaultColumnNames.Features); 154var group = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(Arguments.GroupColumn), _groupColumn, DefaultColumnNames.GroupId); 155var weight = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(Arguments.WeightColumn), _weightColumn, DefaultColumnNames.Weight); 156var name = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(Arguments.NameColumn), _nameColumn, DefaultColumnNames.Name); 158TrainUtils.AddNormalizerIfNeeded(Host, ch, trainer, ref view, feature, ImplOptions.NormalizeFeatures); 162var customCols = TrainUtils.CheckAndGenerateCustomColumns(ch, ImplOptions.CustomColumns); 200var predictor = TrainUtils.Train(Host, ch, data, trainer, validData, 204TrainUtils.SaveModel(Host, ch, file, predictor, data, cmd);
Commands\TrainTestCommand.cs (11)
90TrainUtils.CheckTrainer(Host, args.Trainer, args.DataFile); 128if (ImplOptions.ContinueTrain && !TrainUtils.TryLoadPredictor(ch, Host, ImplOptions.InputModelFile, out inputPredictor)) 135string label = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(Arguments.LabelColumn), 137string features = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(Arguments.FeatureColumn), 139string group = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(Arguments.GroupColumn), 141string weight = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(Arguments.WeightColumn), 143string name = TrainUtils.MatchNameOrDefaultOrNull(ch, schema, nameof(Arguments.NameColumn), 146TrainUtils.AddNormalizerIfNeeded(Host, ch, trainer, ref trainPipe, features, ImplOptions.NormalizeFeatures); 149var customCols = TrainUtils.CheckAndGenerateCustomColumns(ch, ImplOptions.CustomColumns); 186var predictor = TrainUtils.Train(Host, ch, data, trainer, validData, 195TrainUtils.SaveModel(Host, ch, file, predictor, data, cmd);
EntryPoints\InputBase.cs (2)
83TrainUtils.AddNormalizerIfNeeded(host, ch, trainer, ref view, feature, input.NormalizeFeatures); 119var predictor = TrainUtils.Train(host, ch, cachedRoleMappedData, trainer, calibrator, maxCalibrationExamples);
EntryPoints\PredictorModelImpl.cs (1)
86TrainUtils.SaveModel(env, ch, stream, Predictor, roleMappedData);
EntryPoints\TransformModelImpl.cs (1)
179TrainUtils.SaveDataPipe(env, rep, _chain, blankLoader: true);
Evaluators\BinaryClassifierEvaluator.cs (3)
1535label = TrainUtils.MatchNameOrDefaultOrNull(host, schema, 1538weight = TrainUtils.MatchNameOrDefaultOrNull(host, schema, 1541name = TrainUtils.MatchNameOrDefaultOrNull(host, schema,
Evaluators\ClusteringEvaluator.cs (1)
867string features = TrainUtils.MatchNameOrDefaultOrNull(host, schema,
Evaluators\RankingEvaluator.cs (1)
1093string groupId = TrainUtils.MatchNameOrDefaultOrNull(host, schema,
Transforms\TrainAndScoreTransformer.cs (11)
93string feat = TrainUtils.MatchNameOrDefaultOrNull(env, input.Schema, 95string group = TrainUtils.MatchNameOrDefaultOrNull(env, input.Schema, 97var customCols = TrainUtils.CheckAndGenerateCustomColumns(env, args.CustomColumns); 238var customCols = TrainUtils.CheckAndGenerateCustomColumns(env, args.CustomColumns); 242var predictor = TrainUtils.Train(host, ch, data, trainer, null, 261feat = TrainUtils.MatchNameOrDefaultOrNull(ectx, schema, nameof(args.FeatureColumn), args.FeatureColumn, 263var label = TrainUtils.MatchNameOrDefaultOrNull(ectx, schema, nameof(args.LabelColumn), args.LabelColumn, 265group = TrainUtils.MatchNameOrDefaultOrNull(ectx, schema, nameof(args.GroupColumn), args.GroupColumn, 267var weight = TrainUtils.MatchNameOrDefaultOrNull(ectx, schema, nameof(args.WeightColumn), args.WeightColumn, 269var name = TrainUtils.MatchNameOrDefaultOrNull(ectx, schema, nameof(args.NameColumn), args.NameColumn, 271var customCols = TrainUtils.CheckAndGenerateCustomColumns(ectx, args.CustomColumns);
Utilities\ModelFileUtils.cs (1)
321return TrainUtils.CheckAndGenerateCustomColumns(env, list.ToArray());