1 write to Type
Microsoft.ML.DataView (1)
DataViewSchema.cs (1)
115Type = type ?? throw new ArgumentNullException(nameof(type));
694 references to Type
DnnAnalyzer (3)
DnnAnalyzer.cs (3)
38var type = schema[i].Type; 40var metadataType = schema[i].Annotations.Schema.GetColumnOrNull("TensorflowOperatorType")?.Type; 43metadataType = schema[i].Annotations.Schema.GetColumnOrNull("TensorflowUpstreamOperators")?.Type;
Microsoft.Data.Analysis (1)
IDataView.Extension.cs (1)
66DataViewType type = dataViewColumn.Type;
Microsoft.ML.AutoML (19)
API\AutoCatalog.cs (2)
823&& data.Schema[c.ColumnIndex].Type != BooleanDataViewType.Instance 824&& !(data.Schema[c.ColumnIndex].Type is VectorDataViewType vt && vt.ItemType == BooleanDataViewType.Instance)).ToArray();
ColumnInference\ColumnTypeInference.cs (1)
278var colType = column.Type;
ColumnInference\PurposeInference.cs (1)
73_type = new Lazy<DataViewType>(() => _data.Schema[_columnId].Type);
DatasetDimensions\DatasetDimensionsApi.cs (2)
28var itemType = column.Type.GetItemType(); 39hasMissing = column.Type.IsVector() ?
Utils\DatasetColumnInfo.cs (1)
35var col = new DatasetColumnInfo(schemaCol.Name, schemaCol.Type, purposes[i].Purpose, colDimensions[i]);
Utils\UserInputValidationUtil.cs (12)
83if (column.Name == DefaultColumnNames.Features && column.Type.GetItemType() != NumberDataViewType.Single) 93column.Type.GetItemType() != BooleanDataViewType.Instance && 94column.Type.GetItemType() != NumberDataViewType.Single && 95column.Type.GetItemType() != TextDataViewType.Instance) 99$"Please change the feature column {column.Name} of type {column.Type} to one of " + 220if (trainCol.Type != validCol.Value.Type && !trainCol.Type.Equals(validCol.Value.Type)) 222throw new ArgumentException($"{schemaMismatchError} Column '{trainCol.Name}' is of type {trainCol.Type} in train data, and type " + 223$"{validCol.Value.Type} in validation data.", nameof(validationData)); 268var itemType = column.Type.GetItemType();
Microsoft.ML.AutoML.Tests (8)
AutoFitTests.cs (5)
290Assert.Equal(NumberDataViewType.Single, scoredData.Schema[DefaultColumnNames.PredictedLabel].Type); 322Assert.Equal(NumberDataViewType.Single, scoredData.Schema[DefaultColumnNames.PredictedLabel].Type); 353Assert.Equal(TextDataViewType.Instance, scoredData.Schema[DefaultColumnNames.PredictedLabel].Type); 376Assert.Equal(TextDataViewType.Instance, scoredData.Schema[DefaultColumnNames.PredictedLabel].Type); 404Assert.Equal(TextDataViewType.Instance, scoredData.Schema[DefaultColumnNames.PredictedLabel].Type);
TransformInferenceTests.cs (2)
786Assert.True(featuresCol.Value.Type.IsVector()); 787Assert.Equal(NumberDataViewType.Single, featuresCol.Value.Type.GetItemType());
Utils\MLNetUtils\DataViewTestFixture.cs (1)
20return BuildDummyDataView(schema.Select(c => (c.Name, c.Type)), createDummyRow);
Microsoft.ML.CodeGenerator (1)
Utils.cs (1)
76var getGenericGetGetterMethod = getGetGetterMethod.MakeGenericMethod(featureColumns[i].Type.RawType);
Microsoft.ML.Core (9)
Data\AnnotationUtils.cs (7)
226var columnType = schema[col].Annotations.Schema.GetColumnOrNull(annotationKind)?.Type; 250var columnType = schema[col].Annotations.Schema.GetColumnOrNull(annotationKind)?.Type; 269var columnType = schema[col].Annotations.Schema.GetColumnOrNull(annotationKind)?.Type; 293&& metaColumn.Value.Type is VectorDataViewType vectorType 363var annotationType = schema[col].Annotations.Schema.GetColumnOrNull(kind)?.Type; 385if (!(schema[colIndex].Type is VectorDataViewType vecType && vecType.Size > 0)) 388var type = schema[colIndex].Annotations.Schema.GetColumnOrNull(Kinds.CategoricalSlotRanges)?.Type;
Data\IEstimator.cs (2)
191GetColumnTypeShape(annotationColumn.Type, out var mVecKind, out var mItemType, out var mIsKey); 196GetColumnTypeShape(schema[iCol].Type, out var vecKind, out var itemType, out var isKey);
Microsoft.ML.Core.Tests (21)
UnitTests\CoreBaseTestClass.cs (4)
258var type1 = curs1.Schema[col].Type; 259var type2 = curs2.Schema[col].Type; 347var type1 = curs1.Schema[col].Type; 348var type2 = cursors[col].Schema[col].Type;
UnitTests\ScoreSchemaTest.cs (9)
51var actualScoreColumnType = scoreColumn.Type as KeyDataViewType; 66Assert.True(scoreMetadata.Schema[0].Type is VectorDataViewType); 67Assert.Equal(keyNames.Length, (scoreMetadata.Schema[0].Type as VectorDataViewType).Size); 68Assert.Equal(TextDataViewType.Instance, (scoreMetadata.Schema[0].Type as VectorDataViewType).ItemType); 69Assert.Equal(TextDataViewType.Instance, scoreColumn.Annotations.Schema[1].Type); 70Assert.Equal(TextDataViewType.Instance, scoreColumn.Annotations.Schema[2].Type); 108var actualScoreColumnType = scoreColumn.Type as KeyDataViewType; 122Assert.Equal(TextDataViewType.Instance, scoreColumn.Annotations.Schema[0].Type); 123Assert.Equal(TextDataViewType.Instance, scoreColumn.Annotations.Schema[1].Type);
UnitTests\TestCustomTypeRegister.cs (1)
112/// It usually shows up as <see cref="DataViewSchema.Column.Type"/> among <see cref="IDataView.Schema"/>.
UnitTests\TestEntryPoints.cs (5)
1633var type = binaryScored.Schema[scoreCol.Value.Index].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.ScoreColumnKind)?.Type; 1642type = regressionScored.Schema[scoreCol.Value.Index].Annotations.Schema[AnnotationUtils.Kinds.ScoreColumnKind].Type; 1650type = anomalyScored.Schema[scoreCol.Value.Index].Annotations.Schema[AnnotationUtils.Kinds.ScoreColumnKind].Type; 5406var type = schema["Count"].Annotations.Schema[AnnotationUtils.Kinds.SlotNames].Type; 6576Assert.Equal(10, (schema[2].Type as VectorDataViewType)?.Size);
UnitTests\TestModelLoad.cs (2)
54Assert.Equal(9, (result.Schema[1].Type as VectorDataViewType)?.Size); 55Assert.Equal(18, (result.Schema[2].Type as VectorDataViewType)?.Size);
Microsoft.ML.Data (313)
Commands\CrossValidationCommand.cs (1)
302var type = schema[index].Type;
Commands\DataCommand.cs (1)
166var type = cursor.Schema[currentIndex].Type;
Commands\SaveDataCommand.cs (2)
150var type = data.Schema[i].Type; 212var type = view.Schema[i].Type;
Commands\ScoreCommand.cs (1)
190var type = loader.Schema[i].Type;
Commands\ShowSchemaCommand.cs (3)
140var type = schema[col].Type; 156if ((typeNames = schema[col].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type) == null) 193var type = metaColumn.Type;
Data\DataViewUtils.cs (10)
185var type = schema[col].Type; 205if (!IsCacheable(col.Type)) 355DataViewType type = schema[c].Type; 540ch.Assert(column.Type.IsCacheable()); 542Utils.MarshalInvoke(_createInPipeMethodInfo, this, column.Type.RawType, input, activeToCol[c]); 544outPipes[i][c] = inPipe.CreateOutPipe(column.Type); 1244return Utils.MarshalInvoke(_createGetterMethodInfo, this, Schema[col].Type.RawType, col); 1250var type = Schema[col].Type; 1257Ch.Assert(type.Equals(cursor.Schema[col].Type)); 1338var colType = cursor.Schema[srcColIndex].Type;
Data\RowCursorUtils.cs (9)
39return Utils.MarshalInvoke(_getGetterAsDelegateCoreMethodInfo, row.Schema[col].Type.RawType, row, col); 61var typeSrc = row.Schema[col].Type; 82var typeSrc = row.Schema[col].Type; 127var typeSrc = row.Schema[col].Type; 160var typeSrc = row.Schema[col].Type as VectorDataViewType; 180var typeSrc = row.Schema[col].Type as VectorDataViewType; 308DataViewType type = cursor.Schema[col].Type; 354var type = cursor.Schema[labelIndex].Type; 376var type = cursor.Schema[labelIndex].Type;
Data\SchemaAnnotationsExtensions.cs (4)
23=> column.Type is VectorDataViewType vectorType 51if (!(column.Type.GetItemType() is KeyDataViewType keyType)) 60&& metaColumn.Value.Type is VectorDataViewType vectorType 83if (metaColumn == null || !(metaColumn.Value.Type is BooleanDataViewType))
DataDebuggerPreview.cs (2)
48setters[i] = Utils.MarshalInvoke(_makeSetterMethodInfo, this, data.Schema[i].Type.RawType, cursor, i); 105public override string ToString() => $"{Column.Name}: {Column.Type}";
DataLoadSave\Binary\BinaryLoader.cs (1)
991.Select(x => new { col = x, isSavable = saver.IsColumnSavable(schema[x].Type) });
DataLoadSave\Binary\BinarySaver.cs (5)
284_host.Check(metaColumn.Type != null, "Metadata with null type detected, disallowed"); 288args[4] = metaColumn.Type; 289IValueCodec codec = (IValueCodec)methInfo.MakeGenericMethod(metaColumn.Type.RawType).Invoke(this, args); 294metaColumn.Type, schema[col].Name, col, metaColumn.Name); 718DataViewType type = schema[colIndices[c]].Type;
DataLoadSave\DataOperationsCatalog.cs (3)
230var type = input.Schema[columnName].Type; 264var type = input.Schema[columnName].Type; 558var type = data.Schema[samplingColIndex].Type;
DataLoadSave\Text\TextSaver.cs (6)
64DataViewType type = cursor.Schema[col].Type; 167&& (typeNames = cursor.Schema[source].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType) != null 402DataViewType itemType = data.Schema[cols[i]].Type.GetItemType(); 414var type = data.Schema[cols[i]].Type; 422var typeNames = data.Schema[cols[i]].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 478var type = schema[src].Type;
DataLoadSave\Transpose\TransposeLoader.cs (11)
297var ttype = schema[0].Type; 312var type = _parent.Schema[_col].Type; 553env.Assert(Enumerable.Range(0, schema.Count).All(c => saver.IsColumnSavable(schema[c].Type))); 614return view.Schema[0].Type as VectorDataViewType; 682Ch.Assert(cursor.Schema[0].Type.RawType == typeof(VBuffer<T>)); 683Ch.Assert(cursor.Schema[0].Type is VectorDataViewType); 690=> (VectorDataViewType)_rowCursor.Schema[0].Type; 738_host.Assert((trans as ITransposeDataView)?.GetSlotType(0).GetValueCount() == Schema[col].Type.GetValueCount()); 798var type = Schema[col].Type; 813var type = Schema[col].Type; 833var type = Schema[col].Type;
DataView\AppendRowsDataView.cs (3)
118DataViewType type = Schema[c].Type; 124_host.Check(schema[c].Type.SameSizeAndItemType(type), errMsg); 182DataViewType colType = Schema[col].Type;
DataView\CacheDataView.cs (6)
134var type = schema[c].Type; 1221return Utils.MarshalInvoke(_createGetterDelegateMethodInfo, this, Schema[col].Type.RawType, col); 1228Ch.Assert(Schema[col].Type.RawType == typeof(TValue)); 1287var type = input.Schema[srcCol].Type; 1350var type = input.Schema[srcCol].Type; 1470Contracts.Assert(input.Schema[srcCol].Type.RawType == typeof(T));
DataView\DataViewConstructionUtils.cs (4)
79schemaDefinitionCol.ColumnType = col.Type; 86var info = Utils.MarshalInvoke(_getAnnotationInfoMethodInfo, annotation.Type.RawType, annotation.Name, annotations); 106return new AnnotationInfo<T>(kind, value, annotations.Schema[kind].Type); 230_getters[c] = predicate(c) ? CreateGetter(schema[c].Type, schemaDef.Columns[c], peeks[c]) : null;
DataView\DataViewExtensions.cs (2)
26Contracts.Assert(dv.Schema[col.Index].Equals(col), $"The requested column named: {col.Name}, with index: {col.Index} and type: {col.Type}" + 41Contracts.Assert(dv.Schema[columnNeeded.Index].Equals(columnNeeded), $"The requested column named: {columnNeeded.Name}, with index: {columnNeeded.Index} and type: {columnNeeded.Type}" +
DataView\LambdaColumnMapper.cs (1)
49var typeOrig = input.Schema[colSrc].Type;
DataView\LambdaFilter.cs (1)
40var typeOrig = input.Schema[colSrc].Type;
DataView\Transposer.cs (15)
139var type = schema[_cols[c].Index].Type; 148ch.Assert(Enumerable.Range(0, slicerSchema.Count).All(c => saver.IsColumnSavable(slicerSchema[c].Type))); 255if (_view.Schema[col].Type is VectorDataViewType) 269if (transposedColumn.Type is PrimitiveDataViewType primitiveDataViewType) 271else if (transposedColumn.Type is VectorDataViewType vectorDataViewType) 361Ch.Assert(_view.Schema[_col].Type is PrimitiveDataViewType); 362Ch.Assert(_view.Schema[_col].Type.RawType == typeof(T)); 374var isDefault = Conversion.Conversions.DefaultInstance.GetIsDefaultPredicate<T>(_view.Schema[_col].Type); 517var type = _view.Schema[_colCurr].Type; 690_slotLim = _view.Schema[_colCurr].Type.GetValueCount(); 924var type = view.Schema[col].Type; 1011Contracts.Assert(_view.Schema[col].Type.RawType == typeof(T)); 1018schemaBuilder.AddColumn(selectedColumn.Name, selectedColumn.Type, selectedColumn.Annotations); 1094var type = _view.Schema[SrcCol].Type as VectorDataViewType; 1443var type = _data.Schema[_col].Type;
DataView\TypedCursor.cs (3)
110var realColType = _data.Schema[colIndex].Type; 252DataViewType expectedType = data.Schema[colIndex].Type; 358var colType = input.Schema[index].Type;
Dirty\ChooseColumnsByIndexTransform.cs (1)
117schemaBuilder.AddColumn(selectedColumn.Name, selectedColumn.Type, selectedColumn.Annotations);
Evaluators\AnomalyDetectionEvaluator.cs (2)
98var t = score.Type; 733var type = cursor.Schema[stratCol].Type;
Evaluators\BinaryClassifierEvaluator.cs (5)
130var t = score.Type; 146var probType = prob[0].Type; 1264var t = schema[(int)LabelIndex].Type; 1268t = schema[ScoreIndex].Type; 1275t = schema[_probIndex].Type;
Evaluators\ClusteringEvaluator.cs (11)
99DataViewType type = schema.Label?.Type; 107type = score.Type; 137Host.Assert(!_calculateDbi || schema.Feature?.Type.IsKnownSizeVector() == true); 139var scoreType = score.Type as VectorDataViewType; 148int numClusters = scoreInfo.Type.GetVectorSize(); 332_clusterCentroids[i] = VBufferUtils.CreateEmpty<Single>(features.Value.Type.GetVectorSize()); 413_clusterCentroids[i] = VBufferUtils.CreateEmpty<Single>(features.Value.Type.GetVectorSize()); 500Host.Assert(score.Type.GetVectorSize() == _scoresArr.Length); 755var type = schema[(int)ScoreIndex].Type; 840var type = perInst.Schema[index].Type; 847var type = perInst.Schema[index].Type;
Evaluators\EvaluatorBase.cs (1)
118list.Add(AggregatorDictionaryBase.Create(schema, stratCol.Name, stratCol.Type, createAgg));
Evaluators\EvaluatorUtils.cs (33)
87var columnType = schema[col].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.ScoreColumnKind)?.Type; 99var columnType = schema[col].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.ScoreColumnKind)?.Type; 142if (col.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.ScoreValueKind)?.Type == TextDataViewType.Instance) 179if (!testType(col.Value.Type)) 186var type = schema[colScore].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.ScoreColumnSetId)?.Type; 203if (col.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.ScoreValueKind)?.Type == TextDataViewType.Instance) 206if (ReadOnlyMemoryUtils.EqualsStr(valueKind, tmp) && testType(col.Type)) 222var type = schema[col].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.ScoreColumnKind)?.Type; 288var type = cursor.Schema[stratCol].Type; 306var type = schema[i].Type; 352var size = schema[i].Type.GetVectorSize(); 353var slotNamesType = schema[i].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 404var inputColType = input.Schema[0].Type; 446var inputColType = input.Schema[inputCol].Type; 478var type = typeSrc[i] = idv.Schema[col].Type; 568var type = schema[indices[i]].Type; 569var keyValueType = schema[indices[i]].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type; 633views[i].Schema[indices[i]].Type, keyType, mapper, keyValueGetter); 664views[i].Schema[index].Type, keyType, mapper); 725var type = views[i].Schema[columnIndices[i]].Type; 833var type = dv.Schema[i].Type; 867labelColKeyValuesType = dv.Schema[i].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type; 930var vectorType = idv.Schema[index].Type as VectorDataViewType; 1009var type = schema[i].Type; 1027var slotNamesType = schema[i].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 1115var type = cursor.Schema[stratCol].Type; 1230var type = schema[i].Type; 1236var keyValuesType = schema[i].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 1392var type = countColumn.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 1478var type = cursor.Schema[countIndex].Type as VectorDataViewType; 1484var stratType = cursor.Schema[stratCol].Type; 1737if (warningTextColumn != null && warningTextColumn.HasValue && warningTextColumn.Value.Type is TextDataViewType) 1775var type = data.Schema[stratCol].Type;
Evaluators\MulticlassClassificationEvaluator.cs (15)
78var scoreType = score.Type as VectorDataViewType; 80throw Host.ExceptSchemaMismatch(nameof(schema), "score", score.Name, "vector of two or more items of type Single", score.Type.ToString()); 90int numClasses = score.Type.GetVectorSize(); 101var mdType = schema.Schema[scoreInfo.Index].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 113int numClasses = score[0].Type.GetVectorSize(); 124int numClasses = scoreInfo.Type.GetVectorSize(); 418Host.Assert(score.Type.GetVectorSize() == _scoresArr.Length); 619_numClasses = scoreColumn.Type.GetVectorSize(); 860var scoreType = schema[ScoreIndex].Type as VectorDataViewType; 862throw Host.ExceptSchemaMismatch(nameof(schema), "score", ScoreCol, "Vector of two or more items of type Single", schema[ScoreIndex].Type.ToString()); 863var labelType = schema[LabelIndex].Type; 1060var labelType = labelCol.Type; 1064labelName, labelCol.Type, NumberDataViewType.Double, 1071var type = perInstSchema[sortedClassesIndex].Type; 1080var type = perInst.Schema[sortedScoresIndex].Type;
Evaluators\MultiOutputRegressionEvaluator.cs (10)
61var t = score.Type as VectorDataViewType; 63throw Host.ExceptSchemaMismatch(nameof(schema), "score", score.Name, "known-size vector of Single", score.Type.ToString()); 73int vectorSize = score.Type.GetVectorSize(); 549var t = schema[LabelIndex].Type as VectorDataViewType; 551throw Host.ExceptSchemaMismatch(nameof(schema), "label", LabelCol, "known-size vector of Single or Double", schema[LabelIndex].Type.ToString()); 558t = schema[ScoreIndex].Type as VectorDataViewType; 560throw Host.ExceptSchemaMismatch(nameof(schema), "score", ScoreCol, "known-size vector of Single", schema[ScoreIndex].Type.ToString()); 595var type = schema[column].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type; 691var type = cursor.Schema[stratCol].Type; 707var type = fold.Schema[i].Type as VectorDataViewType;
Evaluators\QuantileRegressionEvaluator.cs (9)
46int scoreSize = scoreInfo.Type.GetVectorSize(); 47var type = schema.Schema[scoreInfo.Index].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 59var t = score.Type as VectorDataViewType; 61throw Host.ExceptSchemaMismatch(nameof(schema), "score", score.Name, "Vector of Single or Double", score.Type.ToString()); 71var scoreType = scoreInfo.Type as VectorDataViewType; 74var slotNamesType = schema.Schema[scoreInfo.Index].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType; 447var t = schema[(int)LabelIndex].Type; 451VectorDataViewType scoreType = schema[ScoreIndex].Type as VectorDataViewType; 516var type = data.Schema[i].Type;
Evaluators\RankingEvaluator.cs (1)
105if (scoreCol.Type != NumberDataViewType.Single)
Evaluators\RegressionEvaluator.cs (3)
58var t = score.Type; 328var t = schema[(int)LabelIndex].Type; 332t = schema[ScoreIndex].Type;
Model\Pfa\BoundPfaContext.cs (1)
170DataViewType type = schema[col].Type;
Prediction\Calibrator.cs (3)
668var scoreType = _predictor.OutputSchema[_scoreCol].Type; 702var type = predictorRow.Schema[column.Index].Type; 886var type = outputSchema[scoreCol].Type;
Prediction\CalibratorCatalog.cs (5)
288setIdCol.Type is KeyDataViewType setIdType && setIdType.RawType == typeof(uint) && 290kindCol.Type is TextDataViewType && 292valueKindCol.Type is TextDataViewType) 301builder.Add(kindCol.Name, kindCol.Type, annotation.GetGetter<ReadOnlyMemory<char>>(kindCol)); 302builder.Add(valueKindCol.Name, valueKindCol.Type, annotation.GetGetter<ReadOnlyMemory<char>>(valueKindCol));
Scorers\BinaryClassifierScorer.cs (2)
99if (mapper.OutputSchema[scoreIdx].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.TrainingLabelValues)?.Type != null) 221node.AddAttribute("to", predictedLabelCol.Value.Type.RawType);
Scorers\FeatureContributionCalculation.cs (4)
195var typeSrc = input.Schema[colSrc].Type; 207var typeSrc = input.Schema[colSrc].Type; 324var featureSize = FeatureColumn.Type.GetVectorSize(); 344var featureContributionType = new VectorDataViewType(NumberDataViewType.Single, ((VectorDataViewType)FeatureColumn.Type).Dimensions);
Scorers\MulticlassClassificationScorer.cs (3)
333builder.AddColumn(partialSchema[i].Name, partialSchema[i].Type, meta.ToAnnotations()); 459if (outSchema[scoreIdx].Annotations.Schema.GetColumnOrNull(metaKind)?.Type != null) 461scoreType = outSchema[scoreIdx].Type;
Scorers\PredictedLabelScorerBase.cs (7)
69if (trainLabelColumn?.Type is VectorDataViewType trainLabelColVecType && (ulong)trainLabelColVecType.Size == predColKeyType.Count) 81Contracts.Assert(metaCol.Type.RawType == typeof(T)); 83builder.Add(AnnotationUtils.Kinds.KeyValues, metaCol.Type, meta.GetGetter<T>(metaCol)); 145var scoreType = mapper.OutputSchema[scoreColIndex].Type; 186yield return new KeyValuePair<string, DataViewType>(sch[i].Name, sch[i].Type); 208return _predColMetadata.Schema[mcol].Type; 294var scoreType = mapper.OutputSchema[scoreColIndex].Type;
Scorers\PredictionTransformer.cs (5)
236FeatureColumnType = trainSchema[col].Type; 251FeatureColumnType = TrainSchema[col].Type; 266FeatureColumnType = TrainSchema[col].Type; 284if (!inputSchema[col].Type.Equals(FeatureColumnType)) 285throw Host.ExceptSchemaMismatch(nameof(inputSchema), "feature", FeatureColumnName, FeatureColumnType.ToString(), inputSchema[col].Type.ToString());
Scorers\RowToRowScorerBase.cs (4)
210var type = row.Schema[col].Type; 431return Mapper.OutputSchema[iinfo - DerivedColumnCount].Type; 441foreach (var pair in Mapper.OutputSchema[iinfo - DerivedColumnCount].Annotations.Schema.Select(c => new KeyValuePair<string, DataViewType>(c.Name, c.Type))) 452return Mapper.OutputSchema[iinfo - DerivedColumnCount].Annotations.Schema.GetColumnOrNull(kind)?.Type;
Scorers\SchemaBindablePredictorWrapper.cs (4)
127if (schema.Feature?.Type is DataViewType type) 162var typeSrc = input.Schema[colSrc].Type; 527if (schema.Feature?.Type is DataViewType typeSrc) 704var typeSrc = column.Type as VectorDataViewType;
Scorers\ScoreSchemaFactory.cs (2)
58schemaBuilder.AddColumn(partialSchema[0].Name, partialSchema[0].Type, partialSchema[0].Annotations); 103schemaBuilder.AddColumn(partialSchema[0].Name, partialSchema[0].Type, metadataBuilder.ToAnnotations());
Transforms\ColumnBindingsBase.cs (3)
505return Input[index].Type; 516return Input[index].Annotations.Schema.Select(c => new KeyValuePair<string, DataViewType>(c.Name, c.Type)); 529return Input[index].Annotations.Schema.GetColumnOrNull(kind)?.Type;
Transforms\ColumnConcatenatingTransformer.cs (6)
470var curType = inputSchema[srcCol].Type; 553_srcTypes = sources.Select(c => inputSchema[c].Type).ToArray(); 559_isIdentity = SrcIndices.Length == 1 && _inputSchema[SrcIndices[0]].Type is VectorDataViewType; 576return new DataViewSchema.DetachedColumn(_columnOptions.Name, inputCol.Type, inputCol.Annotations); 650typeNames = inputMetadata.Schema[idx].Type as VectorDataViewType; 933InputSchema[srcIndex].Type.GetValueCount()));
Transforms\ColumnCopying.cs (3)
220var type = input.Schema[colIndex].Type; 233result[i] = new DataViewSchema.DetachedColumn(_columns[i].outputColumnName, srcCol.Type, srcCol.Annotations); 252var dstVariableName = ctx.AddIntermediateVariable(_schema[colIndex].Type, column.outputColumnName);
Transforms\ColumnSelecting.cs (1)
747var dstVariable = ctx.AddIntermediateVariable(dstCol.Type, dstCol.Name);
Transforms\FeatureContributionCalculationTransformer.cs (2)
183_featureColumnType = schema[_featureColumnIndex].Type as VectorDataViewType; 185throw Host.ExceptSchemaMismatch(nameof(schema), "feature", _parent.ColumnPairs[0].inputColumnName, "vector of Single", schema[_featureColumnIndex].Type.ToString());
Transforms\Hashing.cs (7)
150var type = inputSchema[srcCol].Type; 166var srcType = inputSchema[srcCol].Type; 267var srcType = input.Schema[srcCol].Type; 1003Contracts.Assert(input.Schema[srcCol].Type.RawType == typeof(T)); 1325_srcTypes[i] = inputSchema[_parent.ColumnPairs[i].inputColumnName].Type; 1493_srcType = row.Schema[srcCol].Type; 1511DataViewType typeSrc = row.Schema[srcCol].Type;
Transforms\InvertHashUtils.cs (1)
39var type = schema[col].Type.GetItemType();
Transforms\KeyToValue.cs (3)
229var typeSrc = schema[ColMapNewToOld[iinfo]].Type; 230var typeVals = schema[ColMapNewToOld[iinfo]].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type; 488var srcType = Parent.InputSchema[Parent.ColMapNewToOld[InfoIndex]].Type;
Transforms\KeyToVector.cs (4)
116var type = inputSchema[srcCol].Type; 282var type = inputSchema[colSrc].Type; 315typeNames = keyValuesColumn.Value.Type as VectorDataViewType; 379var typeSlotSrc = inputMetadata.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type as VectorDataViewType;
Transforms\LabelConvertTransform.cs (1)
178var typeSrc = input.Schema[col].Type;
Transforms\MetadataDispatcher.cs (2)
236foreach (var kvp in info.SchemaSrc[info.IndexSrc].Annotations.Schema.Select(c => new KeyValuePair<string, DataViewType>(c.Name, c.Type))) 268return info.SchemaSrc[info.IndexSrc].Annotations.Schema.GetColumnOrNull(kind)?.Type;
Transforms\NAFilter.cs (2)
114var type = schema[index].Type; 150var type = schema[index].Type;
Transforms\NormalizeColumn.cs (4)
812var type = row.Schema[col].Type; 917Host.Assert(valueCol.Type.IsKnownSizeVector()); 918ColumnSlotCount = valueCol.Type.GetValueCount(); 1132var labelColumnType = cursor.Schema[labelColumnId].Type;
Transforms\Normalizer.cs (3)
547srcTypes[i] = data.Schema[srcCols[i]].Type; 647var typeSrc = input.Schema[ColumnPairs[iinfo].inputColumnName].Type; 705var colType = inputSchema[srcCol].Type;
Transforms\RangeFilter.cs (2)
106_type = schema[_index].Type; 154_type = schema[_index].Type;
Transforms\RowShufflingTransformer.cs (5)
195var type = schema[c].Type; 215var type = schema[c].Type; 531input.Schema[c].Type, RowCursorUtils.GetGetterAsDelegate(input, c)); 680return Utils.MarshalInvoke(_createGetterDelegateMethodInfo, this, Schema[col].Type.RawType, col); 687Ch.Assert(Schema[col].Type.RawType == typeof(TValue));
Transforms\SlotsDroppingTransformer.cs (1)
484_srcTypes[i] = inputSchema[_cols[i]].Type;
Transforms\TransformBase.cs (3)
349var type = inputSchema[colSrc].Type; 398var type = inputSchema[colSrc].Type; 619ctx.AddIntermediateVariable(OutputSchema[_bindings.MapIinfoToCol(iinfo)].Type, info.Name)))
Transforms\TypeConverting.cs (4)
330var srcType = input.Schema[item.Source ?? item.Name].Type; 402if (!CanConvertToType(Host, srcCol.Type, _parent._columns[i].OutputKind.ToInternalDataKind(), _parent._columns[i].OutputKeyCount, 407_parent._columns[i].InputColumnName, srcCol.Type, itemType); 440var srcType = InputSchema[_srcCols[i]].Type;
Transforms\ValueMapping.cs (22)
365internal DataViewType ValueColumnType => _valueMap.ValueColumn.Type; 450Host.Check(retrievedKeyColumn.Type == keyColumn.Type, nameof(keyColumn) + "'s column type doesn't match that of the associated column in " + nameof(dataView)); 458Host.Check(retrievedValueColumn.Type == valueColumn.Type, nameof(valueColumn) + "'s column type doesn't match that of the associated column in " + nameof(dataView)); 810var method = del.Method.GetGenericMethodDefinition().MakeGenericMethod(keyColumn.Type.RawType, valueColumn.Type.RawType); 863if (!(ValueColumn.Type is VectorDataViewType)) 871ValueColumn.Type, 900if (ValueColumn.Type is VectorDataViewType vectorType) 903return Utils.MarshalInvoke(_getValueMethodInfo, ValueColumn.Type.RawType, _mapping[key]); 912if (column.Type is VectorDataViewType) 952ValueColumn.Type is KeyDataViewType); 1070var type = _inputSchema[colSrc].Type; 1109var typeValue = _valueMap.ValueColumn.Type; 1110var typeKey = _valueMap.KeyColumn.Type; 1111var kind = _valueMap.ValueColumn.Type.GetRawKind(); 1283if (_inputSchema[_columns[i].inputColumnName].Type is VectorDataViewType && _valueMap.ValueColumn.Type is VectorDataViewType) 1285var colType = _valueMap.ValueColumn.Type; 1286if (_inputSchema[_columns[i].inputColumnName].Type is VectorDataViewType) 1287colType = new VectorDataViewType(ColumnTypeExtensions.PrimitiveTypeFromType(_valueMap.ValueColumn.Type.GetItemType().RawType));
Transforms\ValueToKeyMappingTransformer.cs (2)
236var type = inputSchema[colSrc].Type; 479var typeSrc = keyData.Schema[0].Type;
Transforms\ValueToKeyMappingTransformerImpl.cs (3)
292var type = schema[col].Type; 1098VectorDataViewType srcMetaType = _schema[srcCol].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 1179VectorDataViewType srcMetaType = _schema[srcCol].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType;
Utilities\ColumnCursor.cs (4)
40var colType = column.Type; 45if (data.Schema[colIndex].Name != colName || data.Schema[colIndex].Type != colType) 74throw Contracts.ExceptParam(nameof(column), string.Format("Cannot load vector type, {0}, specified in {1} to the user-defined type, {2}.", column.Type, nameof(column), typeof(T))); 95column.Name, column.Type, nameof(data), typeof(T)));
Microsoft.ML.DataView (7)
DataViewSchema.cs (5)
123return $"{Name}: {Type}{annotationsString}"; 164Type = column.Type; 205Utils.MarshalActionInvoke(CheckGetter<int>, schema[i].Type.RawType, getter); 282_items.Add((column.Name, column.Type, annotations.GetGetterInternal(column.Index), column.Annotations)); 413AddColumn(column.Name, column.Type, column.Annotations);
DataViewType.cs (1)
472/// Whenever a value typed to the registered <see cref="Type"/> and its <see cref="Attribute"/>s, that value's type (i.e., a <see cref="DataViewSchema.Column.Type"/>)
SchemaDebuggerProxy.cs (1)
45var value = Utils.MarshalInvoke(GetValue<DataViewSchema.Column>, column.Type.RawType, annotations, column);
Microsoft.ML.EntryPoints (5)
FeatureCombiner.cs (4)
123var type = col.Value.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 168if (!(col.Type is VectorDataViewType vectorType) || vectorType.Size > 0) 170var type = col.Type.GetItemType(); 193ch.Error("The type of column '{0}' is not valid as a training feature: {1}", col.Name, col.Type);
JsonUtils\ExecuteGraphCommand.cs (1)
245.Where(x => saver.IsColumnSavable(idv.Schema[x].Type)).ToArray());
Microsoft.ML.Fairlearn (6)
Metrics\FairlearnMetricCatalog.cs (6)
62if (sensitiveCol.Type == TextDataViewType.Instance) 192if (column.Type is TextDataViewType) 197else if (column.Type.RawType == typeof(bool)) 203else if (column.Type.RawType == typeof(int)) 209else if (column.Type.RawType == typeof(float)) 215else if (column.Type.RawType == typeof(DateTime))
Microsoft.ML.FastTree (3)
TreeEnsembleFeaturizationTransformer.cs (2)
51string typeErrorMessage = $"The column called {inspectedFeatureColumn.Name} has a type {inspectedFeatureColumn.Type}, " + 55Host.Check(_featureDetachedColumn.Type.Equals(inspectedFeatureColumn.Type), typeErrorMessage);
TreeEnsembleFeaturizer.cs (1)
803DataViewType labelType = col.Value.Type;
Microsoft.ML.ImageAnalytics (10)
ImageGrayscale.cs (2)
145if (!(inputSchema[srcCol].Type is ImageDataViewType)) 146throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, "image", inputSchema[srcCol].Type.ToString());
ImageLoader.cs (2)
160if (!(inputSchema[srcCol].Type is TextDataViewType)) 161throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, TextDataViewType.Instance.ToString(), inputSchema[srcCol].Type.ToString());
ImagePixelExtractor.cs (2)
270var imageType = inputSchema[srcCol].Type as ImageDataViewType; 272throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", inputColName, "image", inputSchema[srcCol].Type.ToString());
ImageResizer.cs (2)
255if (!(inputSchema[srcCol].Type is ImageDataViewType)) 256throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", _columns[col].InputColumnName, "image", inputSchema[srcCol].Type.ToString());
VectorToImageTransform.cs (2)
302var vectorType = inputSchema[srcCol].Type as VectorDataViewType; 304throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", inputColName, "image", inputSchema[srcCol].Type.ToString());
Microsoft.ML.IntegrationTests (14)
Common.cs (5)
51Assert.Equal(types[column.Name], column.Type.RawType); 115Assert.True((schemaPair.Item1.Type == schemaPair.Item2.Type) || 116(schemaPair.Item1.Type.RawType == schemaPair.Item2.Type.RawType));
IntrospectiveTraining.cs (2)
207var numFeatures = (transformedData.Schema["Features"].Type as VectorDataViewType).Size; 244var numFeatures = (transformedData.Schema["Features"].Type as VectorDataViewType).Size;
SchemaDefinitionTests.cs (7)
45outputSchemaDefinition["Features"].ColumnType = model1.GetOutputSchema(data.Schema)["Features"].Type; 49outputSchemaDefinition["Features"].ColumnType = model2.GetOutputSchema(data.Schema)["Features"].Type; 53Assert.Equal((engine1.OutputSchema["Features"].Type as VectorDataViewType).Size, prediction.Features.Length); 56Assert.Equal((engine2.OutputSchema["Features"].Type as VectorDataViewType).Size, prediction.Features.Length); 74inputSchemaDefinition["Features"].ColumnType = schema["Features"].Type; 76outputSchemaDefinition["Features"].ColumnType = new VectorDataViewType(NumberDataViewType.Single, (schema["Features"].Type as VectorDataViewType).Size * 2); 91Assert.Equal(168, (schema["Features"].Type as VectorDataViewType).Size);
Microsoft.ML.Mkl.Components (3)
VectorWhitening.cs (3)
213var inType = inputSchema[srcCol].Type; 291srcTypes[i] = col.Value.Type; 567_srcTypes[i] = inputSchema[_cols[i]].Type;
Microsoft.ML.OnnxConverter (5)
SaveOnnxCommand.cs (5)
177ctx.AddInputVariable(inputData.Schema[i].Type, colName); 209var trueVariableName = ctx.AddIntermediateVariable(outputData.Schema[i].Type, idataviewColumnName + ".output"); 211ctx.AddOutputVariable(outputData.Schema[i].Type, trueVariableName); 249if (column.Type.GetItemType() is KeyDataViewType keyType) 253metaColumn.Value.Type is VectorDataViewType vectorType &&
Microsoft.ML.OnnxTransformer (7)
OnnxMapType.cs (1)
13/// The corresponding <see cref="DataViewSchema.Column.Type"/> of ONNX's map type in <see cref="IDataView"/>'s type system.
OnnxSequenceType.cs (1)
13/// The corresponding <see cref="DataViewSchema.Column.Type"/> of ONNX's sequence type in <see cref="IDataView"/>'s type system.
OnnxTransform.cs (5)
466var type = inputSchema[_inputColIndices[i]].Type; 711var isVector = input.Schema[colIndex].Type is VectorDataViewType; 730var type = input.Schema[colIndex].Type.RawType; 753var type = input.Schema[colIndex].Type.GetItemType().RawType; 815var isKnownSize = (input.Schema[colIndex].Type as VectorDataViewType).IsKnownSize;
Microsoft.ML.Parquet (4)
PartitionedFileLoader.cs (4)
550var type = _subCursor.Schema[i].Type; 585var type = Schema[i].Type; 670var type1 = schema1[col].Type; 671var type2 = schema2[col].Type;
Microsoft.ML.PCA (3)
PcaTransformer.cs (3)
504ValidatePcaInput(Host, inputSchema[srcCol].Name, inputSchema[srcCol].Type); 527InputType = schema[columnPair.inputColumnName].Type; 534Contracts.CheckParam(schema[weightIndex].Type == NumberDataViewType.Single, nameof(weightColumn));
Microsoft.ML.Predictor.Tests (3)
TestTransposer.cs (3)
26var type = view.Schema[col].Type; 72DataViewType colType = trans.Schema[col].Type; 74DataViewType expectedType = view.Schema[viewCol].Type;
Microsoft.ML.Recommender (23)
MatrixFactorizationPredictor.cs (6)
382var type = schema[matrixColumnIndexCol].Type; 387type = schema[matrixRowIndexCol].Type; 457MatrixColumnIndexColumnType = trainSchema[xCol].Type; 460MatrixRowIndexColumnType = trainSchema[yCol].Type; 495MatrixColumnIndexColumnType = TrainSchema[xCol].Type; 499MatrixRowIndexColumnType = TrainSchema[yCol].Type;
MatrixFactorizationTrainer.cs (14)
456if (!matrixColumnIndexColInfo.Type.Equals(validMatrixColumnIndexColInfo.Type)) 459matrixColumnIndexColInfo.Type, validMatrixColumnIndexColInfo.Type); 461if (!matrixRowIndexColInfo.Type.Equals(validMatrixRowIndexColInfo.Type)) 464matrixRowIndexColInfo.Type, validMatrixRowIndexColInfo.Type); 468int colCount = matrixColumnIndexColInfo.Type.GetKeyCountAsInt32(_host); 469int rowCount = matrixRowIndexColInfo.Type.GetKeyCountAsInt32(_host); 487predictor = new MatrixFactorizationModelParameters(_host, buffer, (KeyDataViewType)matrixColumnIndexColInfo.Type, (KeyDataViewType)matrixRowIndexColInfo.Type); 505predictor = new MatrixFactorizationModelParameters(_host, buffer, (KeyDataViewType)matrixColumnIndexColInfo.Type, (KeyDataViewType)matrixRowIndexColInfo.Type);
RecommenderUtils.cs (3)
67if (!TryMarshalGoodRowColumnType(col.Type, out keyType)) 70throw Contracts.ExceptDecode(format, col.Name, role.Value, col.Type); 71throw Contracts.Except(format, col.Name, role.Value, col.Type);
Microsoft.ML.Samples (5)
Dynamic\DataOperations\LoadFromEnumerable.cs (2)
40var featureColumn = data.Schema["Features"].Type as VectorDataViewType; 84featureColumn = data2.Schema["Features"].Type as VectorDataViewType;
Dynamic\DataOperations\LoadingSvmLight.cs (1)
85Console.WriteLine($"Column {col.Name} type {col.Type}");
Dynamic\TensorFlow\TextClassification.cs (2)
66var featuresType = (VectorDataViewType)schema["Features"].Type; 71.Type;
Microsoft.ML.Samples.GPU (2)
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\TextClassification.cs (2)
66var featuresType = (VectorDataViewType)schema["Features"].Type; 71.Type;
Microsoft.ML.StandardTrainers (6)
FactorizationMachine\FieldAwareFactorizationMachineModelParameters.cs (4)
321featureColumnTypes[i++] = trainSchema[col].Type; 352featureColumnTypes[i] = TrainSchema[col].Type; 380if (!inputSchema[col].Type.Equals(FeatureColumnTypes[i])) 381throw Host.ExceptSchemaMismatch(nameof(inputSchema), "feature", feat, FeatureColumnTypes[i].ToString(), inputSchema[col].Type.ToString());
FactorizationMachine\FieldAwareFactorizationMachineUtils.cs (2)
79Contracts.CheckParam(outputSchema[0].Type is NumberDataViewType, nameof(outputSchema)); 80Contracts.CheckParam(outputSchema[1].Type is NumberDataViewType, nameof(outputSchema));
Microsoft.ML.TensorFlow (1)
TensorflowTransform.cs (1)
555var type = inputSchema[_inputColIndices[i]].Type;
Microsoft.ML.TensorFlow.Tests (25)
TensorFlowEstimatorTests.cs (3)
215Assert.Equal(new VectorDataViewType(NumberDataViewType.Single, 0, 10), schema["Output"].Type); 229Assert.Equal(new VectorDataViewType(NumberDataViewType.Single, 10), schema["Output"].Type); 242var type = (VectorDataViewType)schema[column].Type;
TensorflowTests.cs (22)
582var type = (VectorDataViewType)schema[col].Type; 586var metadataType = schema[col].Annotations.Schema[TensorFlowUtils.TensorflowOperatorTypeKind].Type; 592metadataType = schema[col].Annotations.Schema.GetColumnOrNull(TensorFlowUtils.TensorflowUpstreamOperatorsKind)?.Type; 596type = (VectorDataViewType)schema[col].Type; 598metadataType = schema[col].Annotations.Schema[TensorFlowUtils.TensorflowOperatorTypeKind].Type; 603metadataType = schema[col].Annotations.Schema[TensorFlowUtils.TensorflowUpstreamOperatorsKind].Type; 611type = (VectorDataViewType)schema[col].Type; 613metadataType = schema[col].Annotations.Schema[TensorFlowUtils.TensorflowOperatorTypeKind].Type; 618metadataType = schema[col].Annotations.Schema[TensorFlowUtils.TensorflowUpstreamOperatorsKind].Type; 626type = (VectorDataViewType)schema[col].Type; 628metadataType = schema[col].Annotations.Schema[TensorFlowUtils.TensorflowOperatorTypeKind].Type; 633metadataType = schema[col].Annotations.Schema[TensorFlowUtils.TensorflowUpstreamOperatorsKind].Type; 645type = (VectorDataViewType)schema[i].Type; 1005var type = (VectorDataViewType)schema[column].Type; 1064var type = (VectorDataViewType)schema[column].Type; 1108var type = (VectorDataViewType)schema[column].Type; 1373Assert.True(schema.GetColumnOrNull("input1").Value.Type is TextDataViewType); 1375Assert.True(schema.GetColumnOrNull("input2").Value.Type is TextDataViewType); 1575var labelTypeFirst = labelColumnFirst.Type; 1578var labelTypeSecond = labelColumnSecond.Type; 1734var labelTypeFirst = labelColumnFirst.Type; 1737var labelTypeSecond = labelColumnSecond.Type;
Microsoft.ML.TestFramework (15)
BaseTestBaseline.cs (3)
699var leftType = leftColumn.Type.GetItemType(); 748if (leftColumn.Type is VectorDataViewType) 767if (leftColumn.Type is VectorDataViewType)
DataPipe\TestDataPipeBase.cs (12)
386DataViewType type = schema[c].Type; 476var typeSlot = sch[col].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.SlotNames)?.Type; 477var typeKeys = sch[col].Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type; 482if (metaColumn.Name == null || metaColumn.Type == null) 494if (typeSlot == null || !typeSlot.Equals(metaColumn.Type)) 504if (typeKeys == null || !typeKeys.Equals(metaColumn.Type)) 533DataViewType type = schema[c].Type; 579DataViewType type = schema[c].Type; 715var type1 = curs1.Schema[col].Type; 716var type2 = curs2.Schema[col].Type; 805var type1 = curs1.Schema[col].Type; 806var type2 = cursors[col].Schema[col].Type;
Microsoft.ML.TestFrameworkCommon (4)
TestCommon.cs (4)
98var type1 = sch1[col].Type; 99var type2 = sch2[col].Type; 237var t1 = sch1[col].Annotations.Schema.GetColumnOrNull(kind)?.Type; 238var t2 = sch2[col].Annotations.Schema.GetColumnOrNull(kind)?.Type;
Microsoft.ML.Tests (49)
FakeSchemaTest.cs (5)
39Assert.Equal(NumberDataViewType.Single, columnA.Type.GetItemType()); 40Assert.Equal(10, columnA.Type.GetValueCount()); 43Assert.Equal(InternalDataKind.U4, columnB.Type.GetRawKind()); 44Assert.Equal(10u, columnB.Type.GetKeyCount()); 47Assert.Equal(NumberDataViewType.Int32, columnC.Type);
Scenarios\Api\TestApi.cs (3)
233Assert.True(idv.Schema[0].Annotations.Schema[0].Type == coltypeFloat); 235Assert.True(idv.Schema[0].Annotations.Schema[1].Type == TextDataViewType.Instance); 239Assert.True(idv.Schema[1].Annotations.Schema[0].Type is VectorDataViewType vectorType && vectorType.ItemType is TextDataViewType);
SvmLightTests.cs (4)
44Assert.True(data.Schema["Features"].Type.GetValueCount() == expectedInputSize); 157Assert.True(data.Schema["Features"].Type.GetValueCount() == 3); 186Assert.True(data.Schema["Features"].Type.GetValueCount() == 3); 208Assert.True(data.Schema["Features"].Type.GetValueCount() == 1);
TermEstimatorTests.cs (1)
146var type1 = result.Schema[termIndex].Type;
TextLoaderTests.cs (5)
754Assert.Equal(NumberDataViewType.Single, previewIris.Schema[0].Type); 822Assert.True(result.Schema[featureIdx].Type is KeyDataViewType keyType && keyType.Count == typeof(uint).ToMaxInt()); 852Assert.Equal(NumberDataViewType.Single, previewIris.Schema[0].Type); 1246Assert.Equal(expectedCount, data.Schema[1].Type.GetKeyCount()); 1258Assert.Equal(expectedCount, data.Schema[1].Type.GetKeyCount());
TrainerEstimators\TreeEnsembleFeaturizerTest.cs (3)
61VectorDataViewType treeValuesType = treeValuesColumn.Type as VectorDataViewType; 79VectorDataViewType treeLeafIdsType = treeLeafIdsColumn.Type as VectorDataViewType; 102VectorDataViewType treePathIdsType = treePathIdsColumn.Type as VectorDataViewType;
Transformers\ConcatTests.cs (2)
62return schema[cIdx].Type; 119return schema[cIdx].Type;
Transformers\ConvertTests.cs (2)
405Assert.True(outDataNew.Schema[1].Type.Equals(outDataNew.Schema[1].Type));
Transformers\CopyColumnEstimatorTests.cs (2)
147var type1 = result.Schema[termIndex].Type; 153var type2 = result.Schema[copyIndex].Type;
Transformers\ExpressionTransformerTests.cs (9)
50Assert.True(transformed.Schema["Expr1"].Type == NumberDataViewType.Double); 51Assert.Equal(6, transformed.Schema["Expr2"].Type.GetValueCount()); 52Assert.True(transformed.Schema["Expr2"].Type.GetItemType() == NumberDataViewType.Single); 53Assert.True(transformed.Schema["Expr3"].Type == NumberDataViewType.Single); 54Assert.True(transformed.Schema["Expr4"].Type.GetItemType() == NumberDataViewType.Double); 55Assert.Equal(6, transformed.Schema["Expr4"].Type.GetValueCount()); 56Assert.True(transformed.Schema["Expr5"].Type == NumberDataViewType.Int32); 57Assert.True(transformed.Schema["Expr6"].Type.GetItemType() == TextDataViewType.Instance); 58Assert.Equal(7, transformed.Schema["Expr6"].Type.GetValueCount());
Transformers\HashTests.cs (8)
367Assert.True(hashedCol.Type.GetItemType() is KeyDataViewType); 368Assert.Equal(9, hashedCol.Type.GetValueCount()); 369Assert.Equal(Math.Pow(2, 31), hashedCol.Type.GetItemType().GetKeyCount()); 390Assert.True(transformed.Schema["D"].Type.IsKnownSizeVector()); 391Assert.True(transformed.Schema["DHashed"].Type.IsKnownSizeVector()); 392Assert.Equal(1, transformed.Schema["DHashed"].Type.GetValueCount()); 393Assert.False(transformed.Schema["DHashedCombined"].Type.IsKnownSizeVector()); 394Assert.Equal(1, transformed.Schema["DHashedCombined"].Type.GetValueCount());
Transformers\NormalizerTests.cs (2)
1063var dimensions1 = (transformedData.Schema["output"].Type as VectorDataViewType).Dimensions; 1064var dimensions2 = (transformedData2.Schema["output"].Type as VectorDataViewType).Dimensions;
Transformers\TextFeaturizerTests.cs (1)
705Assert.Equal(10, (savedData.Schema[0].Type as VectorDataViewType)?.Size);
Transformers\ValueMappingTests.cs (2)
741Assert.True(result.Schema[labelIdx].Type is KeyDataViewType); 742Assert.Equal((ulong)5, result.Schema[labelIdx].Type.GetItemType().GetKeyCount());
Microsoft.ML.TimeSeries (9)
IidAnomalyDetectionBase.cs (1)
126var colType = inputSchema[col].Type;
SequentialAnomalyDetectionTransformBase.cs (1)
319var colType = inputSchema[_inputColumnIndex].Type;
SequentialForecastingTransformBase.cs (1)
116var colType = inputSchema[_inputColumnIndex].Type;
SequentialTransformBase.cs (1)
351bs.TryWriteTypeDescription(ctx.Writer.BaseStream, _transform.Schema[colIndex].Type, out byteWritten);
SlidingWindowTransformBase.cs (1)
102DataViewType col = sch[index].Type;
SrCnnAnomalyDetectionBase.cs (1)
117var colType = inputSchema[col].Type;
SrCnnTransformBase.cs (1)
162var colType = inputSchema[_inputColumnIndex].Type;
SsaAnomalyDetectionBase.cs (1)
252var colType = inputSchema[col].Type;
SsaForecastingBase.cs (1)
176var colType = inputSchema[col].Type;
Microsoft.ML.TorchSharp (11)
AutoFormerV2\ObjectDetectionTrainer.cs (4)
547var labelAnnotationsColumn = new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.SlotNames].Type, false); 625var labelColType = LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues].Type as VectorDataViewType; 642var labelColType = LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues].Type as VectorDataViewType; 755var keyType = _parent.LabelColumn.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType;
NasBert\NasBertTrainer.cs (3)
436var labelAnnotationsColumn = new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.SlotNames].Type, false); 520var keyType = Parent.LabelColumn.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType; 542var keyType = Parent.LabelColumn.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType;
NasBert\NerTrainer.cs (2)
281var labelColType = LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues].Type as VectorDataViewType; 293var labelColType = LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues].Type as VectorDataViewType;
NasBert\TextClassificationTrainer.cs (2)
217var labelColType = LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues].Type as VectorDataViewType; 229var labelColType = LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues].Type as VectorDataViewType;
Microsoft.ML.TorchSharp.Tests (5)
QATests.cs (2)
58Assert.Equal(new VectorDataViewType(TextDataViewType.Instance), transformerSchema[4].Type); 59Assert.Equal(new VectorDataViewType(NumberDataViewType.Single), transformerSchema[5].Type);
TextClassificationTests.cs (3)
115Assert.Equal(TextDataViewType.Instance, transformerSchema[3].Type); 251Assert.Equal(TextDataViewType.Instance, transformerSchema[4].Type); 335Assert.Equal(TextDataViewType.Instance, transformerSchema[5].Type);
Microsoft.ML.Transforms (88)
CountFeatureSelection.cs (1)
312var colType = schema[colSrc].Type;
CustomMappingTransformer.cs (1)
161result[i] = Utils.MarshalInvoke(GetDstGetter<int>, dstRow.Schema[i].Type.RawType, dstRow, i, refresh);
Dracula\CountTableTransformer.cs (9)
137var labelColumnType = labelCol.GetValueOrDefault().Type; 189if (cols[i].Type is VectorDataViewType) 206if (cols[i].Type is VectorDataViewType) 209_host.Check(srcBuffer.Length == cols[i].Type.GetVectorSize(), "value count mismatch"); 225var type = col.Type; 638if (inputCol.Type is VectorDataViewType) 646Host.Assert(inputSlotNames.Length == inputCol.Type.GetValueCount()); 675if (input.Schema[_parent.ColumnPairs[iinfo].inputColumnName].Type is VectorDataViewType) 700int n = inputCol.Type.GetValueCount();
Dracula\MultiCountTable.cs (4)
79var size = col.Type.GetValueCount(); 102_host.Check(size == inputCols[i].Type.GetValueCount(), "Inconsistent number of slots"); 256_slotCount[i] = inputColumns[i].Type.GetValueCount(); 266All(pair => pair.col.Type.GetValueCount() == pair.count), "Inconsistent number of slots");
ExpressionTransformer.cs (2)
143if (col.Value.Type is VectorDataViewType) 149inputTypes[isrc] = col.Value.Type.GetItemType();
GcnTransform.cs (3)
197var inType = inputSchema[srcCol].Type; 339_srcTypes[i] = srcCol.Type; 340_types[i] = srcCol.Type;
GroupTransform.cs (5)
285schemaBuilder.AddColumn(groupKeyColumnName, sourceSchema[groupKeyColumnName].Type, sourceSchema[groupKeyColumnName].Annotations); 296var aggregatedValueType = sourceSchema[groupValueColumnName].Type as PrimitiveDataViewType; 357var colType = retrievedColumn.Value.Type; 429var type = row.Schema[col].Type; 451var colType = row.Schema[col].Type;
KeyToVectorMapping.cs (2)
73var type = inputSchema[srcCol].Type; 196var type = inputSchema[colSrc].Type;
MissingValueDroppingTransformer.cs (6)
133var inType = inputSchema[srcCol].Type; 196if (!(srcCol.Type is VectorDataViewType)) 198if (!Data.Conversion.Conversions.DefaultInstance.TryGetIsNAPredicate(srcCol.Type.GetItemType(), out _isNAs[i])) 199throw _parent.Host.Except($"Column '{srcCol.Name}' is of type {srcCol.Type.GetItemType()}, which does not support missing values"); 200_srcTypes[i] = srcCol.Type; 201_types[i] = new VectorDataViewType((PrimitiveDataViewType)srcCol.Type.GetItemType());
MissingValueHandlingTransformer.cs (1)
164var replaceType = input.Schema[inputCol].Type;
MissingValueIndicatorTransformer.cs (1)
192var inType = inputSchema[colSrc].Type;
MissingValueReplacing.cs (3)
204var type = inputSchema[srcCol].Type; 293var type = input.Schema[colSrc].Type; 602var type = inputSchema[colSrc].Type;
MutualInformationFeatureSelection.cs (4)
448var labelType = schema[labelCol].Type; 466var colType = schema[colSrc].Type; 595var type = trans.Schema[col].Type; 662var slotCount = trans.Schema[col].Type.GetValueCount();
OptionalColumnTransform.cs (1)
82columnTypes[i] = input[col].Type;
PermutationFeatureImportance.cs (2)
52int numSlots = featuresColumn.Type.GetVectorSize(); 193output[0].ColumnType = featuresColumn.Type;
RandomFourierFeaturizing.cs (5)
244var type = inputSchema[srcCol].Type; 261var typeSrc = input.Schema[srcCol].Type; 289var type = input.Schema[srcCol].Type; 302var srcType = input.Schema[srcCols[i]].Type; 487_srcTypes[i] = srcCol.Type;
StatefulCustomMappingTransformer.cs (2)
189getters[iinfo] = Utils.MarshalInvoke(GetDstGetter<int>, col.Type.RawType, dstRow, col.Name, refresh); 308_getters[iinfo] = Utils.MarshalInvoke(_parent.GetDstGetter<int>, _parent._bindings.Schema[i].Type.RawType, dstRow, _parent._bindings.Schema[i].Name, refresh);
SvmLight\SvmLightLoader.cs (2)
584var keyType = keyCol.Value.Type.GetItemType() as KeyDataViewType; 733schemaDef[0].AddAnnotation(AnnotationUtils.Kinds.SlotNames, keyValues, keyValuesCol.Value.Type);
Text\LdaTransform.cs (3)
579var srcType = srcCol.Type as VectorDataViewType; 581throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", _parent.ColumnPairs[i].inputColumnName, "known-size vector of Single", srcCol.Type.ToString()); 841var srcColType = inputSchema[srcCol].Type as VectorDataViewType;
Text\NgramHashingTransformer.cs (4)
216var columnType = input.Schema[srcCol].Type; 217if (!NgramHashingEstimator.IsColumnTypeValid(input.Schema[srcCol].Type)) 399var columnType = inputSchema[srcCol].Type; 402var srcType = inputSchema[srcCol].Type;
Text\NgramTransform.cs (4)
202var type = inputSchema[srcCol].Type; 214var typeSrc = input.Schema[srcCol].Type; 237srcTypes[iinfo] = trainingData.Schema[srcCols[iinfo]].Type; 493_srcTypes[i] = inputSchema[_srcCols[i]].Type;
Text\StopWordsRemovingTransformer.cs (3)
189var type = inputSchema[srcCol].Type; 870var typeSrc = loader.Schema[colSrcIndex].Type; 1076var srcType = inputSchema[srcCol].Type;
Text\TextNormalizing.cs (3)
118var type = inputSchema[srcCol].Type; 211var srcType = inputSchema[srcCol].Type; 332var srcType = input.Schema[_parent.ColumnPairs[iinfo].inputColumnName].Type;
Text\TokenizingByCharacters.cs (4)
122var type = inputSchema[srcCol].Type; 208var type = inputSchema[_parent.ColumnPairs[i].inputColumnName].Type; 470if (!(input.Schema[_parent.ColumnPairs[iinfo].inputColumnName].Type is VectorDataViewType)) 508int cv = input.Schema[ColMapNewToOld[iinfo]].Type.GetVectorSize();
Text\WordEmbeddingsExtractor.cs (5)
303var colType = inputSchema[srcCol].Type; 305throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, "String", inputSchema[srcCol].Type.ToString()); 338var dstVariableName = ctx.AddIntermediateVariable(schema[outputColumnName].Type, outputColumnName); 557Host.Assert(column.Type is VectorDataViewType); 558Host.Assert(column.Type.GetItemType() is TextDataViewType);
Text\WordTokenizing.cs (4)
124var type = inputSchema[srcCol].Type; 217var srcType = inputSchema[srcCol].Type; 241var srcType = input.Schema[srcCol].Type; 279int cv = input.Schema[ColMapNewToOld[iinfo]].Type.GetVectorSize();
UngroupTransform.cs (4)
298schemaBuilder.AddColumn(inputSchema[i].Name, inputSchema[i].Type, inputSchema[i].Annotations); 314schemaBuilder.AddColumn(inputSchema[i].Name, inputSchema[i].Type.GetItemType(), metadataBuilder.ToAnnotations()); 336if (!(inputSchema[col].Type is VectorDataViewType colType)) 338"Pivot column '{0}' has type '{1}', but must be a vector of primitive types", name, inputSchema[col].Type);
Microsoft.ML.Vision (6)
DnnRetrainTransform.cs (3)
233var type = inputSchema[inputColIndex].Type; 473if (input.Schema[colIndex].Type is KeyDataViewType && type.RawType == typeof(Int64)) 779var type = inputSchema[_inputColIndices[i]].Type;
ImageClassificationTrainer.cs (3)
601var labelType = labelColumn.Type; 822if (labelColumn.Type.RawType != typeof(uint)) 826labelColumn.Type.RawType.ToString());