171 instantiations of SchemaShape
Microsoft.ML.Core (3)
Microsoft.ML.Data (22)
Microsoft.ML.FastTree (14)
FastTreeClassification.cs (3)
317new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
318new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
319new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
GamClassification.cs (3)
188new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
189new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
190new 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)
292new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
293new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
294new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Microsoft.ML.Mkl.Components (5)
SymSgdClassificationTrainer.cs (3)
284new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
285new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
286new 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)
661return new SchemaShape(outColumns.Values);
671new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
672new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
673new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\LogisticRegression\LogisticRegression.cs (3)
175new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
176new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
177new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\SdcaBinary.cs (16)
1632new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
1638new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
1644new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
1729new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())
1736new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
1787new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())
1794new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
1805new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))));
2305new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
2306new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
2307new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
2394new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
2395new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
2448new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
2449new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
2450new 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)
313private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
317new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
318new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
319new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
GamClassification.cs (8)
184private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
188new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
189new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
190new 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 (32)
LightGbmBinaryTrainer.cs (9)
255new SchemaShape.Column())
288private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
292new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
293new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
294new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Microsoft.ML.Mkl.Components (16)
SymSgdClassificationTrainer.cs (8)
280private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
284new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
285new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
286new 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)
214private static SchemaShape.Column MakeWeightColumn(string weightColumn)
218return new SchemaShape.Column(weightColumn, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false);
221private static SchemaShape.Column MakeFeatureColumn(string featureColumn)
223return new SchemaShape.Column(featureColumn, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
388private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
392new SchemaShape.Column(DefaultColumnNames.Score,
393SchemaShape.Column.VectorKind.Scalar,
398new SchemaShape.Column(DefaultColumnNames.PredictedLabel,
399SchemaShape.Column.VectorKind.Scalar,
Microsoft.ML.Recommender (13)
MatrixFactorizationTrainer.cs (13)
567public SchemaShape GetOutputSchema(SchemaShape inputSchema)
571void CheckColumnsCompatible(SchemaShape.Column cachedColumn, string columnRole)
582var labelColumn = new SchemaShape.Column(LabelName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false);
586var matrixColumnIndexColumn = new SchemaShape.Column(MatrixColumnIndexName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true);
587var matrixRowIndexColumn = new SchemaShape.Column(MatrixRowIndexName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true);
601private SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
608new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
Microsoft.ML.StandardTrainers (181)
FactorizationMachine\FactorizationMachineTrainer.cs (30)
195internal readonly SchemaShape.Column[] FeatureColumns;
201internal readonly SchemaShape.Column LabelColumn;
207internal readonly SchemaShape.Column WeightColumn;
240FeatureColumns = new SchemaShape.Column[1 + extraColumnLength];
243FeatureColumns[0] = new SchemaShape.Column(options.FeatureColumnName, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
247FeatureColumns[i + 1] = new SchemaShape.Column(options.ExtraFeatureColumns[i], SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
249LabelColumn = new SchemaShape.Column(options.LabelColumnName, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false);
250WeightColumn = options.ExampleWeightColumnName != null ? new SchemaShape.Column(options.ExampleWeightColumnName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false) : default;
273FeatureColumns = new SchemaShape.Column[featureColumnNames.Length];
276FeatureColumns[i] = new SchemaShape.Column(featureColumnNames[i], SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
278LabelColumn = new SchemaShape.Column(labelColumnName, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false);
279WeightColumn = exampleWeightColumnName != null ? new SchemaShape.Column(exampleWeightColumnName, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false) : default;
631public SchemaShape GetOutputSchema(SchemaShape inputSchema)
636void CheckColumnsCompatible(SchemaShape.Column column, string columnRole)
664private SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
671new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
672new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
673new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\LogisticRegression\LogisticRegression.cs (8)
171private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
175new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
176new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
177new 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,
293private static TOptions ArgsInit(string featureColumnName, SchemaShape.Column labelColumn)
302internal SdcaTrainerBase(IHostEnvironment env, string featureColumnName, SchemaShape.Column labelColumn,
303SchemaShape.Column weight = default, float? l2Const = null,
309internal SdcaTrainerBase(IHostEnvironment env, TOptions options, SchemaShape.Column label, SchemaShape.Column weight = default,
1456private readonly SchemaShape.Column[] _outputColumns;
1458private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) => _outputColumns;
1526private protected abstract SchemaShape.Column[] ComputeSdcaBinaryClassifierSchemaShape();
1623private protected override SchemaShape.Column[] ComputeSdcaBinaryClassifierSchemaShape()
1625return new SchemaShape.Column[]
1627new SchemaShape.Column(
1629SchemaShape.Column.VectorKind.Scalar,
1633new SchemaShape.Column(
1635SchemaShape.Column.VectorKind.Scalar,
1639new SchemaShape.Column(
1641SchemaShape.Column.VectorKind.Scalar,
1720private protected override SchemaShape.Column[] ComputeSdcaBinaryClassifierSchemaShape()
1722return new SchemaShape.Column[]
1724new SchemaShape.Column(
1726SchemaShape.Column.VectorKind.Scalar,
1731new SchemaShape.Column(
1733SchemaShape.Column.VectorKind.Scalar,
1778private protected override SchemaShape.Column[] ComputeSdcaBinaryClassifierSchemaShape()
1780var outCols = new List<SchemaShape.Column>()
1782new SchemaShape.Column(
1784SchemaShape.Column.VectorKind.Scalar,
1789new SchemaShape.Column(
1791SchemaShape.Column.VectorKind.Scalar,
1800outCols.Insert(1, new SchemaShape.Column(
1802SchemaShape.Column.VectorKind.Scalar,
2301private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
2305new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
2306new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
2307new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
2390private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
2394new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
2395new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
2444private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema)
2448new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
2449new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
2450new 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 (8)
Microsoft.ML.Tests (26)
Microsoft.ML.TimeSeries (44)
Microsoft.ML.TorchSharp (133)
AutoFormerV2\ObjectDetectionTrainer.cs (55)
171CheckInputSchema(SchemaShape.Create(input.Schema));
452public SchemaShape GetOutputSchema(SchemaShape inputSchema)
460var metadata = new List<SchemaShape.Column>();
461metadata.Add(new SchemaShape.Column(Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector,
464var scoreMetadata = new List<SchemaShape.Column>();
466scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreColumnKind, SchemaShape.Column.VectorKind.Scalar,
468scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreValueKind, SchemaShape.Column.VectorKind.Scalar,
470scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreColumnSetId, SchemaShape.Column.VectorKind.Scalar,
472scoreMetadata.Add(new SchemaShape.Column(Kinds.TrainingLabelValues, SchemaShape.Column.VectorKind.Vector,
478outColumns[Option.PredictedLabelColumnName] = new SchemaShape.Column(Option.PredictedLabelColumnName, SchemaShape.Column.VectorKind.VariableVector,
481outColumns[Option.PredictedBoundingBoxColumnName] = new SchemaShape.Column(Option.PredictedBoundingBoxColumnName, SchemaShape.Column.VectorKind.VariableVector,
484outColumns[Option.ScoreColumnName] = new SchemaShape.Column(Option.ScoreColumnName, SchemaShape.Column.VectorKind.VariableVector,
491private void CheckInputSchema(SchemaShape inputSchema)
496if (labelCol.Kind != SchemaShape.Column.VectorKind.VariableVector || labelCol.ItemType.RawType != typeof(UInt32))
502if (boundingBoxCol.Kind != SchemaShape.Column.VectorKind.VariableVector || boundingBoxCol.ItemType.RawType != typeof(Single))
520public readonly SchemaShape.Column PredictedLabelColumnName;
521public readonly SchemaShape.Column PredictedBoundingBoxColumn;
522public readonly SchemaShape.Column ConfidenceColumn;
542PredictedLabelColumnName = new SchemaShape.Column(Options.PredictedLabelColumnName, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.UInt32, false);
543PredictedBoundingBoxColumn = new SchemaShape.Column(Options.PredictedBoundingBoxColumnName, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
544ConfidenceColumn = new SchemaShape.Column(Options.ScoreColumnName, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
553public SchemaShape GetOutputSchema(SchemaShape inputSchema)
561var labelAnnotationsColumn = new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.SlotNames].Type, false);
562var predLabelMetadata = new SchemaShape(new SchemaShape.Column[] { labelAnnotationsColumn }
565var scoreMetadata = new List<SchemaShape.Column>();
567scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreColumnKind, SchemaShape.Column.VectorKind.Scalar,
569scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreValueKind, SchemaShape.Column.VectorKind.Scalar,
571scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreColumnSetId, SchemaShape.Column.VectorKind.Scalar,
573scoreMetadata.Add(new SchemaShape.Column(Kinds.TrainingLabelValues, SchemaShape.Column.VectorKind.Vector,
576outColumns[Options.PredictedLabelColumnName] = new SchemaShape.Column(Options.PredictedLabelColumnName, SchemaShape.Column.VectorKind.VariableVector,
579outColumns[Options.PredictedBoundingBoxColumnName] = new SchemaShape.Column(Options.PredictedBoundingBoxColumnName, SchemaShape.Column.VectorKind.VariableVector,
582outColumns[Options.ScoreColumnName] = new SchemaShape.Column(Options.ScoreColumnName, SchemaShape.Column.VectorKind.VariableVector,
588private void CheckInputSchema(SchemaShape inputSchema)
NasBert\NasBertTrainer.cs (36)
339public override SchemaShape GetOutputSchema(SchemaShape inputSchema)
350var metadata = new List<SchemaShape.Column>();
351metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector,
357outColumns[Option.PredictionColumnName] = new SchemaShape.Column(Option.PredictionColumnName, SchemaShape.Column.VectorKind.Scalar,
360outColumns[Option.ScoreColumnName] = new SchemaShape.Column(Option.ScoreColumnName, SchemaShape.Column.VectorKind.Vector,
365var metadata = new List<SchemaShape.Column>();
366metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector,
372outColumns[Option.PredictionColumnName] = new SchemaShape.Column(Option.PredictionColumnName, SchemaShape.Column.VectorKind.VariableVector,
377outColumns[Option.ScoreColumnName] = new SchemaShape.Column(Option.ScoreColumnName, SchemaShape.Column.VectorKind.Scalar,
384private protected override void CheckInputSchema(SchemaShape inputSchema)
438public readonly SchemaShape.Column SentenceColumn;
439public readonly SchemaShape.Column SentenceColumn2;
445SentenceColumn = new SchemaShape.Column(options.Sentence1ColumnName, SchemaShape.Column.VectorKind.Scalar, TextDataViewType.Instance, false);
446SentenceColumn2 = options.Sentence2ColumnName == default ? default : new SchemaShape.Column(options.Sentence2ColumnName, SchemaShape.Column.VectorKind.Scalar, TextDataViewType.Instance, false);
449private protected override SchemaShape GetOutputSchemaCore(SchemaShape inputSchema)
458var labelAnnotationsColumn = new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.SlotNames].Type, false);
459var predLabelMetadata = new SchemaShape(new SchemaShape.Column[] { labelAnnotationsColumn }
462outColumns[Options.PredictionColumnName] = new SchemaShape.Column(Options.PredictionColumnName, SchemaShape.Column.VectorKind.Scalar,
465outColumns[ScoreColumnName] = new SchemaShape.Column(ScoreColumnName, SchemaShape.Column.VectorKind.Vector,
470outColumns[ScoreColumnName] = new SchemaShape.Column(ScoreColumnName, SchemaShape.Column.VectorKind.Scalar,
477private protected override void CheckInputSchema(SchemaShape inputSchema)
Roberta\QATrainer.cs (33)
153CheckInputSchema(SchemaShape.Create(input.Schema));
509public SchemaShape GetOutputSchema(SchemaShape inputSchema)
517var scoreMetadata = new List<SchemaShape.Column>();
519scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreColumnKind, SchemaShape.Column.VectorKind.Scalar,
521scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreValueKind, SchemaShape.Column.VectorKind.Scalar,
523scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreColumnSetId, SchemaShape.Column.VectorKind.Scalar,
526outColumns[Option.PredictedAnswerColumnName] = new SchemaShape.Column(Option.PredictedAnswerColumnName, SchemaShape.Column.VectorKind.VariableVector,
529outColumns[Option.ScoreColumnName] = new SchemaShape.Column(Option.ScoreColumnName, SchemaShape.Column.VectorKind.VariableVector,
535private void CheckInputSchema(SchemaShape inputSchema)
540if (contextCol.Kind != SchemaShape.Column.VectorKind.Scalar || contextCol.ItemType.RawType != typeof(ReadOnlyMemory<char>))
546if (questionCol.Kind != SchemaShape.Column.VectorKind.Scalar || questionCol.ItemType.RawType != typeof(ReadOnlyMemory<char>))
552if (answerCol.Kind != SchemaShape.Column.VectorKind.Scalar || answerCol.ItemType.RawType != typeof(ReadOnlyMemory<char>))
558if (answerIndexCol.Kind != SchemaShape.Column.VectorKind.Scalar || answerIndexCol.ItemType.RawType != typeof(int))
595public SchemaShape GetOutputSchema(SchemaShape inputSchema)
603var scoreMetadata = new List<SchemaShape.Column>
605new SchemaShape.Column(Kinds.ScoreColumnKind, SchemaShape.Column.VectorKind.Scalar,
607new SchemaShape.Column(Kinds.ScoreValueKind, SchemaShape.Column.VectorKind.Scalar,
609new SchemaShape.Column(Kinds.ScoreColumnSetId, SchemaShape.Column.VectorKind.Scalar,
613outColumns[Options.PredictedAnswerColumnName] = new SchemaShape.Column(Options.PredictedAnswerColumnName, SchemaShape.Column.VectorKind.VariableVector,
616outColumns[Options.ScoreColumnName] = new SchemaShape.Column(Options.ScoreColumnName, SchemaShape.Column.VectorKind.VariableVector,
622private void CheckInputSchema(SchemaShape inputSchema)
Microsoft.ML.TorchSharp.Tests (16)
Microsoft.ML.Transforms (202)
Microsoft.ML.Vision (18)