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