29 instantiations of RoleMappedSchema
Microsoft.ML.Core (3)
Data\RoleMappedSchema.cs (3)
442
: this(Contracts.CheckRef(data, nameof(data)), new
RoleMappedSchema
(data.Schema, Contracts.CheckRef(roles, nameof(roles)), opt))
457
: this(Contracts.CheckRef(data, nameof(data)), new
RoleMappedSchema
(data.Schema, Contracts.CheckRef(roles, nameof(roles)), opt))
479
new
RoleMappedSchema
(data.Schema, label, feature, group, weight, name, custom, opt))
Microsoft.ML.Data (17)
Commands\DataCommand.cs (1)
308
trainSchema = new
RoleMappedSchema
(trainPipe.Schema, trainRoleMappings);
Commands\SavePredictorCommand.cs (1)
223
schema = new
RoleMappedSchema
(emptyView.Schema, roles, opt: true);
Commands\ScoreCommand.cs (2)
121
var schema = new
RoleMappedSchema
(loader.Schema, label: null, feature: feat, group: group, custom: customCols, opt: true);
267
var schema = new
RoleMappedSchema
(input.Schema, label: null, feature: featureColName, group: groupColName, custom: customColumns, opt: true);
Deprecated\Instances\HeaderSchema.cs (2)
308
Schema = new
RoleMappedSchema
(new FeatureNameCollectionBinding(this).FeatureNameCollectionSchema,
400
_schema = new
RoleMappedSchema
(new FeatureNameCollectionBinding(this).FeatureNameCollectionSchema,
EntryPoints\PredictorModelImpl.cs (1)
142
var trainRms = new
RoleMappedSchema
(predInput.Schema, _roleMappings, opt: true);
Scorers\GenericScorer.cs (1)
74
var mapper = bindable.Bind(env, new
RoleMappedSchema
(input, roles));
Scorers\PredictedLabelScorerBase.cs (2)
112
var schema = new
RoleMappedSchema
(input, RowMapper.GetInputColumnRoles());
143
var mapper = bindable.Bind(env, new
RoleMappedSchema
(input, roles));
Scorers\PredictionTransformer.cs (6)
306
var schema = new
RoleMappedSchema
(TrainSchema, null, FeatureColumnName);
348
var schema = new
RoleMappedSchema
(TrainSchema, null, FeatureColumnName);
440
var schema = new
RoleMappedSchema
(TrainSchema, LabelColumnName, FeatureColumnName);
532
var schema = new
RoleMappedSchema
(TrainSchema, _trainLabelColumn, FeatureColumnName);
674
var schema = new
RoleMappedSchema
(inputSchema, null, featureColumn);
686
var schema = new
RoleMappedSchema
(TrainSchema, null, FeatureColumnName);
Utilities\ModelFileUtils.cs (1)
351
return new
RoleMappedSchema
(pipe.Schema, roleMappings);
Microsoft.ML.Ensemble (1)
PipelineEnsemble.cs (1)
330
var bound = new Bound(this, new
RoleMappedSchema
(data.Schema));
Microsoft.ML.EntryPoints (1)
FeatureCombiner.cs (1)
55
var rms = new
RoleMappedSchema
(viewTrain.Schema, input.GetRoles());
Microsoft.ML.FastTree (1)
TreeEnsembleFeaturizationTransformer.cs (1)
66
return new
RoleMappedSchema
(schema, roles);
Microsoft.ML.Predictor.Tests (2)
TestIniModels.cs (2)
535
var roleMappedSchema = new
RoleMappedSchema
(data.Schema, false,
574
var roleMappedSchema = new
RoleMappedSchema
(data.Schema, false,
Microsoft.ML.Recommender (1)
MatrixFactorizationPredictor.cs (1)
474
var schema = new
RoleMappedSchema
(TrainSchema, roles);
Microsoft.ML.StandardTrainers (2)
FactorizationMachine\FieldAwareFactorizationMachineModelParameters.cs (1)
427
var schema = new
RoleMappedSchema
(TrainSchema, roles);
FactorizationMachine\FieldAwareFactorizationMachineUtils.cs (1)
88
InputRoleMappedSchema = new
RoleMappedSchema
(schema.Schema, inputFeatureColumns);
Microsoft.ML.Tests (1)
TrainerEstimators\TreeEnsembleFeaturizerTest.cs (1)
49
var roleMappedSchema = new
RoleMappedSchema
(dataView.Schema,
495 references to RoleMappedSchema
Microsoft.ML.Core (27)
Data\AnnotationUtils.cs (2)
298
public static void GetSlotNames(
RoleMappedSchema
schema,
RoleMappedSchema
.ColumnRole role, int vectorSize, ref VBuffer<ReadOnlyMemory<char>> slotNames)
Data\ISchemaBindableMapper.cs (6)
12
/// A mapper that can be bound to a <see cref="
RoleMappedSchema
"/> (which encapsulates a <see cref="DataViewSchema"/> and has mappings from column kinds
13
/// to columns of that schema). Binding an <see cref="ISchemaBindableMapper"/> to a <see cref="
RoleMappedSchema
"/> produces an
27
ISchemaBoundMapper Bind(IHostEnvironment env,
RoleMappedSchema
schema);
38
/// The <see cref="
RoleMappedSchema
"/> that was passed to the <see cref="ISchemaBoundMapper"/> in the binding process.
40
RoleMappedSchema
InputRoleMappedSchema { get; }
55
IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> GetInputColumnRoles();
Data\RoleMappedSchema.cs (17)
33
/// Note that there is no need for components consuming a <see cref="RoleMappedData"/> or <see cref="
RoleMappedSchema
"/>
51
/// Instances of this are the keys of a <see cref="
RoleMappedSchema
"/>. This class also holds some important
112
/// for giving to constructors of <see cref="
RoleMappedSchema
"/> and <see cref="RoleMappedData"/>.
391
IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> custom = null, bool opt = false)
404
/// Encapsulates an <see cref="IDataView"/> plus a corresponding <see cref="
RoleMappedSchema
"/>.
405
/// Note that the schema of <see cref="
RoleMappedSchema
.Schema"/> of <see cref="Schema"/> is
417
/// The role mapped schema. Note that <see cref="Schema"/>'s <see cref="
RoleMappedSchema
.Schema"/> is
420
public
RoleMappedSchema
Schema { get; }
422
private RoleMappedData(IDataView data,
RoleMappedSchema
schema)
441
public RoleMappedData(IDataView data, bool opt = false, params KeyValuePair<
RoleMappedSchema
.ColumnRole, string>[] roles)
456
public RoleMappedData(IDataView data, IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> roles, bool opt = false)
466
/// <param name="label">The column name that will be mapped to the <see cref="
RoleMappedSchema
.ColumnRole.Label"/> role</param>
467
/// <param name="feature">The column name that will be mapped to the <see cref="
RoleMappedSchema
.ColumnRole.Feature"/> role</param>
468
/// <param name="group">The column name that will be mapped to the <see cref="
RoleMappedSchema
.ColumnRole.Group"/> role</param>
469
/// <param name="weight">The column name that will be mapped to the <see cref="
RoleMappedSchema
.ColumnRole.Weight"/> role</param>
470
/// <param name="name">The column name that will be mapped to the <see cref="
RoleMappedSchema
.ColumnRole.Name"/> role</param>
477
IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> custom = null, bool opt = false)
EntryPoints\PredictorModel.cs (2)
64
/// Returns the <see cref="
RoleMappedSchema
"/> that was used in training.
67
internal abstract
RoleMappedSchema
GetTrainingSchema(IHostEnvironment env);
Microsoft.ML.Core.Tests (4)
UnitTests\TestEntryPoints.cs (4)
2184
RoleMappedSchema
.CreatePair(
RoleMappedSchema
.ColumnRole.Feature, "Features"),
2185
RoleMappedSchema
.CreatePair(
RoleMappedSchema
.ColumnRole.Label, "Label"));
Microsoft.ML.Data (273)
Commands\CrossValidationCommand.cs (5)
34
public IComponentFactory<IDataView, ISchemaBoundMapper,
RoleMappedSchema
, IDataScorerTransform> Scorer;
335
public readonly
RoleMappedSchema
TrainSchema;
337
public FoldResult(Dictionary<string, IDataView> metrics, DataViewSchema scoreSchema, RoleMappedData perInstance,
RoleMappedSchema
trainSchema)
352
private readonly IComponentFactory<IDataView, ISchemaBoundMapper,
RoleMappedSchema
, IDataScorerTransform> _scorer;
392
IComponentFactory<IDataView, ISchemaBoundMapper,
RoleMappedSchema
, IDataScorerTransform> scorer,
Commands\DataCommand.cs (1)
249
bool wantTrainSchema, out
RoleMappedSchema
trainSchema,
Commands\SavePredictorCommand.cs (3)
132
RoleMappedSchema
schema;
141
public static void SavePredictor(IChannel ch, IPredictor predictor,
RoleMappedSchema
schema,
207
public static void LoadModel(IHostEnvironment env, Stream modelStream, bool loadNames, out IPredictor predictor, out
RoleMappedSchema
schema)
Commands\ScoreCommand.cs (10)
21
using TScorerFactory = IComponentFactory<IDataView, ISchemaBoundMapper,
RoleMappedSchema
, IDataScorerTransform>;
37
internal delegate void SignatureDataScorer(IDataView data, ISchemaBoundMapper mapper,
RoleMappedSchema
trainSchema);
104
LoadModelObjects(ch, true, out var predictor, true, out
var
trainSchema, out var loader);
121
var
schema = new RoleMappedSchema(loader.Schema, label: null, feature: feat, group: group, custom: customCols, opt: true);
241
public static IDataScorerTransform GetScorer(IPredictor predictor, RoleMappedData data, IHostEnvironment env,
RoleMappedSchema
trainSchema)
253
IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> customColumns,
255
RoleMappedSchema
trainSchema,
267
var
schema = new RoleMappedSchema(input.Schema, label: null, feature: featureColName, group: groupColName, custom: customColumns, opt: true);
278
RoleMappedSchema
schema,
321
Func<IHostEnvironment, IDataView, ISchemaBoundMapper,
RoleMappedSchema
, IDataScorerTransform> factoryFunc;
Commands\TestCommand.cs (2)
48
public IComponentFactory<IDataView, ISchemaBoundMapper,
RoleMappedSchema
, IDataScorerTransform> Scorer;
93
RoleMappedSchema
trainSchema;
Commands\TrainCommand.cs (1)
25
using ColumnRole =
RoleMappedSchema
.ColumnRole;
Commands\TrainTestCommand.cs (1)
32
public IComponentFactory<IDataView, ISchemaBoundMapper,
RoleMappedSchema
, IDataScorerTransform> Scorer;
DataLoadSave\TransformerChain.cs (7)
302
roles.Where(x => x.Key.Value ==
RoleMappedSchema
.ColumnRole.Feature.Value).First().Value);
306
roles.Where(x => x.Key.Value ==
RoleMappedSchema
.ColumnRole.Feature.Value).First().Value,
307
roles.Where(x => x.Key.Value ==
RoleMappedSchema
.ColumnRole.Label.Value).First().Value);
310
roles.Where(x => x.Key.Value ==
RoleMappedSchema
.ColumnRole.Feature.Value).First().Value);
313
roles.Where(x => x.Key.Value ==
RoleMappedSchema
.ColumnRole.Feature.Value).First().Value);
316
roles.Where(x => x.Key.Value ==
RoleMappedSchema
.ColumnRole.Feature.Value).First().Value);
319
roles.Where(x => x.Key.Value ==
RoleMappedSchema
.ColumnRole.Feature.Value).First().Value);
Deprecated\Instances\HeaderSchema.cs (9)
40
schemaBuilder.AddColumn(
RoleMappedSchema
.ColumnRole.Feature.Value, _colType, metadataBuilder.ToAnnotations());
74
public abstract
RoleMappedSchema
Schema { get; }
294
public override
RoleMappedSchema
Schema { get; }
309
roles:
RoleMappedSchema
.ColumnRole.Feature.Bind(
RoleMappedSchema
.ColumnRole.Feature.Value));
367
private readonly
RoleMappedSchema
_schema;
369
public override
RoleMappedSchema
Schema => _schema;
401
roles:
RoleMappedSchema
.ColumnRole.Feature.Bind(
RoleMappedSchema
.ColumnRole.Feature.Value));
Dirty\PredictorInterfaces.cs (8)
81
void SaveAsText(TextWriter writer,
RoleMappedSchema
schema);
90
void SaveAsIni(TextWriter writer,
RoleMappedSchema
schema, ICalibrator calibrator = null);
99
void SaveSummary(TextWriter writer,
RoleMappedSchema
schema);
113
IList<KeyValuePair<string, object>> GetSummaryInKeyValuePairs(
RoleMappedSchema
schema);
119
DataViewRow GetSummaryIRowOrNull(
RoleMappedSchema
schema);
121
DataViewRow GetStatsIRowOrNull(
RoleMappedSchema
schema);
127
IDataView GetSummaryDataView(
RoleMappedSchema
schema);
136
void SaveAsCode(TextWriter writer,
RoleMappedSchema
schema);
Dirty\PredictorUtils.cs (4)
18
public static void SaveSummary(IChannel ch, IPredictor predictor,
RoleMappedSchema
schema, TextWriter writer)
38
public static void SaveText(IChannel ch, IPredictor predictor,
RoleMappedSchema
schema, TextWriter writer)
85
public static void SaveIni(IChannel ch, IPredictor predictor,
RoleMappedSchema
schema, TextWriter writer)
117
public static void SaveCode(IChannel ch, IPredictor predictor,
RoleMappedSchema
schema, TextWriter writer)
EntryPoints\InputBase.cs (1)
64
Func<IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>>> getCustom = null,
EntryPoints\PredictorModelImpl.cs (5)
23
private readonly KeyValuePair<
RoleMappedSchema
.ColumnRole, string>[] _roleMappings;
60
private PredictorModelImpl(TransformModel transformModel, IPredictor predictor, KeyValuePair<
RoleMappedSchema
.ColumnRole, string>[] roleMappings)
123
var
trainRms = GetTrainingSchema(env);
138
internal override
RoleMappedSchema
GetTrainingSchema(IHostEnvironment env)
142
var
trainRms = new RoleMappedSchema(predInput.Schema, _roleMappings, opt: true);
EntryPoints\SummarizePredictor.cs (1)
49
internal static IDataView GetSummaryAndStats(IHostEnvironment env, IPredictor predictor,
RoleMappedSchema
schema, out IDataView stats)
Evaluators\AnomalyDetectionEvaluator.cs (7)
95
private protected override void CheckScoreAndLabelTypes(
RoleMappedSchema
schema)
107
private protected override Aggregator GetAggregatorCore(
RoleMappedSchema
schema, string stratName)
502
internal override void InitializeNextPass(DataViewRow row,
RoleMappedSchema
schema)
597
RoleMappedSchema
.ColumnRole.Label.Bind(label),
598
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.Score, score),
599
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.PredictedLabel, predictedLabel));
789
private protected override IEnumerable<string> GetPerInstanceColumnsToSave(
RoleMappedSchema
schema)
Evaluators\BinaryClassifierEvaluator.cs (26)
126
private protected override void CheckScoreAndLabelTypes(
RoleMappedSchema
schema)
139
private protected override void CheckCustomColumnTypesCore(
RoleMappedSchema
schema)
158
private protected override Func<int, bool> GetActiveColsCore(
RoleMappedSchema
schema)
166
private protected override Aggregator GetAggregatorCore(
RoleMappedSchema
schema, string stratName)
172
private ReadOnlyMemory<char>[] GetClassNames(
RoleMappedSchema
schema)
191
private protected override IRowMapper CreatePerInstanceRowMapper(
RoleMappedSchema
schema)
620
internal override void InitializeNextPass(DataViewRow row,
RoleMappedSchema
schema)
632
var prob = schema.GetColumns(new
RoleMappedSchema
.ColumnRole(AnnotationUtils.Const.ScoreValueKind.Probability));
819
RoleMappedSchema
.ColumnRole.Label.Bind(label),
820
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.Score, score),
821
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.Probability, probability),
822
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.PredictedLabel, predictedLabel));
867
RoleMappedSchema
.ColumnRole.Label.Bind(label),
868
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.Score, score),
869
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.Probability, probability),
870
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.PredictedLabel, predictedLabel));
947
RoleMappedSchema
.ColumnRole.Label.Bind(label),
948
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.Score, score),
949
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.PredictedLabel, predictedLabel));
993
RoleMappedSchema
.ColumnRole.Label.Bind(label),
994
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.Score, score),
995
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.PredictedLabel, predictedLabel));
1340
private protected override IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> GetInputColumnRolesCore(
RoleMappedSchema
schema)
1351
cols = AnnotationUtils.Prepend(cols,
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.Probability, probCol.Value.Name));
1472
private protected override IEnumerable<string> GetPerInstanceColumnsToSave(
RoleMappedSchema
schema)
Evaluators\ClusteringEvaluator.cs (16)
70
var roles = new List<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>>();
71
roles.Add(
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.Score, score));
74
roles.Add(
RoleMappedSchema
.ColumnRole.Label.Bind(label));
77
roles.Add(
RoleMappedSchema
.ColumnRole.Feature.Bind(features));
97
private protected override void CheckScoreAndLabelTypes(
RoleMappedSchema
schema)
112
private protected override void CheckCustomColumnTypesCore(
RoleMappedSchema
schema)
126
private protected override Func<int, bool> GetActiveColsCore(
RoleMappedSchema
schema)
134
private protected override Aggregator GetAggregatorCore(
RoleMappedSchema
schema, string stratName)
145
private protected override IRowMapper CreatePerInstanceRowMapper(
RoleMappedSchema
schema)
487
internal override void InitializeNextPass(DataViewRow row,
RoleMappedSchema
schema)
801
private protected override IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> GetInputColumnRolesCore(
RoleMappedSchema
schema)
805
if (!col.Key.Equals(
RoleMappedSchema
.ColumnRole.Label))
816
yield return
RoleMappedSchema
.ColumnRole.Feature.Bind(feat);
821
private protected override IEnumerable<string> GetPerInstanceColumnsToSave(
RoleMappedSchema
schema)
835
private protected override IDataView GetPerInstanceMetricsCore(IDataView perInst,
RoleMappedSchema
schema)
Evaluators\EvaluatorBase.cs (21)
48
private protected void CheckColumnTypes(
RoleMappedSchema
schema)
59
/// Check that the types of the score and label columns are as expected by the evaluator. The <see cref="
RoleMappedSchema
"/>
61
/// Access the label column with the <see cref="
RoleMappedSchema
.Label"/> property, and the score column with the
62
/// <see cref="
RoleMappedSchema
.GetUniqueColumn"/> or <see cref="
RoleMappedSchema
.GetColumns"/> methods.
65
private protected abstract void CheckScoreAndLabelTypes(
RoleMappedSchema
schema);
72
private protected virtual void CheckCustomColumnTypesCore(
RoleMappedSchema
schema)
76
private Func<int, bool> GetActiveCols(
RoleMappedSchema
schema)
91
private protected virtual Func<int, bool> GetActiveColsCore(
RoleMappedSchema
schema)
102
private TAgg GetAggregator(
RoleMappedSchema
schema)
110
private AggregatorDictionaryBase[] GetAggregatorDictionaries(
RoleMappedSchema
schema)
124
private protected abstract TAgg GetAggregatorCore(
RoleMappedSchema
schema, string stratName);
130
private Dictionary<string, IDataView> ProcessData(IDataView data,
RoleMappedSchema
schema,
231
/// information is stored in the given <see cref="
RoleMappedSchema
"/>.
269
internal abstract void InitializeNextPass(DataViewRow row,
RoleMappedSchema
schema);
342
private protected readonly
RoleMappedSchema
Schema;
348
private protected AggregatorDictionaryBase(
RoleMappedSchema
schema, string stratCol, Func<string, TAgg> createAgg)
364
internal static AggregatorDictionaryBase Create(
RoleMappedSchema
schema, string stratCol, DataViewType stratType,
378
private static AggregatorDictionaryBase CreateDictionary<TStrat>(
RoleMappedSchema
schema, string stratCol,
406
public GenericAggregatorDictionary(
RoleMappedSchema
schema, string stratCol, DataViewType stratType, Func<string, TAgg> createAgg)
464
private protected abstract IRowMapper CreatePerInstanceRowMapper(
RoleMappedSchema
schema);
Evaluators\MamlEvaluator.cs (14)
77
internal static
RoleMappedSchema
.ColumnRole Strat = "Strat";
114
private protected IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> GetInputColumnRoles(
RoleMappedSchema
schema, bool needStrat = false, bool needName = false)
119
? Enumerable.Empty<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>>()
120
: StratCols.Select(col =>
RoleMappedSchema
.CreatePair(Strat, col));
123
roles = AnnotationUtils.Prepend(roles,
RoleMappedSchema
.ColumnRole.Name.Bind(schema.Name.Value.Name));
134
private protected virtual IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> GetInputColumnRolesCore(
RoleMappedSchema
schema)
139
yield return
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.Score, scoreCol.Name);
143
yield return
RoleMappedSchema
.ColumnRole.Label.Bind(label);
147
yield return
RoleMappedSchema
.ColumnRole.Weight.Bind(weight);
222
var
schema = scoredData.Schema;
276
private protected virtual IDataView GetPerInstanceMetricsCore(IDataView perInst,
RoleMappedSchema
schema)
294
private protected abstract IEnumerable<string> GetPerInstanceColumnsToSave(
RoleMappedSchema
schema);
Evaluators\MulticlassClassificationEvaluator.cs (10)
75
private protected override void CheckScoreAndLabelTypes(
RoleMappedSchema
schema)
87
private protected override Aggregator GetAggregatorCore(
RoleMappedSchema
schema, string stratName)
96
private ReadOnlyMemory<char>[] GetClassNames(
RoleMappedSchema
schema)
120
private protected override IRowMapper CreatePerInstanceRowMapper(
RoleMappedSchema
schema)
412
internal override void InitializeNextPass(DataViewRow row,
RoleMappedSchema
schema)
558
RoleMappedSchema
.ColumnRole.Label.Bind(label),
559
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.Score, score),
560
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.PredictedLabel, predictedLabel));
1036
private protected override IEnumerable<string> GetPerInstanceColumnsToSave(
RoleMappedSchema
schema)
1052
private protected override IDataView GetPerInstanceMetricsCore(IDataView perInst,
RoleMappedSchema
schema)
Evaluators\MultiOutputRegressionEvaluator.cs (5)
50
private protected override IRowMapper CreatePerInstanceRowMapper(
RoleMappedSchema
schema)
58
private protected override void CheckScoreAndLabelTypes(
RoleMappedSchema
schema)
70
private protected override Aggregator GetAggregatorCore(
RoleMappedSchema
schema, string stratName)
302
internal override void InitializeNextPass(DataViewRow row,
RoleMappedSchema
schema)
640
private protected override IEnumerable<string> GetPerInstanceColumnsToSave(
RoleMappedSchema
schema)
Evaluators\QuantileRegressionEvaluator.cs (4)
42
private protected override IRowMapper CreatePerInstanceRowMapper(
RoleMappedSchema
schema)
56
private protected override void CheckScoreAndLabelTypes(
RoleMappedSchema
schema)
68
private protected override Aggregator GetAggregatorCore(
RoleMappedSchema
schema, string stratName)
539
private protected override IEnumerable<string> GetPerInstanceColumnsToSave(
RoleMappedSchema
schema)
Evaluators\RankingEvaluator.cs (12)
96
private protected override void CheckScoreAndLabelTypes(
RoleMappedSchema
schema)
112
private protected override void CheckCustomColumnTypesCore(
RoleMappedSchema
schema)
123
private protected override Func<int, bool> GetActiveColsCore(
RoleMappedSchema
schema)
129
private protected override Aggregator GetAggregatorCore(
RoleMappedSchema
schema, string stratName)
260
RoleMappedSchema
.ColumnRole.Label.Bind(label),
261
RoleMappedSchema
.ColumnRole.Group.Bind(groupId),
262
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.Score, score));
452
internal override void InitializeNextPass(DataViewRow row,
RoleMappedSchema
schema)
893
private protected override IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> GetInputColumnRolesCore(
RoleMappedSchema
schema)
897
return cols.Prepend(
RoleMappedSchema
.ColumnRole.Group.Bind(groupIdCol));
940
private protected override IEnumerable<string> GetPerInstanceColumnsToSave(
RoleMappedSchema
schema)
Evaluators\RegressionEvaluator.cs (6)
55
private protected override void CheckScoreAndLabelTypes(
RoleMappedSchema
schema)
67
private protected override Aggregator GetAggregatorCore(
RoleMappedSchema
schema, string stratName)
72
private protected override IRowMapper CreatePerInstanceRowMapper(
RoleMappedSchema
schema)
180
RoleMappedSchema
.ColumnRole.Label.Bind(label),
181
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.Score, score));
361
private protected override IEnumerable<string> GetPerInstanceColumnsToSave(
RoleMappedSchema
schema)
Evaluators\RegressionEvaluatorBase.cs (1)
200
internal override void InitializeNextPass(DataViewRow row,
RoleMappedSchema
schema)
Model\Onnx\ICanSaveOnnx.cs (1)
67
bool SaveAsOnnx(OnnxContext ctx,
RoleMappedSchema
schema, string[] outputNames);
Model\Pfa\ICanSavePfa.cs (1)
71
void SaveAsPfa(BoundPfaContext ctx,
RoleMappedSchema
schema, string[] outputNames);
Model\Pfa\SavePfaCommand.cs (1)
125
RoleMappedSchema
trainSchema;
Prediction\Calibrator.cs (12)
225
void ICanSaveInIniFormat.SaveAsIni(TextWriter writer,
RoleMappedSchema
schema, ICalibrator calibrator)
232
void ICanSaveInTextFormat.SaveAsText(TextWriter writer,
RoleMappedSchema
schema)
240
void ICanSaveInSourceCode.SaveAsCode(TextWriter writer,
RoleMappedSchema
schema)
248
void ICanSaveSummary.SaveSummary(TextWriter writer,
RoleMappedSchema
schema)
257
IList<KeyValuePair<string, object>> ICanGetSummaryInKeyValuePairs.GetSummaryInKeyValuePairs(
RoleMappedSchema
schema)
655
public
RoleMappedSchema
InputRoleMappedSchema => _predictor.InputRoleMappedSchema;
659
public Bound(IHostEnvironment env, SchemaBindableCalibratedModelParameters<TSubModel, TCalibrator> parent,
RoleMappedSchema
schema)
684
public IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> GetInputColumnRoles()
781
void IBindableCanSavePfa.SaveAsPfa(BoundPfaContext ctx,
RoleMappedSchema
schema, string[] outputs)
791
bool IBindableCanSaveOnnx.SaveAsOnnx(OnnxContext ctx,
RoleMappedSchema
schema, string[] outputs)
800
public ISchemaBoundMapper Bind(IHostEnvironment env,
RoleMappedSchema
schema)
845
ITrainer trainer, IPredictor predictor,
RoleMappedSchema
schema)
Scorers\BinaryClassifierScorer.cs (3)
55
private static ISchemaBoundMapper WrapIfNeeded(IHostEnvironment env, ISchemaBoundMapper mapper,
RoleMappedSchema
trainSchema)
105
private static ISchemaBoundMapper WrapCore<T>(IHostEnvironment env, ISchemaBoundMapper mapper,
RoleMappedSchema
trainSchema)
126
internal BinaryClassifierScorer(IHostEnvironment env, Arguments args, IDataView data, ISchemaBoundMapper mapper,
RoleMappedSchema
trainSchema)
Scorers\ClusteringScorer.cs (1)
45
internal ClusteringScorer(IHostEnvironment env, Arguments args, IDataView data, ISchemaBoundMapper mapper,
RoleMappedSchema
trainSchema)
Scorers\FeatureContributionCalculation.cs (7)
56
private static IDataScorerTransform Create(IHostEnvironment env, Arguments args, IDataView data, ISchemaBoundMapper mapper,
RoleMappedSchema
trainSchema)
162
public ISchemaBoundMapper Bind(IHostEnvironment env,
RoleMappedSchema
schema)
281
private static void CheckSchemaValid(IExceptionContext ectx,
RoleMappedSchema
schema,
304
public
RoleMappedSchema
InputRoleMappedSchema { get; }
313
public RowMapper(IHostEnvironment env, BindableMapper parent,
RoleMappedSchema
schema)
388
public IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> GetInputColumnRoles()
390
yield return
RoleMappedSchema
.ColumnRole.Feature.Bind(FeatureColumn.Name);
Scorers\GenericScorer.cs (4)
66
IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> roles, string suffix, bool user = true)
154
ISchemaBoundMapper mapper,
RoleMappedSchema
trainSchema)
216
var
schema = _bindings.RowMapper.InputRoleMappedSchema;
231
var
schema = _bindings.RowMapper.InputRoleMappedSchema;
Scorers\MulticlassClassificationScorer.cs (8)
211
void IBindableCanSavePfa.SaveAsPfa(BoundPfaContext ctx,
RoleMappedSchema
schema, string[] outputNames)
220
bool IBindableCanSaveOnnx.SaveAsOnnx(OnnxContext ctx,
RoleMappedSchema
schema, string[] outputNames)
229
ISchemaBoundMapper ISchemaBindableMapper.Bind(IHostEnvironment env,
RoleMappedSchema
schema)
264
public
RoleMappedSchema
InputRoleMappedSchema => _mapper.InputRoleMappedSchema;
344
public IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> GetInputColumnRoles() => _mapper.GetInputColumnRoles();
405
private static ISchemaBoundMapper WrapIfNeeded(IHostEnvironment env, ISchemaBoundMapper mapper,
RoleMappedSchema
trainSchema)
485
internal static ISchemaBoundMapper WrapCore<T>(IHostEnvironment env, ISchemaBoundMapper mapper,
RoleMappedSchema
trainSchema)
512
internal MulticlassClassificationScorer(IHostEnvironment env, Arguments args, IDataView data, ISchemaBoundMapper mapper,
RoleMappedSchema
trainSchema)
Scorers\PredictedLabelScorerBase.cs (4)
112
var
schema = new RoleMappedSchema(input, RowMapper.GetInputColumnRoles());
283
ISchemaBoundMapper mapper,
RoleMappedSchema
trainSchema, string registrationName, string scoreColKind, string scoreColName,
342
var
schema = Bindings.RowMapper.InputRoleMappedSchema;
375
var
schema = Bindings.RowMapper.InputRoleMappedSchema;
Scorers\PredictionTransformer.cs (6)
306
var
schema = new RoleMappedSchema(TrainSchema, null, FeatureColumnName);
348
var
schema = new RoleMappedSchema(TrainSchema, null, FeatureColumnName);
440
var
schema = new RoleMappedSchema(TrainSchema, LabelColumnName, FeatureColumnName);
532
var
schema = new RoleMappedSchema(TrainSchema, _trainLabelColumn, FeatureColumnName);
674
var
schema = new RoleMappedSchema(inputSchema, null, featureColumn);
686
var
schema = new RoleMappedSchema(TrainSchema, null, FeatureColumnName);
Scorers\QuantileRegressionScorer.cs (1)
32
private static IDataScorerTransform Create(IHostEnvironment env, Arguments args, IDataView data, ISchemaBoundMapper mapper,
RoleMappedSchema
trainSchema)
Scorers\RowToRowScorerBase.cs (3)
380
protected static KeyValuePair<
RoleMappedSchema
.ColumnRole, string>[] LoadBaseInfo(
394
var columns = new KeyValuePair<
RoleMappedSchema
.ColumnRole, string>[count];
399
columns[i] =
RoleMappedSchema
.CreatePair(role, name);
Scorers\SchemaBindablePredictorWrapper.cs (23)
94
void IBindableCanSavePfa.SaveAsPfa(BoundPfaContext ctx,
RoleMappedSchema
schema, string[] outputNames)
103
private protected virtual void SaveAsPfaCore(BoundPfaContext ctx,
RoleMappedSchema
schema, string[] outputNames)
108
bool IBindableCanSaveOnnx.SaveAsOnnx(OnnxContext ctx,
RoleMappedSchema
schema, string[] outputNames)
118
private protected virtual bool SaveAsOnnxCore(OnnxContext ctx,
RoleMappedSchema
schema, string[] outputNames) => false;
120
ISchemaBoundMapper ISchemaBindableMapper.Bind(IHostEnvironment env,
RoleMappedSchema
schema)
155
private protected abstract ISchemaBoundMapper BindCore(IChannel ch,
RoleMappedSchema
schema);
182
void ICanSaveSummary.SaveSummary(TextWriter writer,
RoleMappedSchema
schema)
201
public
RoleMappedSchema
InputRoleMappedSchema { get; }
205
public SingleValueRowMapper(
RoleMappedSchema
schema, SchemaBindablePredictorWrapperBase parent, DataViewSchema outputSchema)
228
public IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> GetInputColumnRoles()
230
yield return
RoleMappedSchema
.ColumnRole.Feature.Bind(InputRoleMappedSchema.Feature.Value.Name);
324
private protected override void SaveAsPfaCore(BoundPfaContext ctx,
RoleMappedSchema
schema, string[] outputNames)
340
private protected override bool SaveAsOnnxCore(OnnxContext ctx,
RoleMappedSchema
schema, string[] outputNames)
355
private protected override ISchemaBoundMapper BindCore(IChannel ch,
RoleMappedSchema
schema) =>
431
private protected override void SaveAsPfaCore(BoundPfaContext ctx,
RoleMappedSchema
schema, string[] outputNames)
451
private protected override bool SaveAsOnnxCore(OnnxContext ctx,
RoleMappedSchema
schema, string[] outputNames)
492
private protected override ISchemaBoundMapper BindCore(IChannel ch,
RoleMappedSchema
schema)
510
public
RoleMappedSchema
InputRoleMappedSchema { get; }
517
public CalibratedRowMapper(
RoleMappedSchema
schema, SchemaBindableBinaryPredictorWrapper parent)
548
public IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> GetInputColumnRoles()
550
yield return (InputRoleMappedSchema.Feature.HasValue) ?
RoleMappedSchema
.ColumnRole.Feature.Bind(InputRoleMappedSchema.Feature?.Name) :
RoleMappedSchema
.ColumnRole.Label.Bind(InputRoleMappedSchema.Label?.Name);
695
private protected override ISchemaBoundMapper BindCore(IChannel ch,
RoleMappedSchema
schema) =>
Training\TrainerUtils.cs (5)
262
public static ValueGetter<VBuffer<float>> GetFeatureFloatVectorGetter(this DataViewRow row,
RoleMappedSchema
schema)
285
public static ValueGetter<float> GetLabelFloatGetter(this DataViewRow row,
RoleMappedSchema
schema)
308
public static ValueGetter<float> GetOptWeightFloatGetter(this DataViewRow row,
RoleMappedSchema
schema)
329
public static ValueGetter<ulong> GetOptGroupGetter(this DataViewRow row,
RoleMappedSchema
schema)
427
var
tschema = context.TrainingSet.Schema;
Transforms\TrainAndScoreTransformer.cs (3)
42
public IComponentFactory<IDataView, ISchemaBoundMapper,
RoleMappedSchema
, IDataScorerTransform> Scorer;
84
RoleMappedSchema
trainSchema = null;
159
public IComponentFactory<IDataView, ISchemaBoundMapper,
RoleMappedSchema
, IDataScorerTransform> Scorer;
Utilities\ComponentCreation.cs (4)
48
string group = null, string weight = null, IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> custom = null)
156
RoleMappedData data, IPredictor predictor,
RoleMappedSchema
trainSchema = null)
163
Type factoryType = typeof(IComponentFactory<IDataView, ISchemaBoundMapper,
RoleMappedSchema
, IDataScorerTransform>);
187
IPredictor predictor,
RoleMappedSchema
trainSchema = null)
Utilities\ModelFileUtils.cs (6)
17
using ColumnRole =
RoleMappedSchema
.ColumnRole;
231
internal static void SaveRoleMappings(IHostEnvironment env, IChannel ch,
RoleMappedSchema
schema, RepositoryWriter rep)
325
/// Returns the <see cref="
RoleMappedSchema
"/> from a model stream, or <c>null</c> if there were no
328
public static
RoleMappedSchema
LoadRoleMappedSchemaOrNull(IHostEnvironment env, Stream modelStream)
339
/// Returns the <see cref="
RoleMappedSchema
"/> from a repository, or <c>null</c> if there were no
342
public static
RoleMappedSchema
LoadRoleMappedSchemaOrNull(IHostEnvironment env, RepositoryReader rep)
Microsoft.ML.Ensemble (23)
PipelineEnsemble.cs (9)
42
public
RoleMappedSchema
InputRoleMappedSchema { get; }
46
public BoundBase(SchemaBindablePipelineEnsembleBase parent,
RoleMappedSchema
schema)
103
public IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> GetInputColumnRoles()
124
public Bound(SchemaBindablePipelineEnsemble<T> parent,
RoleMappedSchema
schema)
225
private protected override ISchemaBoundMapper BindCore(IHostEnvironment env,
RoleMappedSchema
schema)
565
ISchemaBoundMapper ISchemaBindableMapper.Bind(IHostEnvironment env,
RoleMappedSchema
schema) => BindCore(env, schema);
567
private protected abstract ISchemaBoundMapper BindCore(IHostEnvironment env,
RoleMappedSchema
schema);
569
void ICanSaveSummary.SaveSummary(TextWriter writer,
RoleMappedSchema
schema)
701
IList<KeyValuePair<string, object>> ICanGetSummaryInKeyValuePairs.GetSummaryInKeyValuePairs(
RoleMappedSchema
schema)
Selector\SubModelSelector\BaseSubModelSelector.cs (12)
102
private IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> GetColumnRoles(
103
RoleMappedSchema
testSchema, DataViewSchema scoredSchema)
108
yield return
RoleMappedSchema
.CreatePair(
RoleMappedSchema
.ColumnRole.Label, testSchema.Label.Value.Name);
111
yield return
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.Score, scoreCol.Name);
116
yield return
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.Probability, probCol.Value.Name);
119
yield return
RoleMappedSchema
.CreatePair(
RoleMappedSchema
.ColumnRole.Label, testSchema.Label.Value.Name);
122
yield return
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.Score, scoreCol.Name);
125
yield return
RoleMappedSchema
.CreatePair(
RoleMappedSchema
.ColumnRole.Label, testSchema.Label.Value.Name);
128
yield return
RoleMappedSchema
.CreatePair(AnnotationUtils.Const.ScoreValueKind.Score, scoreCol.Name);
Trainer\EnsembleModelParametersBase.cs (2)
130
void ICanSaveInTextFormat.SaveAsText(TextWriter writer,
RoleMappedSchema
schema)
146
void ICanSaveSummary.SaveSummary(TextWriter writer,
RoleMappedSchema
schema)
Microsoft.ML.EntryPoints (18)
CrossValidationMacro.cs (4)
366
RoleMappedSchema
.ColumnRole.Label.Bind(input.LabelColumn),
367
RoleMappedSchema
.ColumnRole.Weight.Bind(input.WeightColumn.Value),
368
RoleMappedSchema
.ColumnRole.Group.Bind(input.GroupColumn),
369
RoleMappedSchema
.ColumnRole.Name.Bind(input.NameColumn.Value))).ToArray(),
FeatureCombiner.cs (4)
28
internal IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> GetRoles()
33
yield return
RoleMappedSchema
.ColumnRole.Feature.Bind(col);
55
var
rms = new RoleMappedSchema(viewTrain.Schema, input.GetRoles());
56
var feats = rms.GetColumns(
RoleMappedSchema
.ColumnRole.Feature);
PermutationFeatureImportance.cs (10)
91
var featureColumnName = roles.Where(x => x.Key.Value ==
RoleMappedSchema
.ColumnRole.Feature.Value).First().Value;
92
var labelColumnName = roles.Where(x => x.Key.Value ==
RoleMappedSchema
.ColumnRole.Label.Value).First().Value;
148
var featureColumnName = roles.Where(x => x.Key.Value ==
RoleMappedSchema
.ColumnRole.Feature.Value).First().Value;
149
var labelColumnName = roles.Where(x => x.Key.Value ==
RoleMappedSchema
.ColumnRole.Label.Value).First().Value;
207
var featureColumnName = roles.Where(x => x.Key.Value ==
RoleMappedSchema
.ColumnRole.Feature.Value).First().Value;
208
var labelColumnName = roles.Where(x => x.Key.Value ==
RoleMappedSchema
.ColumnRole.Label.Value).First().Value;
259
var featureColumnName = roles.Where(x => x.Key.Value ==
RoleMappedSchema
.ColumnRole.Feature.Value).First().Value;
260
var labelColumnName = roles.Where(x => x.Key.Value ==
RoleMappedSchema
.ColumnRole.Label.Value).First().Value;
261
var groupIdColumnName = roles.Where(x => x.Key.Value ==
RoleMappedSchema
.ColumnRole.Group.Value).First().Value;
307
private static string[] GetSlotNames(
RoleMappedSchema
schema)
Microsoft.ML.FastTree (36)
FastTree.cs (11)
2962
void ICanSaveInSourceCode.SaveAsCode(TextWriter writer,
RoleMappedSchema
schema)
2971
void ICanSaveInTextFormat.SaveAsText(TextWriter writer,
RoleMappedSchema
schema)
2981
void ICanSaveInIniFormat.SaveAsIni(TextWriter writer,
RoleMappedSchema
schema, ICalibrator calibrator)
3134
void ICanSaveSummary.SaveSummary(TextWriter writer,
RoleMappedSchema
schema)
3146
private IEnumerable<KeyValuePair<string, double>> GetSortedFeatureGains(
RoleMappedSchema
schema)
3151
AnnotationUtils.GetSlotNames(schema,
RoleMappedSchema
.ColumnRole.Feature, NumFeatures, ref names);
3165
IList<KeyValuePair<string, object>> ICanGetSummaryInKeyValuePairs.GetSummaryInKeyValuePairs(
RoleMappedSchema
schema)
3178
private void SaveEnsembleAsCode(TextWriter writer,
RoleMappedSchema
schema)
3183
AnnotationUtils.GetSlotNames(schema,
RoleMappedSchema
.ColumnRole.Feature, NumFeatures, ref names);
3394
IDataView ICanGetSummaryAsIDataView.GetSummaryDataView(
RoleMappedSchema
schema)
3440
IDataView ICanGetSummaryAsIDataView.GetSummaryDataView(
RoleMappedSchema
schema)
GamModelParameters.cs (8)
356
void ICanSaveInTextFormat.SaveAsText(TextWriter writer,
RoleMappedSchema
schema)
373
AnnotationUtils.GetSlotNames(schema,
RoleMappedSchema
.ColumnRole.Feature, _numInputFeatures, ref names);
397
void ICanSaveSummary.SaveSummary(TextWriter writer,
RoleMappedSchema
schema)
436
void ICanSaveInIniFormat.SaveAsIni(TextWriter writer,
RoleMappedSchema
schema, ICalibrator calibrator)
633
var
schema = _data.Schema;
683
RoleMappedSchema
.ColumnRole.Label.Bind(DefaultColumnNames.Label),
684
new
RoleMappedSchema
.ColumnRole(AnnotationUtils.Const.ScoreValueKind.Score).Bind(DefaultColumnNames.Score));
873
RoleMappedSchema
schema;
TreeEnsemble\InternalTreeEnsemble.cs (2)
421
/// A class that given either a <see cref="
RoleMappedSchema
"/>
437
public FeaturesToContentMap(
RoleMappedSchema
schema)
TreeEnsembleFeaturizationTransformer.cs (7)
59
/// Create <see cref="
RoleMappedSchema
"/> from <paramref name="schema"/> by using <see cref="_featureDetachedColumn"/> as the feature role.
62
private
RoleMappedSchema
MakeFeatureRoleMappedSchema(DataViewSchema schema)
64
var roles = new List<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>>();
65
roles.Add(new KeyValuePair<
RoleMappedSchema
.ColumnRole, string>(
RoleMappedSchema
.ColumnRole.Feature, _featureDetachedColumn.Name));
100
var
roleMappedSchema = MakeFeatureRoleMappedSchema(inputSchema);
134
var
roleMappedSchema = MakeFeatureRoleMappedSchema(TrainSchema);
TreeEnsembleFeaturizer.cs (7)
69
public
RoleMappedSchema
InputRoleMappedSchema { get; }
104
public BoundMapper(IExceptionContext ectx, TreeEnsembleFeaturizerBindableMapper owner,
RoleMappedSchema
schema,
357
public IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> GetInputColumnRoles()
359
yield return
RoleMappedSchema
.ColumnRole.Feature.Bind(FeatureColumn.Name);
522
ISchemaBoundMapper ISchemaBindableMapper.Bind(IHostEnvironment env,
RoleMappedSchema
schema)
589
TreeEnsembleFeaturizerBindableMapper.Arguments args, IDataView data, ISchemaBoundMapper mapper,
RoleMappedSchema
trainSchema)
676
trainScoreArgs.Scorer = ComponentFactoryUtils.CreateFromFunction<IDataView, ISchemaBoundMapper,
RoleMappedSchema
, IDataScorerTransform>(
Utils\FastTreeIniFileUtils.cs (1)
16
IHost host, InternalTreeEnsemble ensemble,
RoleMappedSchema
schema, ICalibrator calibrator,
Microsoft.ML.KMeansClustering (1)
KMeansModelParameters.cs (1)
178
void ICanSaveInTextFormat.SaveAsText(TextWriter writer,
RoleMappedSchema
schema)
Microsoft.ML.Mkl.Components (2)
OlsLinearRegression.cs (2)
899
private protected override void SaveSummary(TextWriter writer,
RoleMappedSchema
schema)
902
AnnotationUtils.GetSlotNames(schema,
RoleMappedSchema
.ColumnRole.Feature, Weight.Length, ref names);
Microsoft.ML.OnnxConverter (1)
SaveOnnxCommand.cs (1)
296
RoleMappedSchema
trainSchema = null;
Microsoft.ML.PCA (3)
PcaTrainer.cs (3)
555
void ICanSaveSummary.SaveSummary(TextWriter writer,
RoleMappedSchema
schema)
560
void ICanSaveInTextFormat.SaveAsText(TextWriter writer,
RoleMappedSchema
schema)
587
IDataView ICanGetSummaryAsIDataView.GetSummaryDataView(
RoleMappedSchema
schema)
Microsoft.ML.Predictor.Tests (10)
TestIniModels.cs (10)
535
var
roleMappedSchema = new RoleMappedSchema(data.Schema, false,
536
new KeyValuePair<
RoleMappedSchema
.ColumnRole, string>(
RoleMappedSchema
.ColumnRole.Feature, "Features"),
537
new KeyValuePair<
RoleMappedSchema
.ColumnRole, string>(
RoleMappedSchema
.ColumnRole.Label, "Label"));
574
var
roleMappedSchema = new RoleMappedSchema(data.Schema, false,
575
new KeyValuePair<
RoleMappedSchema
.ColumnRole, string>(
RoleMappedSchema
.ColumnRole.Feature, "Features"),
576
new KeyValuePair<
RoleMappedSchema
.ColumnRole, string>(
RoleMappedSchema
.ColumnRole.Label, "Label"));
Microsoft.ML.Recommender (20)
MatrixFactorizationPredictor.cs (12)
193
void ICanSaveInTextFormat.SaveAsText(TextWriter writer,
RoleMappedSchema
schema)
313
ISchemaBoundMapper ISchemaBindableMapper.Bind(IHostEnvironment env,
RoleMappedSchema
schema)
333
public
RoleMappedSchema
InputRoleMappedSchema { get; }
335
public RowMapper(IHostEnvironment env, MatrixFactorizationModelParameters parent,
RoleMappedSchema
schema, DataViewSchema outputSchema)
373
public IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> GetInputColumnRoles()
464
var
schema = GetSchema();
469
private
RoleMappedSchema
GetSchema()
471
var roles = new List<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>>();
472
roles.Add(new KeyValuePair<
RoleMappedSchema
.ColumnRole, string>(RecommenderUtils.MatrixColumnIndexKind, MatrixColumnIndexColumnName));
473
roles.Add(new KeyValuePair<
RoleMappedSchema
.ColumnRole, string>(RecommenderUtils.MatrixRowIndexKind, MatrixRowIndexColumnName));
474
var
schema = new RoleMappedSchema(TrainSchema, roles);
503
var
schema = GetSchema();
MatrixFactorizationTrainer.cs (5)
529
var roles = new List<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>>();
530
roles.Add(new KeyValuePair<
RoleMappedSchema
.ColumnRole, string>(
RoleMappedSchema
.ColumnRole.Label, LabelName));
531
roles.Add(new KeyValuePair<
RoleMappedSchema
.ColumnRole, string>(RecommenderUtils.MatrixColumnIndexKind.Value, MatrixColumnIndexName));
532
roles.Add(new KeyValuePair<
RoleMappedSchema
.ColumnRole, string>(RecommenderUtils.MatrixRowIndexKind.Value, MatrixRowIndexName));
RecommenderUtils.cs (3)
48
private static KeyDataViewType CheckRowColumnType(RoleMappedData data,
RoleMappedSchema
.ColumnRole role, out DataViewSchema.Column col, bool isDecode)
79
public static
RoleMappedSchema
.ColumnRole MatrixColumnIndexKind => "MatrixColumnIndex";
84
public static
RoleMappedSchema
.ColumnRole MatrixRowIndexKind => "MatrixRowIndex";
Microsoft.ML.StandardTrainers (74)
FactorizationMachine\FactorizationMachineTrainer.cs (10)
362
var featureColumns = data.Schema.GetColumns(
RoleMappedSchema
.ColumnRole.Feature);
415
var featureColumns = data.Schema.GetColumns(
RoleMappedSchema
.ColumnRole.Feature);
440
var validFeatureColumns = data.Schema.GetColumns(
RoleMappedSchema
.ColumnRole.Feature);
593
var roles = new List<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>>();
595
roles.Add(new KeyValuePair<
RoleMappedSchema
.ColumnRole, string>(
RoleMappedSchema
.ColumnRole.Feature, feat.Name));
597
roles.Add(new KeyValuePair<
RoleMappedSchema
.ColumnRole, string>(
RoleMappedSchema
.ColumnRole.Label, LabelColumn.Name));
600
roles.Add(new KeyValuePair<
RoleMappedSchema
.ColumnRole, string>(
RoleMappedSchema
.ColumnRole.Feature, WeightColumn.Name));
FactorizationMachine\FieldAwareFactorizationMachineModelParameters.cs (8)
239
ISchemaBoundMapper ISchemaBindableMapper.Bind(IHostEnvironment env,
RoleMappedSchema
schema)
327
var
schema = GetSchema();
362
var
schema = GetSchema();
421
private
RoleMappedSchema
GetSchema()
423
var roles = new List<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>>();
425
roles.Add(new KeyValuePair<
RoleMappedSchema
.ColumnRole, string>(
RoleMappedSchema
.ColumnRole.Feature, feat));
427
var
schema = new RoleMappedSchema(TrainSchema, roles);
FactorizationMachine\FieldAwareFactorizationMachineUtils.cs (7)
61
public
RoleMappedSchema
InputRoleMappedSchema { get; }
73
public FieldAwareFactorizationMachineScalarRowMapper(IHostEnvironment env,
RoleMappedSchema
schema,
84
_columns = schema.GetColumns(
RoleMappedSchema
.ColumnRole.Feature).ToArray();
87
var inputFeatureColumns = _columns.Select(c => new KeyValuePair<
RoleMappedSchema
.ColumnRole, string>(
RoleMappedSchema
.ColumnRole.Feature, c.Name)).ToList();
151
public IEnumerable<KeyValuePair<
RoleMappedSchema
.ColumnRole, string>> GetInputColumnRoles()
153
return InputRoleMappedSchema.GetColumnRoles().Select(kvp => new KeyValuePair<
RoleMappedSchema
.ColumnRole, string>(kvp.Key, kvp.Value.Name));
Standard\LinearModelParameters.cs (20)
352
void ICanSaveInTextFormat.SaveAsText(TextWriter writer,
RoleMappedSchema
schema)
360
void ICanSaveInSourceCode.SaveAsCode(TextWriter writer,
RoleMappedSchema
schema)
370
private protected abstract void SaveSummary(TextWriter writer,
RoleMappedSchema
schema);
372
void ICanSaveSummary.SaveSummary(TextWriter writer,
RoleMappedSchema
schema) => SaveSummary(writer, schema);
374
private protected virtual DataViewRow GetSummaryIRowOrNull(
RoleMappedSchema
schema)
377
AnnotationUtils.GetSlotNames(schema,
RoleMappedSchema
.ColumnRole.Feature, Weight.Length, ref names);
387
DataViewRow ICanGetSummaryAsIRow.GetSummaryIRowOrNull(
RoleMappedSchema
schema) => GetSummaryIRowOrNull(schema);
389
private protected virtual DataViewRow GetStatsIRowOrNull(
RoleMappedSchema
schema) => null;
391
DataViewRow ICanGetSummaryAsIRow.GetStatsIRowOrNull(
RoleMappedSchema
schema) => GetStatsIRowOrNull(schema);
393
private protected abstract void SaveAsIni(TextWriter writer,
RoleMappedSchema
schema, ICalibrator calibrator = null);
395
void ICanSaveInIniFormat.SaveAsIni(TextWriter writer,
RoleMappedSchema
schema, ICalibrator calibrator) => SaveAsIni(writer, schema, calibrator);
523
private protected override void SaveSummary(TextWriter writer,
RoleMappedSchema
schema)
536
IList<KeyValuePair<string, object>> ICanGetSummaryInKeyValuePairs.GetSummaryInKeyValuePairs(
RoleMappedSchema
schema)
547
private protected override DataViewRow GetStatsIRowOrNull(
RoleMappedSchema
schema)
552
AnnotationUtils.GetSlotNames(schema,
RoleMappedSchema
.ColumnRole.Feature, Weight.Length, ref names);
557
private protected override void SaveAsIni(TextWriter writer,
RoleMappedSchema
schema, ICalibrator calibrator = null)
591
private protected override void SaveAsIni(TextWriter writer,
RoleMappedSchema
schema, ICalibrator calibrator)
658
private protected override void SaveSummary(TextWriter writer,
RoleMappedSchema
schema)
681
IList<KeyValuePair<string, object>> ICanGetSummaryInKeyValuePairs.GetSummaryInKeyValuePairs(
RoleMappedSchema
schema)
759
private protected override void SaveSummary(TextWriter writer,
RoleMappedSchema
schema)
Standard\LinearPredictorUtils.cs (7)
32
RoleMappedSchema
schema, string codeVariable = "output")
38
AnnotationUtils.GetSlotNames(schema,
RoleMappedSchema
.ColumnRole.Feature, weights.Length, ref featureNames);
97
RoleMappedSchema
schema = null, PlattCalibrator calibrator = null)
106
AnnotationUtils.GetSlotNames(schema,
RoleMappedSchema
.ColumnRole.Feature, weights.Length, ref featureNames);
179
RoleMappedSchema
schema = null, PlattCalibrator calibrator = null)
229
in VBuffer<float> weights, float bias,
RoleMappedSchema
schema, List<KeyValuePair<string, object>> results)
232
AnnotationUtils.GetSlotNames(schema,
RoleMappedSchema
.ColumnRole.Feature, weights.Length, ref names);
Standard\LogisticRegression\MulticlassLogisticRegression.cs (16)
832
IList<KeyValuePair<string, object>> ICanGetSummaryInKeyValuePairs.GetSummaryInKeyValuePairs(
RoleMappedSchema
schema)
839
AnnotationUtils.GetSlotNames(schema,
RoleMappedSchema
.ColumnRole.Feature, NumberOfFeatures, ref names);
870
/// Actual implementation of <see cref="ICanSaveInTextFormat.SaveAsText(TextWriter,
RoleMappedSchema
)"/> should happen in derived classes.
872
private void SaveAsTextCore(TextWriter writer,
RoleMappedSchema
schema)
889
/// Redirect <see cref="ICanSaveInTextFormat.SaveAsText(TextWriter,
RoleMappedSchema
)"/> call to the right function.
891
void ICanSaveInTextFormat.SaveAsText(TextWriter writer,
RoleMappedSchema
schema) => SaveAsTextCore(writer, schema);
896
void ICanSaveSummary.SaveSummary(TextWriter writer,
RoleMappedSchema
schema)
902
/// Actual implementation of <see cref="ICanSaveInSourceCode.SaveAsCode(TextWriter,
RoleMappedSchema
)"/> should happen in derived classes.
904
private void SaveAsCodeCore(TextWriter writer,
RoleMappedSchema
schema)
928
/// Redirect <see cref="ICanSaveInSourceCode.SaveAsCode(TextWriter,
RoleMappedSchema
)"/> call to the right function.
930
void ICanSaveInSourceCode.SaveAsCode(TextWriter writer,
RoleMappedSchema
schema) => SaveAsCodeCore(writer, schema);
1094
IDataView ICanGetSummaryAsIDataView.GetSummaryDataView(
RoleMappedSchema
schema)
1100
AnnotationUtils.GetSlotNames(schema,
RoleMappedSchema
.ColumnRole.Feature, NumberOfFeatures, ref dst);
1109
DataViewRow ICanGetSummaryAsIRow.GetSummaryIRowOrNull(
RoleMappedSchema
schema)
1114
DataViewRow ICanGetSummaryAsIRow.GetStatsIRowOrNull(
RoleMappedSchema
schema)
1120
AnnotationUtils.GetSlotNames(schema,
RoleMappedSchema
.ColumnRole.Feature, Weights.Length, ref names);
Standard\ModelStatistics.cs (2)
181
internal virtual DataViewSchema.Annotations MakeStatisticsMetadata(
RoleMappedSchema
schema, in VBuffer<ReadOnlyMemory<char>> names)
557
internal override DataViewSchema.Annotations MakeStatisticsMetadata(
RoleMappedSchema
schema, in VBuffer<ReadOnlyMemory<char>> names)
Standard\MulticlassClassification\OneVersusAllTrainer.cs (3)
37
using CR =
RoleMappedSchema
.ColumnRole;
456
void ICanSaveInSourceCode.SaveAsCode(TextWriter writer,
RoleMappedSchema
schema)
476
void ICanSaveInTextFormat.SaveAsText(TextWriter writer,
RoleMappedSchema
schema)
Standard\MulticlassClassification\PairwiseCouplingTrainer.cs (1)
26
using CR =
RoleMappedSchema
.ColumnRole;
Microsoft.ML.Tests (1)
TrainerEstimators\TreeEnsembleFeaturizerTest.cs (1)
49
var
roleMappedSchema = new RoleMappedSchema(dataView.Schema,
Microsoft.ML.Transforms (2)
Dracula\CountTableTransformer.cs (2)
135
CheckLabelType(new RoleMappedData(input, roles:
RoleMappedSchema
.CreatePair(
RoleMappedSchema
.ColumnRole.Label, _labelColumnName)), out var labelCardinality);