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)
255
new SchemaShape.
Column
())
LightGbmMulticlassTrainer.cs (1)
194
new SchemaShape.
Column
())
LightGbmRankingTrainer.cs (1)
238
new SchemaShape.
Column
())
LightGbmRegressionTrainer.cs (1)
213
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)
313
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
317
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
318
new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
319
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)
184
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
188
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
189
new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
190
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)
183
SchemaShape.
Column
label,
209
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)
379
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
383
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
384
new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.
Column
.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
RandomForestRegression.cs (2)
505
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
509
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)
309
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
314
SchemaShape.
Column
.VectorKind.Vector,
320
SchemaShape.
Column
.VectorKind.Scalar,
Microsoft.ML.LightGbm (16)
LightGbmBinaryTrainer.cs (4)
288
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
292
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
293
new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
294
new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.
Column
.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
LightGbmMulticlassTrainer.cs (4)
369
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
371
SchemaShape.
Column
labelCol = default;
381
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Vector, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.AnnotationsForMulticlassScoreColumn(labelCol))),
382
new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.UInt32, true, metadata)
LightGbmRankingTrainer.cs (4)
271
private protected override void CheckLabelCompatible(SchemaShape.
Column
labelCol)
278
if (labelCol.Kind != SchemaShape.
Column
.VectorKind.Scalar)
301
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
305
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
LightGbmRegressionTrainer.cs (2)
247
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
251
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
LightGbmTrainerBase.cs (2)
367
SchemaShape.
Column
labelColumn,
390
private protected LightGbmTrainerBase(IHostEnvironment env, string name, TOptions options, SchemaShape.
Column
label)
Microsoft.ML.Mkl.Components (7)
OlsLinearRegression.cs (2)
137
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
141
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
SymSgdClassificationTrainer.cs (4)
280
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
284
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
285
new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
286
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)
1066
if (!inputSchema.TryFindColumn(input, out
var
col))
1083
Transformer.OutputTypes[i].IsKnownSizeVector() ? SchemaShape.
Column
.VectorKind.Vector
1084
: SchemaShape.
Column
.VectorKind.VariableVector, Transformer.OutputTypes[i].GetItemType(), false);
Microsoft.ML.PCA (10)
PcaTrainer.cs (7)
214
private static SchemaShape.
Column
MakeWeightColumn(string weightColumn)
218
return new SchemaShape.Column(weightColumn, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false);
221
private static SchemaShape.
Column
MakeFeatureColumn(string featureColumn)
223
return new SchemaShape.Column(featureColumn, SchemaShape.
Column
.VectorKind.Vector, NumberDataViewType.Single, false);
388
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
393
SchemaShape.
Column
.VectorKind.Scalar,
399
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)
571
void CheckColumnsCompatible(SchemaShape.
Column
cachedColumn, string columnRole)
573
if (!inputSchema.TryFindColumn(cachedColumn.Name, out
var
col))
582
var
labelColumn = new SchemaShape.Column(LabelName, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false);
586
var
matrixColumnIndexColumn = new SchemaShape.Column(MatrixColumnIndexName, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.UInt32, true);
587
var
matrixRowIndexColumn = new SchemaShape.Column(MatrixRowIndexName, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.UInt32, true);
595
foreach (
var
col in GetOutputColumnsCore(inputSchema))
601
private SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
603
bool success = inputSchema.TryFindColumn(LabelName, out
var
labelCol);
608
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
Microsoft.ML.StandardTrainers (113)
FactorizationMachine\FactorizationMachineTrainer.cs (22)
195
internal readonly SchemaShape.
Column
[] FeatureColumns;
201
internal readonly SchemaShape.
Column
LabelColumn;
207
internal readonly SchemaShape.
Column
WeightColumn;
240
FeatureColumns = new SchemaShape.
Column
[1 + extraColumnLength];
243
FeatureColumns[0] = new SchemaShape.Column(options.FeatureColumnName, SchemaShape.
Column
.VectorKind.Vector, NumberDataViewType.Single, false);
247
FeatureColumns[i + 1] = new SchemaShape.Column(options.ExtraFeatureColumns[i], SchemaShape.
Column
.VectorKind.Vector, NumberDataViewType.Single, false);
249
LabelColumn = new SchemaShape.Column(options.LabelColumnName, SchemaShape.
Column
.VectorKind.Scalar, BooleanDataViewType.Instance, false);
250
WeightColumn = options.ExampleWeightColumnName != null ? new SchemaShape.Column(options.ExampleWeightColumnName, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false) : default;
273
FeatureColumns = new SchemaShape.
Column
[featureColumnNames.Length];
276
FeatureColumns[i] = new SchemaShape.Column(featureColumnNames[i], SchemaShape.
Column
.VectorKind.Vector, NumberDataViewType.Single, false);
278
LabelColumn = new SchemaShape.Column(labelColumnName, SchemaShape.
Column
.VectorKind.Scalar, BooleanDataViewType.Instance, false);
279
WeightColumn = exampleWeightColumnName != null ? new SchemaShape.Column(exampleWeightColumnName, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false) : default;
604
foreach (
var
feat in FeatureColumns)
636
void CheckColumnsCompatible(SchemaShape.
Column
column, string columnRole)
639
if (!inputSchema.TryFindColumn(column.Name, out
var
col))
649
foreach (
var
feat in FeatureColumns)
658
foreach (
var
col in GetOutputColumnsCore(inputSchema))
664
private SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
666
bool success = inputSchema.TryFindColumn(LabelColumn.Name, out
var
labelCol);
671
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
672
new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
673
new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.
Column
.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
LdSvm\LdSvmTrainer.cs (3)
191
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
195
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
196
new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.
Column
.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\LogisticRegression\LbfgsPredictorBase.cs (3)
215
SchemaShape.
Column
labelColumn,
239
SchemaShape.
Column
labelColumn,
294
private static TOptions ArgsInit(string featureColumn, SchemaShape.
Column
labelColumn,
Standard\LogisticRegression\LogisticRegression.cs (4)
171
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
175
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
176
new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
177
new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.
Column
.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\LogisticRegression\MulticlassLogisticRegression.cs (4)
370
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
372
bool success = inputSchema.TryFindColumn(LabelColumn.Name, out
var
labelCol);
379
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Vector, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.AnnotationsForMulticlassScoreColumn(labelCol))),
380
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)
310
private protected AveragedLinearTrainer(AveragedLinearOptions options, IHostEnvironment env, string name, SchemaShape.
Column
label)
Standard\Online\AveragedPerceptron.cs (3)
197
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
202
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
203
new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.
Column
.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\Online\LinearSvm.cs (3)
322
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
326
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
327
new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.
Column
.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
Standard\Online\OnlineGradientDescent.cs (2)
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()))
Standard\Online\OnlineLinear.cs (1)
263
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,
293
private static TOptions ArgsInit(string featureColumnName, SchemaShape.
Column
labelColumn)
302
internal SdcaTrainerBase(IHostEnvironment env, string featureColumnName, SchemaShape.
Column
labelColumn,
303
SchemaShape.
Column
weight = default, float? l2Const = null,
309
internal SdcaTrainerBase(IHostEnvironment env, TOptions options, SchemaShape.
Column
label, SchemaShape.
Column
weight = default,
1456
private readonly SchemaShape.
Column
[] _outputColumns;
1458
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema) => _outputColumns;
1526
private protected abstract SchemaShape.
Column
[] ComputeSdcaBinaryClassifierSchemaShape();
1623
private protected override SchemaShape.
Column
[] ComputeSdcaBinaryClassifierSchemaShape()
1625
return new SchemaShape.
Column
[]
1629
SchemaShape.
Column
.VectorKind.Scalar,
1635
SchemaShape.
Column
.VectorKind.Scalar,
1641
SchemaShape.
Column
.VectorKind.Scalar,
1720
private protected override SchemaShape.
Column
[] ComputeSdcaBinaryClassifierSchemaShape()
1722
return new SchemaShape.
Column
[]
1726
SchemaShape.
Column
.VectorKind.Scalar,
1733
SchemaShape.
Column
.VectorKind.Scalar,
1778
private protected override SchemaShape.
Column
[] ComputeSdcaBinaryClassifierSchemaShape()
1780
var outCols = new List<SchemaShape.
Column
>()
1784
SchemaShape.
Column
.VectorKind.Scalar,
1791
SchemaShape.
Column
.VectorKind.Scalar,
1802
SchemaShape.
Column
.VectorKind.Scalar,
2301
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
2305
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
2306
new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
2307
new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.
Column
.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
2390
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
2394
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
2395
new SchemaShape.Column(DefaultColumnNames.PredictedLabel, SchemaShape.
Column
.VectorKind.Scalar, BooleanDataViewType.Instance, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation()))
2444
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
2448
new SchemaShape.Column(DefaultColumnNames.Score, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation())),
2449
new SchemaShape.Column(DefaultColumnNames.Probability, SchemaShape.
Column
.VectorKind.Scalar, NumberDataViewType.Single, false, new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))),
2450
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)
191
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
195
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)
460
var metadata = new List<SchemaShape.
Column
>();
461
metadata.Add(new SchemaShape.Column(Kinds.KeyValues, SchemaShape.
Column
.VectorKind.Vector,
464
var scoreMetadata = new List<SchemaShape.
Column
>();
466
scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreColumnKind, SchemaShape.
Column
.VectorKind.Scalar,
468
scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreValueKind, SchemaShape.
Column
.VectorKind.Scalar,
470
scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreColumnSetId, SchemaShape.
Column
.VectorKind.Scalar,
472
scoreMetadata.Add(new SchemaShape.Column(Kinds.TrainingLabelValues, SchemaShape.
Column
.VectorKind.Vector,
476
inputSchema.TryFindColumn(Option.LabelColumnName, out
var
labelCol);
478
outColumns[Option.PredictedLabelColumnName] = new SchemaShape.Column(Option.PredictedLabelColumnName, SchemaShape.
Column
.VectorKind.VariableVector,
481
outColumns[Option.PredictedBoundingBoxColumnName] = new SchemaShape.Column(Option.PredictedBoundingBoxColumnName, SchemaShape.
Column
.VectorKind.VariableVector,
484
outColumns[Option.ScoreColumnName] = new SchemaShape.Column(Option.ScoreColumnName, SchemaShape.
Column
.VectorKind.VariableVector,
494
if (!inputSchema.TryFindColumn(Option.LabelColumnName, out
var
labelCol))
496
if (labelCol.Kind != SchemaShape.
Column
.VectorKind.VariableVector || labelCol.ItemType.RawType != typeof(UInt32))
500
if (!inputSchema.TryFindColumn(Option.BoundingBoxColumnName, out
var
boundingBoxCol))
502
if (boundingBoxCol.Kind != SchemaShape.
Column
.VectorKind.VariableVector || boundingBoxCol.ItemType.RawType != typeof(Single))
506
if (!inputSchema.TryFindColumn(Option.ImageColumnName, out
var
imageCol))
520
public readonly SchemaShape.
Column
PredictedLabelColumnName;
521
public readonly SchemaShape.
Column
PredictedBoundingBoxColumn;
522
public readonly SchemaShape.
Column
ConfidenceColumn;
542
PredictedLabelColumnName = new SchemaShape.Column(Options.PredictedLabelColumnName, SchemaShape.
Column
.VectorKind.Vector, NumberDataViewType.UInt32, false);
543
PredictedBoundingBoxColumn = new SchemaShape.Column(Options.PredictedBoundingBoxColumnName, SchemaShape.
Column
.VectorKind.Vector, NumberDataViewType.Single, false);
544
ConfidenceColumn = new SchemaShape.Column(Options.ScoreColumnName, SchemaShape.
Column
.VectorKind.Vector, NumberDataViewType.Single, false);
561
var
labelAnnotationsColumn = new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.
Column
.VectorKind.Vector, LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.SlotNames].Type, false);
562
var predLabelMetadata = new SchemaShape(new SchemaShape.
Column
[] { labelAnnotationsColumn }
565
var scoreMetadata = new List<SchemaShape.
Column
>();
567
scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreColumnKind, SchemaShape.
Column
.VectorKind.Scalar,
569
scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreValueKind, SchemaShape.
Column
.VectorKind.Scalar,
571
scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreColumnSetId, SchemaShape.
Column
.VectorKind.Scalar,
573
scoreMetadata.Add(new SchemaShape.Column(Kinds.TrainingLabelValues, SchemaShape.
Column
.VectorKind.Vector,
576
outColumns[Options.PredictedLabelColumnName] = new SchemaShape.Column(Options.PredictedLabelColumnName, SchemaShape.
Column
.VectorKind.VariableVector,
579
outColumns[Options.PredictedBoundingBoxColumnName] = new SchemaShape.Column(Options.PredictedBoundingBoxColumnName, SchemaShape.
Column
.VectorKind.VariableVector,
582
outColumns[Options.ScoreColumnName] = new SchemaShape.Column(Options.ScoreColumnName, SchemaShape.
Column
.VectorKind.VariableVector,
590
if (!inputSchema.TryFindColumn(Options.ImageColumnName, out
var
imageCol))
NasBert\NasBertTrainer.cs (26)
350
var metadata = new List<SchemaShape.
Column
>();
351
metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.
Column
.VectorKind.Vector,
355
inputSchema.TryFindColumn(Option.LabelColumnName, out
var
labelCol);
357
outColumns[Option.PredictionColumnName] = new SchemaShape.Column(Option.PredictionColumnName, SchemaShape.
Column
.VectorKind.Scalar,
360
outColumns[Option.ScoreColumnName] = new SchemaShape.Column(Option.ScoreColumnName, SchemaShape.
Column
.VectorKind.Vector,
365
var metadata = new List<SchemaShape.
Column
>();
366
metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.
Column
.VectorKind.Vector,
370
inputSchema.TryFindColumn(Option.LabelColumnName, out
var
labelCol);
372
outColumns[Option.PredictionColumnName] = new SchemaShape.Column(Option.PredictionColumnName, SchemaShape.
Column
.VectorKind.VariableVector,
377
outColumns[Option.ScoreColumnName] = new SchemaShape.Column(Option.ScoreColumnName, SchemaShape.
Column
.VectorKind.Scalar,
387
if (!inputSchema.TryFindColumn(BertOptions.Sentence1ColumnName, out
var
sentenceCol))
393
if (!inputSchema.TryFindColumn(Option.LabelColumnName, out
var
labelCol))
405
if (!inputSchema.TryFindColumn(BertOptions.Sentence2ColumnName, out
var
sentenceCol2))
424
if (!inputSchema.TryFindColumn(BertOptions.Sentence2ColumnName, out
var
sentenceCol2))
438
public readonly SchemaShape.
Column
SentenceColumn;
439
public readonly SchemaShape.
Column
SentenceColumn2;
445
SentenceColumn = new SchemaShape.Column(options.Sentence1ColumnName, SchemaShape.
Column
.VectorKind.Scalar, TextDataViewType.Instance, false);
446
SentenceColumn2 = options.Sentence2ColumnName == default ? default : new SchemaShape.Column(options.Sentence2ColumnName, SchemaShape.
Column
.VectorKind.Scalar, TextDataViewType.Instance, false);
458
var
labelAnnotationsColumn = new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.
Column
.VectorKind.Vector, LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.SlotNames].Type, false);
459
var predLabelMetadata = new SchemaShape(new SchemaShape.
Column
[] { labelAnnotationsColumn }
462
outColumns[Options.PredictionColumnName] = new SchemaShape.Column(Options.PredictionColumnName, SchemaShape.
Column
.VectorKind.Scalar,
465
outColumns[ScoreColumnName] = new SchemaShape.Column(ScoreColumnName, SchemaShape.
Column
.VectorKind.Vector,
470
outColumns[ScoreColumnName] = new SchemaShape.Column(ScoreColumnName, SchemaShape.
Column
.VectorKind.Scalar,
480
if (!inputSchema.TryFindColumn(SentenceColumn.Name, out
var
sentenceCol))
488
if (!inputSchema.TryFindColumn(SentenceColumn2.Name, out
var
sentenceCol2))
Roberta\QATrainer.cs (22)
517
var scoreMetadata = new List<SchemaShape.
Column
>();
519
scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreColumnKind, SchemaShape.
Column
.VectorKind.Scalar,
521
scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreValueKind, SchemaShape.
Column
.VectorKind.Scalar,
523
scoreMetadata.Add(new SchemaShape.Column(Kinds.ScoreColumnSetId, SchemaShape.
Column
.VectorKind.Scalar,
526
outColumns[Option.PredictedAnswerColumnName] = new SchemaShape.Column(Option.PredictedAnswerColumnName, SchemaShape.
Column
.VectorKind.VariableVector,
529
outColumns[Option.ScoreColumnName] = new SchemaShape.Column(Option.ScoreColumnName, SchemaShape.
Column
.VectorKind.VariableVector,
538
if (!inputSchema.TryFindColumn(Option.ContextColumnName, out
var
contextCol))
540
if (contextCol.Kind != SchemaShape.
Column
.VectorKind.Scalar || contextCol.ItemType.RawType != typeof(ReadOnlyMemory<char>))
544
if (!inputSchema.TryFindColumn(Option.QuestionColumnName, out
var
questionCol))
546
if (questionCol.Kind != SchemaShape.
Column
.VectorKind.Scalar || questionCol.ItemType.RawType != typeof(ReadOnlyMemory<char>))
550
if (!inputSchema.TryFindColumn(Option.TrainingAnswerColumnName, out
var
answerCol))
552
if (answerCol.Kind != SchemaShape.
Column
.VectorKind.Scalar || answerCol.ItemType.RawType != typeof(ReadOnlyMemory<char>))
556
if (!inputSchema.TryFindColumn(Option.AnswerIndexStartColumnName, out
var
answerIndexCol))
558
if (answerIndexCol.Kind != SchemaShape.
Column
.VectorKind.Scalar || answerIndexCol.ItemType.RawType != typeof(int))
603
var scoreMetadata = new List<SchemaShape.
Column
>
605
new SchemaShape.Column(Kinds.ScoreColumnKind, SchemaShape.
Column
.VectorKind.Scalar,
607
new SchemaShape.Column(Kinds.ScoreValueKind, SchemaShape.
Column
.VectorKind.Scalar,
609
new SchemaShape.Column(Kinds.ScoreColumnSetId, SchemaShape.
Column
.VectorKind.Scalar,
613
outColumns[Options.PredictedAnswerColumnName] = new SchemaShape.Column(Options.PredictedAnswerColumnName, SchemaShape.
Column
.VectorKind.VariableVector,
616
outColumns[Options.ScoreColumnName] = new SchemaShape.Column(Options.ScoreColumnName, SchemaShape.
Column
.VectorKind.VariableVector,
624
if (!inputSchema.TryFindColumn(Options.ContextColumnName, out
var
contextCol))
630
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)
648
if (!inputSchema.TryFindColumn(srcName, out
var
col))
654
var metadata = new List<SchemaShape.
Column
>(2);
655
metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.
Column
.VectorKind.Vector, TextDataViewType.Instance, false));
657
metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.IsNormalized, SchemaShape.
Column
.VectorKind.Scalar, BooleanDataViewType.Instance, false));
659
result[OutputColumn] = new SchemaShape.Column(OutputColumn, SchemaShape.
Column
.VectorKind.Vector, NumberDataViewType.Single, false,
665
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)
1260
if (!inputSchema.TryFindColumn(input, out
var
col))
1262
if (!(col.Kind == SchemaShape.
Column
.VectorKind.Vector))
1271
_outputTypes[i].IsKnownSizeVector() ? SchemaShape.
Column
.VectorKind.Vector
1272
: SchemaShape.
Column
.VectorKind.VariableVector, _outputTypes[i].GetItemType(), false);
ImageClassificationTrainer.cs (6)
550
new SchemaShape.Column(options.FeatureColumnName, SchemaShape.
Column
.VectorKind.VariableVector,
655
private protected override SchemaShape.
Column
[] GetOutputColumnsCore(SchemaShape inputSchema)
659
var metadata = new List<SchemaShape.
Column
>();
660
metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.
Column
.VectorKind.Vector,
665
new SchemaShape.Column(_options.ScoreColumnName, SchemaShape.
Column
.VectorKind.Vector,
667
new SchemaShape.Column(_options.PredictedLabelColumnName, SchemaShape.
Column
.VectorKind.Scalar,