171 instantiations of SchemaShape
Microsoft.ML.Core (3)
Microsoft.ML.Data (22)
Microsoft.ML.FastTree (14)
FastTreeClassification.cs (3)
316new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
317new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
318new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
GamClassification.cs (3)
187new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
188new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
189new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Microsoft.ML.ImageAnalytics (5)
Microsoft.ML.KMeansClustering (2)
Microsoft.ML.LightGbm (7)
LightGbmBinaryTrainer.cs (3)
286new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
287new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
288new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Microsoft.ML.Mkl.Components (5)
SymSgdClassificationTrainer.cs (3)
276new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
277new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
278new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Microsoft.ML.OnnxTransformer (1)
Microsoft.ML.PCA (3)
Microsoft.ML.Recommender (2)
Microsoft.ML.StandardTrainers (42)
FactorizationMachine\FactorizationMachineTrainer.cs (4)
651return new SchemaShape(outColumns.Values);
661new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
662new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
663new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\LogisticRegression\LogisticRegression.cs (3)
173new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
174new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
175new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\SdcaBinary.cs (16)
1629new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
1635new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
1641new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
1728new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())
1735new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
1786new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())
1793new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
1804new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))));
2303new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
2304new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
2305new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
2392new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
2393new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
2446new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
2447new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
2448new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\Simple\SimpleTrainers.cs (4)
318new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
319new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
320new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
325return new SchemaShape(outColumns.Values);
Microsoft.ML.TensorFlow (1)
Microsoft.ML.TimeSeries (11)
Microsoft.ML.TorchSharp (17)
Microsoft.ML.Transforms (34)
Microsoft.ML.Vision (2)
1048 references to SchemaShape
Microsoft.ML.Core (36)
Data\AnnotationUtils.cs (25)
310public static bool NeedsSlotNames(this SchemaShape.Column col)
313&& metaCol.Kind == SchemaShape.Column.VectorKind.Vector
324public static bool IsNormalized(this SchemaShape.Column column)
328&& metaCol.Kind == SchemaShape.Column.VectorKind.Scalar && !metaCol.IsKey
339public static bool HasSlotNames(this SchemaShape.Column col)
342return col.Kind == SchemaShape.Column.VectorKind.Vector
344&& metaCol.Kind == SchemaShape.Column.VectorKind.Vector && !metaCol.IsKey
425public static IEnumerable<SchemaShape.Column> GetTrainerOutputAnnotation(bool isNormalized = false)
427var cols = new List<SchemaShape.Column>();
428cols.Add(new SchemaShape.Column(Kinds.ScoreColumnSetId, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true));
429cols.Add(new SchemaShape.Column(Kinds.ScoreColumnKind, SchemaShape.Column.VectorKind.Scalar, TextDataViewType.Instance, false));
430cols.Add(new SchemaShape.Column(Kinds.ScoreValueKind, SchemaShape.Column.VectorKind.Scalar, TextDataViewType.Instance, false));
432cols.Add(new SchemaShape.Column(Kinds.IsNormalized, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false));
441public static IEnumerable<SchemaShape.Column> AnnotationsForMulticlassScoreColumn(SchemaShape.Column? labelColumn = null)
443var cols = new List<SchemaShape.Column>();
447metaCol.Kind == SchemaShape.Column.VectorKind.Vector)
450cols.Add(new SchemaShape.Column(Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false));
451cols.Add(new SchemaShape.Column(Kinds.TrainingLabelValues, SchemaShape.Column.VectorKind.Vector, metaCol.ItemType, false));
Microsoft.ML.Data (183)
Training\TrainerUtils.cs (20)
348/// The <see cref="SchemaShape.Column"/> for the label column for binary classification tasks.
351public static SchemaShape.Column MakeBoolScalarLabel(string labelColumn)
352=> new SchemaShape.Column(labelColumn, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false);
355/// The <see cref="SchemaShape.Column"/> for the float type columns.
358public static SchemaShape.Column MakeR4ScalarColumn(string columnName)
359=> new SchemaShape.Column(columnName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false);
362/// The <see cref="SchemaShape.Column"/> for the label column for regression tasks.
365public static SchemaShape.Column MakeU4ScalarColumn(string columnName)
370return new SchemaShape.Column(columnName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true);
374/// The <see cref="SchemaShape.Column"/> for the feature column.
377public static SchemaShape.Column MakeR4VecFeature(string featureColumn)
378=> new SchemaShape.Column(featureColumn, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
381/// The <see cref="SchemaShape.Column"/> for the weight column.
384public static SchemaShape.Column MakeR4ScalarWeightColumn(string weightColumn)
388return new SchemaShape.Column(weightColumn, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false);
Transforms\ColumnConcatenatingEstimator.cs (21)
75private bool HasCategoricals(SchemaShape.Column col)
82return mcol.Kind == SchemaShape.Column.VectorKind.Vector
86private SchemaShape.Column CheckInputsAndMakeColumn(
87SchemaShape inputSchema, string name, string[] sources)
91var cols = new SchemaShape.Column[sources.Length];
122varVector |= col.Kind == SchemaShape.Column.VectorKind.VariableVector;
125hasSlotNames |= col.Kind == SchemaShape.Column.VectorKind.Scalar || col.HasSlotNames();
127var vecKind = varVector ? SchemaShape.Column.VectorKind.VariableVector :
128SchemaShape.Column.VectorKind.Vector;
130List<SchemaShape.Column> meta = new List<SchemaShape.Column>();
132meta.Add(new SchemaShape.Column(AnnotationUtils.Kinds.IsNormalized, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false));
134meta.Add(new SchemaShape.Column(AnnotationUtils.Kinds.CategoricalSlotRanges, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Int32, false));
136meta.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false));
138return new SchemaShape.Column(name, vecKind, itemType, false, new SchemaShape(meta));
142/// Returns the <see cref="SchemaShape"/> of the schema which will be produced by the transformer.
145public SchemaShape GetOutputSchema(SchemaShape inputSchema)
Transforms\KeyToVector.cs (18)
815/// Returns the <see cref="SchemaShape"/> of the schema which will be produced by the transformer.
818public override SchemaShape GetOutputSchema(SchemaShape inputSchema)
829var metadata = new List<SchemaShape.Column>();
831if (((colInfo.OutputCountVector && col.IsKey) || col.Kind != SchemaShape.Column.VectorKind.VariableVector) && keyMeta.ItemType is TextDataViewType)
832metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, keyMeta.ItemType, false));
833if (!colInfo.OutputCountVector && (col.Kind == SchemaShape.Column.VectorKind.Scalar || col.Kind == SchemaShape.Column.VectorKind.Vector))
834metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.CategoricalSlotRanges, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Int32, false));
835if (!colInfo.OutputCountVector || (col.Kind == SchemaShape.Column.VectorKind.Scalar))
836metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.IsNormalized, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false));
838result[colInfo.Name] = new SchemaShape.Column(colInfo.Name,
839col.Kind == SchemaShape.Column.VectorKind.VariableVector && !colInfo.OutputCountVector ? SchemaShape.Column.VectorKind.VariableVector : SchemaShape.Column.VectorKind.Vector,
Transforms\TypeConverting.cs (14)
619/// Returns the <see cref="SchemaShape"/> of the schema which will be produced by the transformer.
622public override SchemaShape GetOutputSchema(SchemaShape inputSchema)
634var metadata = new List<SchemaShape.Column>();
636metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.IsNormalized, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false));
638if (col.Kind == SchemaShape.Column.VectorKind.Vector)
639metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, slotMeta.ItemType, false));
642metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, keyMeta.ItemType, false));
645metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, normMeta.ItemType, false));
646result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, col.Kind, newType, false, col.Annotations);
Microsoft.ML.FastTree (68)
FastTreeClassification.cs (8)
312private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
316new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
317new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
318new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
GamClassification.cs (8)
183private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
187new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
188new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
189new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Microsoft.ML.ImageAnalytics (31)
Microsoft.ML.KMeansClustering (6)
Microsoft.ML.LightGbm (31)
LightGbmBinaryTrainer.cs (9)
249new SchemaShape.Column())
282private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
286new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
287new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
288new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Microsoft.ML.Mkl.Components (16)
SymSgdClassificationTrainer.cs (8)
272private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
276new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
277new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
278new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Microsoft.ML.OnnxTransformer (8)
Microsoft.ML.OnnxTransformerTest (2)
Microsoft.ML.PCA (18)
PcaTrainer.cs (12)
198private static SchemaShape.Column MakeWeightColumn(string weightColumn)
202return new SchemaShape.Column(weightColumn, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false);
205private static SchemaShape.Column MakeFeatureColumn(string featureColumn)
207return new SchemaShape.Column(featureColumn, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
372private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
376new SchemaShape.Column(DefaultColumnNames.Score,
377SchemaShape.Column.VectorKind.Scalar,
382new SchemaShape.Column(DefaultColumnNames.PredictedLabel,
383SchemaShape.Column.VectorKind.Scalar,
Microsoft.ML.Recommender (13)
MatrixFactorizationTrainer.cs (13)
554public SchemaShape GetOutputSchema(SchemaShape inputSchema)
558void CheckColumnsCompatible(SchemaShape.Column cachedColumn, string columnRole)
569var labelColumn = new SchemaShape.Column(LabelName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false);
573var matrixColumnIndexColumn = new SchemaShape.Column(MatrixColumnIndexName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true);
574var matrixRowIndexColumn = new SchemaShape.Column(MatrixRowIndexName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true);
588private SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
595new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
Microsoft.ML.StandardTrainers (181)
FactorizationMachine\FactorizationMachineTrainer.cs (30)
185internal readonly SchemaShape.Column[] FeatureColumns;
191internal readonly SchemaShape.Column LabelColumn;
197internal readonly SchemaShape.Column WeightColumn;
230FeatureColumns = new SchemaShape.Column[1 + extraColumnLength];
233FeatureColumns[0] = new SchemaShape.Column(options.FeatureColumnName, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
237FeatureColumns[i + 1] = new SchemaShape.Column(options.ExtraFeatureColumns[i], SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
239LabelColumn = new SchemaShape.Column(options.LabelColumnName, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false);
240WeightColumn = options.ExampleWeightColumnName != null ? new SchemaShape.Column(options.ExampleWeightColumnName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false) : default;
263FeatureColumns = new SchemaShape.Column[featureColumnNames.Length];
266FeatureColumns[i] = new SchemaShape.Column(featureColumnNames[i], SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
268LabelColumn = new SchemaShape.Column(labelColumnName, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false);
269WeightColumn = exampleWeightColumnName != null ? new SchemaShape.Column(exampleWeightColumnName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false) : default;
621public SchemaShape GetOutputSchema(SchemaShape inputSchema)
626void CheckColumnsCompatible(SchemaShape.Column column, string columnRole)
654private SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
661new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
662new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
663new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\LogisticRegression\LogisticRegression.cs (8)
169private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
173new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
174new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
175new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\SdcaBinary.cs (54)
62private protected LinearTrainerBase(IHostEnvironment env, string featureColumn, SchemaShape.Column labelColumn,
290private static TOptions ArgsInit(string featureColumnName, SchemaShape.Column labelColumn)
299internal SdcaTrainerBase(IHostEnvironment env, string featureColumnName, SchemaShape.Column labelColumn,
300SchemaShape.Column weight = default, float? l2Const = null,
306internal SdcaTrainerBase(IHostEnvironment env, TOptions options, SchemaShape.Column label, SchemaShape.Column weight = default,
1453private readonly SchemaShape.Column[] _outputColumns;
1455private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) => _outputColumns;
1523private protected abstract SchemaShape.Column[] ComputeSdcaBinaryClassifierSchemaShape();
1620private protected override SchemaShape.Column[] ComputeSdcaBinaryClassifierSchemaShape()
1622return new SchemaShape.Column[]
1624new SchemaShape.Column(
1626SchemaShape.Column.VectorKind.Scalar,
1630new SchemaShape.Column(
1632SchemaShape.Column.VectorKind.Scalar,
1636new SchemaShape.Column(
1638SchemaShape.Column.VectorKind.Scalar,
1719private protected override SchemaShape.Column[] ComputeSdcaBinaryClassifierSchemaShape()
1721return new SchemaShape.Column[]
1723new SchemaShape.Column(
1725SchemaShape.Column.VectorKind.Scalar,
1730new SchemaShape.Column(
1732SchemaShape.Column.VectorKind.Scalar,
1777private protected override SchemaShape.Column[] ComputeSdcaBinaryClassifierSchemaShape()
1779var outCols = new List<SchemaShape.Column>()
1781new SchemaShape.Column(
1783SchemaShape.Column.VectorKind.Scalar,
1788new SchemaShape.Column(
1790SchemaShape.Column.VectorKind.Scalar,
1799outCols.Insert(1, new SchemaShape.Column(
1801SchemaShape.Column.VectorKind.Scalar,
2299private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
2303new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
2304new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
2305new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
2388private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
2392new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
2393new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
2442private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
2446new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
2447new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
2448new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\Simple\SimpleTrainers.cs (16)
300private static SchemaShape.Column MakeFeatureColumn(string featureColumn)
301=> new SchemaShape.Column(featureColumn, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
303private static SchemaShape.Column MakeLabelColumn(string labelColumn)
304=> new SchemaShape.Column(labelColumn, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false);
307/// Returns the <see cref="SchemaShape"/> of the schema which will be produced by the transformer.
310public SchemaShape GetOutputSchema(SchemaShape inputSchema)
318new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
319new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
320new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
322foreach (SchemaShape.Column column in newColumns)
Microsoft.ML.TensorFlow (6)
Microsoft.ML.TensorFlow.Tests (1)
Microsoft.ML.TestFramework (9)
Microsoft.ML.Tests (26)
Microsoft.ML.TimeSeries (44)
Microsoft.ML.TorchSharp (133)
AutoFormerV2\ObjectDetectionTrainer.cs (55)
157CheckInputSchema(SchemaShape.Create(input.Schema));
438public SchemaShape GetOutputSchema(SchemaShape inputSchema)
446var metadata = new List<SchemaShape.Column>();
447metadata.Add(new SchemaShape.Column(Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector,
450var scoreMetadata = new List<SchemaShape.Column>();
452scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreColumnKind, SchemaShape.Column.VectorKind.Scalar,
454scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreValueKind, SchemaShape.Column.VectorKind.Scalar,
456scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreColumnSetId, SchemaShape.Column.VectorKind.Scalar,
458scoreMetadata.Add(new SchemaShape.Column(Kinds.TrainingLabelValues, SchemaShape.Column.VectorKind.Vector,
464outColumns[Option.PredictedLabelColumnName] = new SchemaShape.Column(Option.PredictedLabelColumnName, SchemaShape.Column.VectorKind.VariableVector,
467outColumns[Option.PredictedBoundingBoxColumnName] = new SchemaShape.Column(Option.PredictedBoundingBoxColumnName, SchemaShape.Column.VectorKind.VariableVector,
470outColumns[Option.ScoreColumnName] = new SchemaShape.Column(Option.ScoreColumnName, SchemaShape.Column.VectorKind.VariableVector,
477private void CheckInputSchema(SchemaShape inputSchema)
482if (labelCol.Kind != SchemaShape.Column.VectorKind.VariableVector || labelCol.ItemType.RawType != typeof(UInt32))
488if (boundingBoxCol.Kind != SchemaShape.Column.VectorKind.VariableVector || boundingBoxCol.ItemType.RawType != typeof(Single))
506public readonly SchemaShape.Column PredictedLabelColumnName;
507public readonly SchemaShape.Column PredictedBoundingBoxColumn;
508public readonly SchemaShape.Column ConfidenceColumn;
528PredictedLabelColumnName = new SchemaShape.Column(Options.PredictedLabelColumnName, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.UInt32, false);
529PredictedBoundingBoxColumn = new SchemaShape.Column(Options.PredictedBoundingBoxColumnName, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
530ConfidenceColumn = new SchemaShape.Column(Options.ScoreColumnName, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
539public SchemaShape GetOutputSchema(SchemaShape inputSchema)
547var labelAnnotationsColumn = new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.SlotNames].Type, false);
548var predLabelMetadata = new SchemaShape(new SchemaShape.Column[] { labelAnnotationsColumn }
551var scoreMetadata = new List<SchemaShape.Column>();
553scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreColumnKind, SchemaShape.Column.VectorKind.Scalar,
555scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreValueKind, SchemaShape.Column.VectorKind.Scalar,
557scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreColumnSetId, SchemaShape.Column.VectorKind.Scalar,
559scoreMetadata.Add(new SchemaShape.Column(Kinds.TrainingLabelValues, SchemaShape.Column.VectorKind.Vector,
562outColumns[Options.PredictedLabelColumnName] = new SchemaShape.Column(Options.PredictedLabelColumnName, SchemaShape.Column.VectorKind.VariableVector,
565outColumns[Options.PredictedBoundingBoxColumnName] = new SchemaShape.Column(Options.PredictedBoundingBoxColumnName, SchemaShape.Column.VectorKind.VariableVector,
568outColumns[Options.ScoreColumnName] = new SchemaShape.Column(Options.ScoreColumnName, SchemaShape.Column.VectorKind.VariableVector,
574private void CheckInputSchema(SchemaShape inputSchema)
NasBert\NasBertTrainer.cs (36)
317public override SchemaShape GetOutputSchema(SchemaShape inputSchema)
328var metadata = new List<SchemaShape.Column>();
329metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector,
335outColumns[Option.PredictionColumnName] = new SchemaShape.Column(Option.PredictionColumnName, SchemaShape.Column.VectorKind.Scalar,
338outColumns[Option.ScoreColumnName] = new SchemaShape.Column(Option.ScoreColumnName, SchemaShape.Column.VectorKind.Vector,
343var metadata = new List<SchemaShape.Column>();
344metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector,
350outColumns[Option.PredictionColumnName] = new SchemaShape.Column(Option.PredictionColumnName, SchemaShape.Column.VectorKind.VariableVector,
355outColumns[Option.ScoreColumnName] = new SchemaShape.Column(Option.ScoreColumnName, SchemaShape.Column.VectorKind.Scalar,
362private protected override void CheckInputSchema(SchemaShape inputSchema)
416public readonly SchemaShape.Column SentenceColumn;
417public readonly SchemaShape.Column SentenceColumn2;
423SentenceColumn = new SchemaShape.Column(options.Sentence1ColumnName, SchemaShape.Column.VectorKind.Scalar, TextDataViewType.Instance, false);
424SentenceColumn2 = options.Sentence2ColumnName == default ? default : new SchemaShape.Column(options.Sentence2ColumnName, SchemaShape.Column.VectorKind.Scalar, TextDataViewType.Instance, false);
427private protected override SchemaShape GetOutputSchemaCore(SchemaShape inputSchema)
436var labelAnnotationsColumn = new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.SlotNames].Type, false);
437var predLabelMetadata = new SchemaShape(new SchemaShape.Column[] { labelAnnotationsColumn }
440outColumns[Options.PredictionColumnName] = new SchemaShape.Column(Options.PredictionColumnName, SchemaShape.Column.VectorKind.Scalar,
443outColumns[ScoreColumnName] = new SchemaShape.Column(ScoreColumnName, SchemaShape.Column.VectorKind.Vector,
448outColumns[ScoreColumnName] = new SchemaShape.Column(ScoreColumnName, SchemaShape.Column.VectorKind.Scalar,
455private protected override void CheckInputSchema(SchemaShape inputSchema)
Roberta\QATrainer.cs (33)
146CheckInputSchema(SchemaShape.Create(input.Schema));
502public SchemaShape GetOutputSchema(SchemaShape inputSchema)
510var scoreMetadata = new List<SchemaShape.Column>();
512scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreColumnKind, SchemaShape.Column.VectorKind.Scalar,
514scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreValueKind, SchemaShape.Column.VectorKind.Scalar,
516scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreColumnSetId, SchemaShape.Column.VectorKind.Scalar,
519outColumns[Option.PredictedAnswerColumnName] = new SchemaShape.Column(Option.PredictedAnswerColumnName, SchemaShape.Column.VectorKind.VariableVector,
522outColumns[Option.ScoreColumnName] = new SchemaShape.Column(Option.ScoreColumnName, SchemaShape.Column.VectorKind.VariableVector,
528private void CheckInputSchema(SchemaShape inputSchema)
533if (contextCol.Kind != SchemaShape.Column.VectorKind.Scalar || contextCol.ItemType.RawType != typeof(ReadOnlyMemory<char>))
539if (questionCol.Kind != SchemaShape.Column.VectorKind.Scalar || questionCol.ItemType.RawType != typeof(ReadOnlyMemory<char>))
545if (answerCol.Kind != SchemaShape.Column.VectorKind.Scalar || answerCol.ItemType.RawType != typeof(ReadOnlyMemory<char>))
551if (answerIndexCol.Kind != SchemaShape.Column.VectorKind.Scalar || answerIndexCol.ItemType.RawType != typeof(int))
588public SchemaShape GetOutputSchema(SchemaShape inputSchema)
596var scoreMetadata = new List<SchemaShape.Column>
598new SchemaShape.Column(Kinds.ScoreColumnKind, SchemaShape.Column.VectorKind.Scalar,
600new SchemaShape.Column(Kinds.ScoreValueKind, SchemaShape.Column.VectorKind.Scalar,
602new SchemaShape.Column(Kinds.ScoreColumnSetId, SchemaShape.Column.VectorKind.Scalar,
606outColumns[Options.PredictedAnswerColumnName] = new SchemaShape.Column(Options.PredictedAnswerColumnName, SchemaShape.Column.VectorKind.VariableVector,
609outColumns[Options.ScoreColumnName] = new SchemaShape.Column(Options.ScoreColumnName, SchemaShape.Column.VectorKind.VariableVector,
615private void CheckInputSchema(SchemaShape inputSchema)
Microsoft.ML.TorchSharp.Tests (16)
Microsoft.ML.Transforms (202)
Microsoft.ML.Vision (18)