12 instantiations of Column
Microsoft.ML.Core (8)
Data\AnnotationUtils.cs (6)
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)); 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));
Data\IEstimator.cs (2)
192mCols.Add(new Column(annotationColumn.Name, mVecKind, mItemType, mIsKey)); 197cols.Add(new Column(schema[iCol].Name, vecKind, itemType, isKey, annotations));
Microsoft.ML.LightGbm (4)
LightGbmBinaryTrainer.cs (1)
249new SchemaShape.Column())
LightGbmMulticlassTrainer.cs (1)
190new SchemaShape.Column())
LightGbmRankingTrainer.cs (1)
235new SchemaShape.Column())
LightGbmRegressionTrainer.cs (1)
212new SchemaShape.Column())
631 references to Column
Microsoft.ML.Core (41)
Data\AnnotationUtils.cs (23)
310public static bool NeedsSlotNames(this SchemaShape.Column col) 312return col.Annotations.TryFindColumn(Kinds.KeyValues, out var metaCol) 313&& metaCol.Kind == SchemaShape.Column.VectorKind.Vector 324public static bool IsNormalized(this SchemaShape.Column column) 327return column.Annotations.TryFindColumn(Kinds.IsNormalized, out var metaCol) 328&& metaCol.Kind == SchemaShape.Column.VectorKind.Scalar && !metaCol.IsKey 339public static bool HasSlotNames(this SchemaShape.Column col) 342return col.Kind == SchemaShape.Column.VectorKind.Vector 343&& col.Annotations.TryFindColumn(Kinds.SlotNames, out var metaCol) 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>(); 446if (labelColumn.Value.Annotations.TryFindColumn(Kinds.KeyValues, out var metaCol) && 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));
Data\IEstimator.cs (18)
18public sealed class SchemaShape : IReadOnlyList<SchemaShape.Column> 20private readonly Column[] _columns; 22private static readonly SchemaShape _empty = new SchemaShape(Enumerable.Empty<Column>()); 26public Column this[int index] => _columns[index]; 87internal bool IsCompatibleWith(Column source) 98foreach (var annotationCol in Annotations) 100if (!source.Annotations.TryFindColumn(annotationCol.Name, out var inputAnnotationCol)) 122/// Return if this structure is not identical to the default value of <see cref="Column"/>. If true, 129public SchemaShape(IEnumerable<Column> columns) 146out Column.VectorKind vecKind, 154vecKind = Column.VectorKind.Vector; 158vecKind = Column.VectorKind.VariableVector; 165vecKind = Column.VectorKind.Scalar; 181var cols = new List<Column>(); 188var mCols = new List<Column>(); 207internal bool TryFindColumn(string name, out Column column) 214public IEnumerator<Column> GetEnumerator() => ((IEnumerable<Column>)_columns).GetEnumerator();
Microsoft.ML.Data (121)
DataLoadSave\FakeSchema.cs (3)
47private static DataViewType MakeColumnType(SchemaShape.Column column) 52if (column.Kind == SchemaShape.Column.VectorKind.VariableVector) 54else if (column.Kind == SchemaShape.Column.VectorKind.Vector)
Prediction\CalibratorCatalog.cs (16)
53private protected readonly SchemaShape.Column ScoreColumn; 55private protected readonly SchemaShape.Column LabelColumn; 57private protected readonly SchemaShape.Column WeightColumn; 59private protected readonly SchemaShape.Column PredictedLabel; 87Action<SchemaShape.Column, string> checkColumnValid = (SchemaShape.Column column, string columnRole) => 91if (!inputSchema.TryFindColumn(column.Name, out var outCol)) 103bool success = inputSchema.TryFindColumn(ScoreColumn.Name, out var inputScoreCol); 105const SchemaShape.Column.VectorKind scalar = SchemaShape.Column.VectorKind.Scalar; 107var annotations = new List<SchemaShape.Column>(); 109SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false)); 111if (inputScoreCol.Annotations.TryFindColumn(AnnotationUtils.Kinds.ScoreColumnSetId, out var setIdCol) && 113inputScoreCol.Annotations.TryFindColumn(AnnotationUtils.Kinds.ScoreColumnKind, out var kindCol) && 115inputScoreCol.Annotations.TryFindColumn(AnnotationUtils.Kinds.ScoreValueKind, out var valueKindCol) && 126SchemaShape.Column.VectorKind.Scalar,
Training\TrainerEstimatorBase.cs (17)
30public readonly SchemaShape.Column FeatureColumn; 36public readonly SchemaShape.Column LabelColumn; 42public readonly SchemaShape.Column WeightColumn; 59SchemaShape.Column feature, 60SchemaShape.Column label, 61SchemaShape.Column weight = default) 86foreach (var col in GetOutputColumnsCore(inputSchema)) 95private protected abstract SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema); 108if (!inputSchema.TryFindColumn(FeatureColumn.Name, out var featureCol)) 116if (!inputSchema.TryFindColumn(WeightColumn.Name, out var weightCol)) 127if (!inputSchema.TryFindColumn(LabelColumn.Name, out var labelCol)) 133private protected virtual void CheckLabelCompatible(SchemaShape.Column labelCol) 184public readonly SchemaShape.Column GroupIdColumn; 188SchemaShape.Column feature, 189SchemaShape.Column label, 190SchemaShape.Column weight = default, 191SchemaShape.Column groupId = default)
Training\TrainerUtils.cs (15)
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 (15)
75private bool HasCategoricals(SchemaShape.Column col) 78if (!col.Annotations.TryFindColumn(AnnotationUtils.Kinds.CategoricalSlotRanges, out var mcol)) 82return mcol.Kind == SchemaShape.Column.VectorKind.Vector 86private SchemaShape.Column CheckInputsAndMakeColumn( 91var cols = new SchemaShape.Column[sources.Length]; 106if (!inputSchema.TryFindColumn(sources[i], out var col)) 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));
Transforms\ColumnCopying.cs (2)
79if (!inputSchema.TryFindColumn(inputColumnName, out var originalColumn)) 81var col = new SchemaShape.Column(outputColumnName, originalColumn.Kind, originalColumn.ItemType, originalColumn.IsKey, originalColumn.Annotations);
Transforms\FeatureContributionCalculationTransformer.cs (4)
342if (!inputSchema.TryFindColumn(_featureColumn, out var col)) 345if (col.ItemType != NumberDataViewType.Single || col.Kind != SchemaShape.Column.VectorKind.Vector) 352var featContributionMetadata = new List<SchemaShape.Column>(); 353if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.SlotNames, out var slotMeta))
Transforms\Hashing.cs (5)
1959if (!inputSchema.TryFindColumn(colInfo.InputColumnName, out var col)) 1963var metadata = new List<SchemaShape.Column>(); 1964if (!colInfo.Combine && col.Annotations.TryFindColumn(AnnotationUtils.Kinds.SlotNames, out var slotMeta)) 1967metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false)); 1968result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, colInfo.Combine ? SchemaShape.Column.VectorKind.Scalar : col.Kind,
Transforms\KeyToValue.cs (3)
640if (!inputSchema.TryFindColumn(colInfo.inputColumnName, out var col)) 645if (!col.Annotations.TryFindColumn(AnnotationUtils.Kinds.KeyValues, out var keyMetaCol)) 649if (col.HasSlotNames() && col.Annotations.TryFindColumn(AnnotationUtils.Kinds.SlotNames, out var slotCol))
Transforms\KeyToVector.cs (13)
824if (!inputSchema.TryFindColumn(colInfo.InputColumnName, out var col)) 829var metadata = new List<SchemaShape.Column>(); 830if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.KeyValues, out var keyMeta)) 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)); 839col.Kind == SchemaShape.Column.VectorKind.VariableVector && !colInfo.OutputCountVector ? SchemaShape.Column.VectorKind.VariableVector : SchemaShape.Column.VectorKind.Vector,
Transforms\Normalizer.cs (6)
351if (!inputSchema.TryFindColumn(colInfo.InputColumnName, out var col)) 353if (col.Kind == SchemaShape.Column.VectorKind.VariableVector) 359var isNormalizedMeta = new SchemaShape.Column(AnnotationUtils.Kinds.IsNormalized, SchemaShape.Column.VectorKind.Scalar, 361var newMetadataKinds = new List<SchemaShape.Column> { isNormalizedMeta }; 362if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.SlotNames, out var slotMeta))
Transforms\TypeConverting.cs (10)
628if (!inputSchema.TryFindColumn(colInfo.InputColumnName, out var col)) 634var metadata = new List<SchemaShape.Column>(); 636metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.IsNormalized, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false)); 637if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.SlotNames, out var slotMeta)) 638if (col.Kind == SchemaShape.Column.VectorKind.Vector) 639metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, slotMeta.ItemType, false)); 640if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.KeyValues, out var keyMeta)) 642metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, keyMeta.ItemType, false)); 643if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.IsNormalized, out var normMeta)) 645metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, normMeta.ItemType, false));
Transforms\ValueMapping.cs (7)
97var vectorKind = SchemaShape.Column.VectorKind.Scalar; 100vectorKind = SchemaShape.Column.VectorKind.Vector; 102vectorKind = SchemaShape.Column.VectorKind.VariableVector; 114if (!inputSchema.TryFindColumn(inputColumnName, out var originalColumn)) 117if (originalColumn.Kind == SchemaShape.Column.VectorKind.VariableVector || 118originalColumn.Kind == SchemaShape.Column.VectorKind.Vector) 128var col = new SchemaShape.Column(outputColumnName, vectorKind, columnType, isKey, metadataShape);
Transforms\ValueToKeyMappingEstimator.cs (5)
184if (!inputSchema.TryFindColumn(colInfo.InputColumnName, out var col)) 193if (!col.IsKey || !col.Annotations.TryFindColumn(AnnotationUtils.Kinds.KeyValues, out var kv) || kv.Kind != SchemaShape.Column.VectorKind.Vector) 195kv = new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, 200if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.SlotNames, out var slotMeta))
Microsoft.ML.FastTree (39)
BoostingFastTree.cs (2)
16private protected BoostingFastTreeTrainerBase(IHostEnvironment env, TOptions options, SchemaShape.Column label) : base(env, options, label) 21SchemaShape.Column label,
FastTree.cs (2)
104SchemaShape.Column label, 142private protected FastTreeTrainerBase(IHostEnvironment env, TOptions options, SchemaShape.Column label)
FastTreeClassification.cs (4)
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()))
FastTreeRanking.cs (4)
120private protected override void CheckLabelCompatible(SchemaShape.Column labelCol) 127if (labelCol.Kind != SchemaShape.Column.VectorKind.Scalar) 485private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 489new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
FastTreeRegression.cs (4)
141private static SchemaShape.Column MakeLabelColumn(string labelColumn) 143return new SchemaShape.Column(labelColumn, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false); 201private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 205new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
FastTreeTweedie.cs (4)
77private SchemaShape.Column[] _outputColumns; 211new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false) 360private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 364new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
GamClassification.cs (4)
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()))
GamRegression.cs (2)
135private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 139new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
GamTrainer.cs (2)
170SchemaShape.Column label, 196private protected GamTrainerBase(IHostEnvironment env, TOptions options, string name, SchemaShape.Column label)
RandomForest.cs (2)
19private protected RandomForestTrainerBase(IHostEnvironment env, TOptions options, SchemaShape.Column label, bool quantileEnabled = false) 29SchemaShape.Column label,
RandomForestClassification.cs (3)
375private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 379new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())), 380new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
RandomForestRegression.cs (2)
504private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 508new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
TreeEnsembleFeaturizationEstimator.cs (4)
131if (!inputSchema.TryFindColumn(FeatureColumnName, out var col)) 138SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false); 142SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false); 146SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
Microsoft.ML.ImageAnalytics (15)
ImageGrayscale.cs (2)
252if (!inputSchema.TryFindColumn(colInfo.inputColumnName, out var col)) 254if (!(col.ItemType is ImageDataViewType) || col.Kind != SchemaShape.Column.VectorKind.Scalar)
ImageLoader.cs (4)
443if (!inputSchema.TryFindColumn(inputColumnName, out var col)) 445if (!(col.ItemType is TextDataViewType) || col.Kind != SchemaShape.Column.VectorKind.Scalar) 449result[outputColumnName] = new SchemaShape.Column(outputColumnName, SchemaShape.Column.VectorKind.Scalar, new ImageDataViewType(), false); 451result[outputColumnName] = new SchemaShape.Column(outputColumnName, SchemaShape.Column.VectorKind.VariableVector, NumberDataViewType.Byte, false);
ImagePixelExtractor.cs (3)
815if (!inputSchema.TryFindColumn(colInfo.InputColumnName, out var col)) 817if (!(col.ItemType is ImageDataViewType) || col.Kind != SchemaShape.Column.VectorKind.Scalar) 821result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.Vector, itemType, false);
ImageResizer.cs (3)
515if (!inputSchema.TryFindColumn(colInfo.InputColumnName, out var col)) 517if (!(col.ItemType is ImageDataViewType) || col.Kind != SchemaShape.Column.VectorKind.Scalar) 520result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.Scalar, colInfo.Type, false);
VectorToImageTransform.cs (3)
749if (!inputSchema.TryFindColumn(colInfo.InputColumnName, out var col)) 751if (col.Kind != SchemaShape.Column.VectorKind.Vector || (col.ItemType != NumberDataViewType.Single && col.ItemType != NumberDataViewType.Double && col.ItemType != NumberDataViewType.Byte)) 755result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.Scalar, itemType, false);
Microsoft.ML.KMeansClustering (3)
KMeansPlusPlusTrainer.cs (3)
303private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 308SchemaShape.Column.VectorKind.Vector, 314SchemaShape.Column.VectorKind.Scalar,
Microsoft.ML.LightGbm (16)
LightGbmBinaryTrainer.cs (4)
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()))
LightGbmMulticlassTrainer.cs (4)
358private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 360SchemaShape.Column labelCol = default; 370new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.AnnotationsForMulticlassScoreColumn(labelCol))), 371new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true, metadata)
LightGbmRankingTrainer.cs (4)
268private protected override void CheckLabelCompatible(SchemaShape.Column labelCol) 275if (labelCol.Kind != SchemaShape.Column.VectorKind.Scalar) 298private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 302new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
LightGbmRegressionTrainer.cs (2)
246private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 250new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
LightGbmTrainerBase.cs (2)
319SchemaShape.Column labelColumn, 342private protected LightGbmTrainerBase(IHostEnvironment env, string name, TOptions options, SchemaShape.Column label)
Microsoft.ML.Mkl.Components (7)
OlsLinearRegression.cs (2)
134private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 138new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
SymSgdClassificationTrainer.cs (4)
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()))
VectorWhitening.cs (1)
896if (!inputSchema.TryFindColumn(colPair.InputColumnName, out var col))
Microsoft.ML.OnnxTransformer (3)
OnnxTransform.cs (3)
1069if (!inputSchema.TryFindColumn(input, out var col)) 1086Transformer.OutputTypes[i].IsKnownSizeVector() ? SchemaShape.Column.VectorKind.Vector 1087: SchemaShape.Column.VectorKind.VariableVector, Transformer.OutputTypes[i].GetItemType(), false);
Microsoft.ML.PCA (10)
PcaTrainer.cs (7)
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) 377SchemaShape.Column.VectorKind.Scalar, 383SchemaShape.Column.VectorKind.Scalar,
PcaTransformer.cs (3)
821if (!inputSchema.TryFindColumn(colInfo.InputColumnName, out var col)) 824if (col.Kind != SchemaShape.Column.VectorKind.Vector || !col.ItemType.Equals(NumberDataViewType.Single)) 828SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
Microsoft.ML.Recommender (12)
MatrixFactorizationTrainer.cs (12)
558void CheckColumnsCompatible(SchemaShape.Column cachedColumn, string columnRole) 560if (!inputSchema.TryFindColumn(cachedColumn.Name, out var col)) 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); 582foreach (var col in GetOutputColumnsCore(inputSchema)) 588private SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 590bool success = inputSchema.TryFindColumn(LabelName, out var labelCol); 595new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
Microsoft.ML.StandardTrainers (113)
FactorizationMachine\FactorizationMachineTrainer.cs (22)
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; 594foreach (var feat in FeatureColumns) 626void CheckColumnsCompatible(SchemaShape.Column column, string columnRole) 629if (!inputSchema.TryFindColumn(column.Name, out var col)) 639foreach (var feat in FeatureColumns) 648foreach (var col in GetOutputColumnsCore(inputSchema)) 654private SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 656bool success = inputSchema.TryFindColumn(LabelColumn.Name, out var labelCol); 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()))
LdSvm\LdSvmTrainer.cs (3)
180private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 184new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())), 185new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\LogisticRegression\LbfgsPredictorBase.cs (3)
206SchemaShape.Column labelColumn, 230SchemaShape.Column labelColumn, 285private static TOptions ArgsInit(string featureColumn, SchemaShape.Column labelColumn,
Standard\LogisticRegression\LogisticRegression.cs (4)
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\LogisticRegression\MulticlassLogisticRegression.cs (4)
369private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 371bool success = inputSchema.TryFindColumn(LabelColumn.Name, out var labelCol); 378new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.AnnotationsForMulticlassScoreColumn(labelCol))), 379new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true, metadata)
Standard\MulticlassClassification\MetaMulticlassTrainer.cs (10)
40private protected readonly SchemaShape.Column LabelColumn; 50private protected SchemaShape.Column[] OutputColumns; 71LabelColumn = new SchemaShape.Column(labelColumn, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true); 147if (!inputSchema.TryFindColumn(LabelColumn.Name, out var labelCol)) 155foreach (var col in GetOutputColumnsCore(inputSchema)) 161private SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 163SchemaShape.Column? labelCol = null; 168bool success = inputSchema.TryFindColumn(LabelColumn.Name, out var inputLabelCol); 177new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, 179new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32,
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (4)
114private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 116bool success = inputSchema.TryFindColumn(LabelColumn.Name, out var labelCol); 124new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.AnnotationsForMulticlassScoreColumn(labelCol))), 125new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true, predLabelMetadata)
Standard\Online\AveragedLinear.cs (1)
306private protected AveragedLinearTrainer(AveragedLinearOptions options, IHostEnvironment env, string name, SchemaShape.Column label)
Standard\Online\AveragedPerceptron.cs (3)
196private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 201new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())), 202new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\Online\LinearSvm.cs (3)
305private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 309new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())), 310new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\Online\OnlineGradientDescent.cs (2)
168private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 172new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\Online\OnlineLinear.cs (1)
261private protected OnlineLinearTrainer(OnlineLinearOptions options, IHostEnvironment env, string name, SchemaShape.Column label)
Standard\PoissonRegression\PoissonRegression.cs (2)
119private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 123new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\SdcaBinary.cs (34)
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[] 1626SchemaShape.Column.VectorKind.Scalar, 1632SchemaShape.Column.VectorKind.Scalar, 1638SchemaShape.Column.VectorKind.Scalar, 1719private protected override SchemaShape.Column[] ComputeSdcaBinaryClassifierSchemaShape() 1721return new SchemaShape.Column[] 1725SchemaShape.Column.VectorKind.Scalar, 1732SchemaShape.Column.VectorKind.Scalar, 1777private protected override SchemaShape.Column[] ComputeSdcaBinaryClassifierSchemaShape() 1779var outCols = new List<SchemaShape.Column>() 1783SchemaShape.Column.VectorKind.Scalar, 1790SchemaShape.Column.VectorKind.Scalar, 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\SdcaMulticlass.cs (4)
159private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 161bool success = inputSchema.TryFindColumn(LabelColumn.Name, out var labelCol); 168new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.AnnotationsForMulticlassScoreColumn(labelCol))), 169new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.UInt32, true, metadata)
Standard\SdcaRegression.cs (2)
193private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 197new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.Column.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\Simple\SimpleTrainers.cs (8)
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); 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)
Standard\StochasticTrainerBase.cs (3)
17public StochasticTrainerBase(IHost host, SchemaShape.Column feature, SchemaShape.Column label, SchemaShape.Column weight = default)
Microsoft.ML.TensorFlow (3)
TensorflowTransform.cs (3)
1038if (!inputSchema.TryFindColumn(input, out var col)) 1047_outputTypes[i].IsKnownSizeVector() ? SchemaShape.Column.VectorKind.Vector 1048: SchemaShape.Column.VectorKind.VariableVector, _outputTypes[i].GetItemType(), false);
Microsoft.ML.Tests (10)
Transformers\ValueMappingTests.cs (10)
110Assert.True(schema.TryFindColumn("VecD", out var originalColumn)); 111Assert.Equal(SchemaShape.Column.VectorKind.VariableVector, originalColumn.Kind); 192Assert.True(schema.TryFindColumn(name, out var originalColumn)); 193Assert.Equal(SchemaShape.Column.VectorKind.VariableVector, originalColumn.Kind); 376Assert.True(outputSchema.TryFindColumn("D", out SchemaShape.Column dColumn)); 377Assert.True(outputSchema.TryFindColumn("E", out SchemaShape.Column eColumn)); 378Assert.True(outputSchema.TryFindColumn("F", out SchemaShape.Column fColumn)); 407Assert.True(outputSchema.TryFindColumn("D", out SchemaShape.Column dColumn)); 408Assert.True(outputSchema.TryFindColumn("E", out SchemaShape.Column eColumn)); 409Assert.True(outputSchema.TryFindColumn("F", out SchemaShape.Column fColumn));
Microsoft.ML.TimeSeries (24)
IidChangePointDetector.cs (4)
265if (!inputSchema.TryFindColumn(Transformer.InternalTransform.InputColumnName, out var col)) 270var metadata = new List<SchemaShape.Column>() { 271new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false) 276Transformer.InternalTransform.OutputColumnName, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Double, false, new SchemaShape(metadata));
IidSpikeDetector.cs (4)
241if (!inputSchema.TryFindColumn(Transformer.InternalTransform.InputColumnName, out var col)) 246var metadata = new List<SchemaShape.Column>() { 247new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false) 251Transformer.InternalTransform.OutputColumnName, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Double, false, new SchemaShape(metadata));
SRCNNAnomalyDetector.cs (4)
273if (!inputSchema.TryFindColumn(Transformer.InternalTransform.InputColumnName, out var col)) 278var metadata = new List<SchemaShape.Column>() { 279new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false) 283Transformer.InternalTransform.OutputColumnName, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Double, false, new SchemaShape(metadata));
SsaChangePointDetector.cs (4)
301if (!inputSchema.TryFindColumn(_options.Source, out var col)) 306var metadata = new List<SchemaShape.Column>() { 307new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false) 311_options.Name, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Double, false, new SchemaShape(metadata));
SSaForecasting.cs (4)
334if (!inputSchema.TryFindColumn(_options.Source, out var col)) 341_options.Name, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false); 346_options.ConfidenceLowerBoundColumn, SchemaShape.Column.VectorKind.Vector, 350_options.ConfidenceUpperBoundColumn, SchemaShape.Column.VectorKind.Vector,
SsaSpikeDetector.cs (4)
280if (!inputSchema.TryFindColumn(_options.Source, out var col)) 285var metadata = new List<SchemaShape.Column>() { 286new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false) 290_options.Name, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Double, false, new SchemaShape(metadata));
Microsoft.ML.TorchSharp (82)
AutoFormerV2\ObjectDetectionTrainer.cs (34)
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, 462inputSchema.TryFindColumn(Option.LabelColumnName, out var labelCol); 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, 480if (!inputSchema.TryFindColumn(Option.LabelColumnName, out var labelCol)) 482if (labelCol.Kind != SchemaShape.Column.VectorKind.VariableVector || labelCol.ItemType.RawType != typeof(UInt32)) 486if (!inputSchema.TryFindColumn(Option.BoundingBoxColumnName, out var boundingBoxCol)) 488if (boundingBoxCol.Kind != SchemaShape.Column.VectorKind.VariableVector || boundingBoxCol.ItemType.RawType != typeof(Single)) 492if (!inputSchema.TryFindColumn(Option.ImageColumnName, out var imageCol)) 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); 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, 576if (!inputSchema.TryFindColumn(Options.ImageColumnName, out var imageCol))
NasBert\NasBertTrainer.cs (26)
328var metadata = new List<SchemaShape.Column>(); 329metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, 333inputSchema.TryFindColumn(Option.LabelColumnName, out var labelCol); 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, 348inputSchema.TryFindColumn(Option.LabelColumnName, out var labelCol); 350outColumns[Option.PredictionColumnName] = new SchemaShape.Column(Option.PredictionColumnName, SchemaShape.Column.VectorKind.VariableVector, 355outColumns[Option.ScoreColumnName] = new SchemaShape.Column(Option.ScoreColumnName, SchemaShape.Column.VectorKind.Scalar, 365if (!inputSchema.TryFindColumn(BertOptions.Sentence1ColumnName, out var sentenceCol)) 371if (!inputSchema.TryFindColumn(Option.LabelColumnName, out var labelCol)) 383if (!inputSchema.TryFindColumn(BertOptions.Sentence2ColumnName, out var sentenceCol2)) 402if (!inputSchema.TryFindColumn(BertOptions.Sentence2ColumnName, out var sentenceCol2)) 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); 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, 458if (!inputSchema.TryFindColumn(SentenceColumn.Name, out var sentenceCol)) 466if (!inputSchema.TryFindColumn(SentenceColumn2.Name, out var sentenceCol2))
Roberta\QATrainer.cs (22)
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, 531if (!inputSchema.TryFindColumn(Option.ContextColumnName, out var contextCol)) 533if (contextCol.Kind != SchemaShape.Column.VectorKind.Scalar || contextCol.ItemType.RawType != typeof(ReadOnlyMemory<char>)) 537if (!inputSchema.TryFindColumn(Option.QuestionColumnName, out var questionCol)) 539if (questionCol.Kind != SchemaShape.Column.VectorKind.Scalar || questionCol.ItemType.RawType != typeof(ReadOnlyMemory<char>)) 543if (!inputSchema.TryFindColumn(Option.TrainingAnswerColumnName, out var answerCol)) 545if (answerCol.Kind != SchemaShape.Column.VectorKind.Scalar || answerCol.ItemType.RawType != typeof(ReadOnlyMemory<char>)) 549if (!inputSchema.TryFindColumn(Option.AnswerIndexStartColumnName, out var answerIndexCol)) 551if (answerIndexCol.Kind != SchemaShape.Column.VectorKind.Scalar || answerIndexCol.ItemType.RawType != typeof(int)) 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, 617if (!inputSchema.TryFindColumn(Options.ContextColumnName, out var contextCol)) 623if (!inputSchema.TryFindColumn(Options.QuestionColumnName, out var questionCol))
Microsoft.ML.Transforms (122)
CountFeatureSelection.cs (6)
170if (!inputSchema.TryFindColumn(colPair.InputColumnName, out var col)) 174if (col.Kind == SchemaShape.Column.VectorKind.VariableVector) 176var metadata = new List<SchemaShape.Column>(); 177if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.SlotNames, out var slotMeta)) 179if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.CategoricalSlotRanges, out var categoricalSlotMeta)) 181if (col.IsNormalized() && col.Annotations.TryFindColumn(AnnotationUtils.Kinds.IsNormalized, out var isNormalizedAnnotation))
CustomMappingTransformer.cs (8)
262if (!result.TryGetValue(col.ColumnName, out var column)) 268|| vecKind == SchemaShape.Column.VectorKind.Scalar && column.Kind != SchemaShape.Column.VectorKind.Scalar 269|| vecKind == SchemaShape.Column.VectorKind.Vector && column.Kind != SchemaShape.Column.VectorKind.Vector 270|| vecKind == SchemaShape.Column.VectorKind.VariableVector && column.Kind == SchemaShape.Column.VectorKind.Scalar) 276foreach (var addedCol in addedSchemaShape)
Dracula\CountTableTransformer.cs (8)
325if (!inputSchema.TryFindColumn(_labelColumnName, out var labelCol)) 330if (!inputSchema.TryFindColumn(colInfo.InputColumnName, out var col)) 332if (col.Kind == SchemaShape.Column.VectorKind.VariableVector) 339var newMetadataKinds = new List<SchemaShape.Column>(); 340if (col.Kind == SchemaShape.Column.VectorKind.Scalar) 341newMetadataKinds.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false)); 342else if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.SlotNames, out var slotMeta)) 345result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false, meta);
ExpressionTransformer.cs (9)
119if (!inputSchema.TryFindColumn(inputColumnNames[isrc], out var col)) 122if (col.Kind != SchemaShape.Column.VectorKind.Scalar) 177if (!inputSchema.TryFindColumn(_columns[i].InputColumnNames[j], out var inputCol)) 190SchemaShape.Column.VectorKind outputVectorKind; 191var metadata = new List<SchemaShape.Column>(); 193outputVectorKind = SchemaShape.Column.VectorKind.Scalar; 196inputSchema.TryFindColumn(_columns[i].InputColumnNames[ivec], out var vectorCol); 200var b = vectorCol.Annotations.TryFindColumn(AnnotationUtils.Kinds.SlotNames, out var slotNames); 205var outputSchemaShapeColumn = new SchemaShape.Column(_columns[i].Name, outputVectorKind, typeRes, false, new SchemaShape(metadata));
GcnTransform.cs (6)
897internal static bool IsSchemaColumnValid(SchemaShape.Column col) 899if (col.Kind != SchemaShape.Column.VectorKind.Vector) 916if (!inputSchema.TryFindColumn(colPair.InputColumnName, out var col)) 920var metadata = new List<SchemaShape.Column>(); 921if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.SlotNames, out var slotMeta)) 923metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.IsNormalized, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false));
KeyToVectorMapping.cs (10)
473if (!inputSchema.TryFindColumn(colInfo.inputColumnName, out var col)) 478var metadata = new List<SchemaShape.Column>(); 479if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.KeyValues, out var keyMeta)) 480if (col.Kind != SchemaShape.Column.VectorKind.VariableVector && keyMeta.ItemType is TextDataViewType) 481metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, keyMeta.ItemType, false)); 482if (col.Kind == SchemaShape.Column.VectorKind.Scalar) 483metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.IsNormalized, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false)); 485col.Kind == SchemaShape.Column.VectorKind.VariableVector ? SchemaShape.Column.VectorKind.VariableVector : SchemaShape.Column.VectorKind.Vector,
MissingValueDroppingTransformer.cs (4)
45if (!inputSchema.TryFindColumn(inputColumnName, out var originalColumn)) 47if (originalColumn.Kind == SchemaShape.Column.VectorKind.Scalar) 51var col = new SchemaShape.Column(outputColumnName, SchemaShape.Column.VectorKind.VariableVector, originalColumn.ItemType, originalColumn.IsKey, originalColumn.Annotations);
MissingValueIndicatorTransformer.cs (4)
540if (!inputSchema.TryFindColumn(colPair.inputColumnName, out var col) || !Data.Conversion.Conversions.DefaultInstance.TryGetIsNAPredicate(col.ItemType, out Delegate del)) 542var metadata = new List<SchemaShape.Column>(); 543if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.SlotNames, out var slotMeta)) 545metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.IsNormalized, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false));
MissingValueReplacing.cs (4)
1040if (!inputSchema.TryFindColumn(colInfo.InputColumnName, out var col)) 1045var metadata = new List<SchemaShape.Column>(); 1046if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.SlotNames, out var slotMeta)) 1048if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.IsNormalized, out var normalized))
MutualInformationFeatureSelection.cs (7)
223if (!inputSchema.TryFindColumn(_labelColumnName, out var label)) 234if (!inputSchema.TryFindColumn(colPair.inputColumnName, out var col)) 241if (col.Kind == SchemaShape.Column.VectorKind.VariableVector) 243var metadata = new List<SchemaShape.Column>(); 244if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.SlotNames, out var slotMeta)) 246if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.CategoricalSlotRanges, out var categoricalSlotMeta)) 248if (col.IsNormalized() && col.Annotations.TryFindColumn(AnnotationUtils.Kinds.IsNormalized, out var isNormalizedAnnotation))
RandomFourierFeaturizing.cs (3)
728if (!inputSchema.TryFindColumn(colInfo.InputColumnName, out var col)) 730if (col.ItemType.RawType != typeof(float) || col.Kind != SchemaShape.Column.VectorKind.Vector) 733result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
StatefulCustomMappingTransformer.cs (8)
395if (!result.TryGetValue(col.ColumnName, out var column)) 401|| vecKind == SchemaShape.Column.VectorKind.Scalar && column.Kind != SchemaShape.Column.VectorKind.Scalar 402|| vecKind == SchemaShape.Column.VectorKind.Vector && column.Kind != SchemaShape.Column.VectorKind.Vector 403|| vecKind == SchemaShape.Column.VectorKind.VariableVector && column.Kind == SchemaShape.Column.VectorKind.Scalar) 409foreach (var addedCol in addedSchemaShape)
Text\LdaTransform.cs (3)
1326if (!inputSchema.TryFindColumn(colInfo.InputColumnName, out var col)) 1328if (col.ItemType.RawType != typeof(float) || col.Kind == SchemaShape.Column.VectorKind.Scalar) 1331result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
Text\NgramHashingTransformer.cs (6)
1194internal static bool IsSchemaColumnValid(SchemaShape.Column col) 1196if (col.Kind == SchemaShape.Column.VectorKind.Scalar) 1220if (!inputSchema.TryFindColumn(input, out var col)) 1225var metadata = new List<SchemaShape.Column>(); 1228metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false)); 1229result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false, new SchemaShape(metadata));
Text\NgramTransform.cs (6)
970internal static bool IsSchemaColumnValid(SchemaShape.Column col) 972if (col.Kind == SchemaShape.Column.VectorKind.Scalar) 1083if (!inputSchema.TryFindColumn(colInfo.InputColumnName, out var col)) 1087var metadata = new List<SchemaShape.Column>(); 1089metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false)); 1090result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false, new SchemaShape(metadata));
Text\StopWordsRemovingTransformer.cs (6)
675if (!inputSchema.TryFindColumn(colInfo.InputColumnName, out var col)) 677if (col.Kind == SchemaShape.Column.VectorKind.Scalar || !(col.ItemType is TextDataViewType)) 679result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.VariableVector, TextDataViewType.Instance, false); 1243if (!inputSchema.TryFindColumn(colInfo.inputColumnName, out var col)) 1245if (col.Kind == SchemaShape.Column.VectorKind.Scalar || !(col.ItemType is TextDataViewType)) 1247result[colInfo.outputColumnName] = new SchemaShape.Column(colInfo.outputColumnName, SchemaShape.Column.VectorKind.VariableVector, TextDataViewType.Instance, false);
Text\TextFeaturizingEstimator.cs (6)
637if (!inputSchema.TryFindColumn(srcName, out var col)) 643var metadata = new List<SchemaShape.Column>(2); 644metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false)); 646metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.IsNormalized, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false)); 648result[OutputColumn] = new SchemaShape.Column(OutputColumn, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false, 654result[name] = new SchemaShape.Column(name, SchemaShape.Column.VectorKind.VariableVector, TextDataViewType.Instance, false);
Text\TextNormalizing.cs (4)
584if (!inputSchema.TryFindColumn(colInfo.inputColumnName, out var col)) 588result[colInfo.outputColumnName] = new SchemaShape.Column(colInfo.outputColumnName, col.Kind == SchemaShape.Column.VectorKind.Scalar ? SchemaShape.Column.VectorKind.Scalar : SchemaShape.Column.VectorKind.VariableVector, col.ItemType, false);
Text\TokenizingByCharacters.cs (6)
688if (!inputSchema.TryFindColumn(colInfo.inputColumnName, out var col)) 692var metadata = new List<SchemaShape.Column>(); 693if (col.Annotations.TryFindColumn(AnnotationUtils.Kinds.SlotNames, out var slotMeta)) 694metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, slotMeta.ItemType, false)); 695metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false)); 696result[colInfo.outputColumnName] = new SchemaShape.Column(colInfo.outputColumnName, SchemaShape.Column.VectorKind.VariableVector, NumberDataViewType.UInt16, true, new SchemaShape(metadata.ToArray()));
Text\WordBagTransform.cs (2)
191if (!inputSchema.TryFindColumn(_columnName, out SchemaShape.Column outCol) && outCol.ItemType != TextDataViewType.Instance) 475if (inputSchema.TryFindColumn(col.Source, out var colShape) &&
Text\WordEmbeddingsExtractor.cs (4)
936if (!inputSchema.TryFindColumn(colInfo.InputColumnName, out var col)) 938if (!(col.ItemType is TextDataViewType) || (col.Kind != SchemaShape.Column.VectorKind.VariableVector && col.Kind != SchemaShape.Column.VectorKind.Vector)) 941result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false);
Text\WordTokenizing.cs (2)
536if (!inputSchema.TryFindColumn(colInfo.InputColumnName, out var col)) 540result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.VariableVector, col.ItemType, false);
Microsoft.ML.Vision (10)
DnnRetrainTransform.cs (4)
1261if (!inputSchema.TryFindColumn(input, out var col)) 1263if (!(col.Kind == SchemaShape.Column.VectorKind.Vector)) 1272_outputTypes[i].IsKnownSizeVector() ? SchemaShape.Column.VectorKind.Vector 1273: SchemaShape.Column.VectorKind.VariableVector, _outputTypes[i].GetItemType(), false);
ImageClassificationTrainer.cs (6)
527new SchemaShape.Column(options.FeatureColumnName, SchemaShape.Column.VectorKind.VariableVector, 632private protected override SchemaShape.Column[] GetOutputColumnsCore(SchemaShape inputSchema) 636var metadata = new List<SchemaShape.Column>(); 637metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, 642new SchemaShape.Column(_options.ScoreColumnName, SchemaShape.Column.VectorKind.Vector, 644new SchemaShape.Column(_options.PredictedLabelColumnName, SchemaShape.Column.VectorKind.Scalar,