1 write to ItemType
Microsoft.ML.Core (1)
Data\IEstimator.cs (1)
72ItemType = itemType;
140 references to ItemType
Microsoft.ML.Core (10)
Data\AnnotationUtils.cs (5)
314&& metaCol.ItemType is TextDataViewType; 329&& metaCol.ItemType == BooleanDataViewType.Instance; 345&& metaCol.ItemType == TextDataViewType.Instance; 449if (metaCol.ItemType is TextDataViewType) 451cols.Add(new SchemaShape.Column(Kinds.TrainingLabelValues, SchemaShape.Column.VectorKind.Vector, metaCol.ItemType, false));
Data\IEstimator.cs (5)
52/// The flag whether the column is actually a key. If yes, <see cref="ItemType"/> is representing 82/// - The <see cref="Name"/>, <see cref="Kind"/>, <see cref="ItemType"/>, <see cref="IsKey"/> fields match. 94if (!ItemType.Equals(source.ItemType)) 111string result = ItemType.ToString();
Microsoft.ML.Data (29)
DataLoadSave\FakeSchema.cs (1)
49DataViewType curType = column.ItemType;
Prediction\CalibratorCatalog.cs (3)
112setIdCol.Kind == scalar && setIdCol.IsKey && setIdCol.ItemType == NumberDataViewType.UInt32 && 114kindCol.Kind == scalar && kindCol.ItemType is TextDataViewType && 116valueKindCol.Kind == scalar && valueKindCol.ItemType is TextDataViewType)
Transforms\ColumnConcatenatingEstimator.cs (4)
83&& mcol.ItemType == NumberDataViewType.Int32; 109itemType = col.ItemType; 117if (!col.ItemType.Equals(itemType)) 119throw _host.Except($"Concatenated columns should have the same type. Column '{sources[i]}' has type of {col.ItemType}, " +
Transforms\ColumnCopying.cs (1)
81var col = new SchemaShape.Column(outputColumnName, originalColumn.Kind, originalColumn.ItemType, originalColumn.IsKey, originalColumn.Annotations);
Transforms\FeatureContributionCalculationTransformer.cs (2)
345if (col.ItemType != NumberDataViewType.Single || col.Kind != SchemaShape.Column.VectorKind.Vector) 356DefaultColumnNames.FeatureContributions, col.Kind, col.ItemType, false, new SchemaShape(featContributionMetadata));
Transforms\Hashing.cs (1)
1961if (!IsColumnTypeValid(col.ItemType))
Transforms\KeyToValue.cs (1)
652result[colInfo.outputColumnName] = new SchemaShape.Column(colInfo.outputColumnName, col.Kind, keyMetaCol.ItemType, keyMetaCol.IsKey, metadata);
Transforms\KeyToVector.cs (3)
826if (!col.ItemType.IsStandardScalar()) 831if (((colInfo.OutputCountVector && col.IsKey) || col.Kind != SchemaShape.Column.VectorKind.VariableVector) && keyMeta.ItemType is TextDataViewType) 832metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, keyMeta.ItemType, false));
Transforms\Normalizer.cs (3)
356if (!col.ItemType.Equals(NumberDataViewType.Single) && !col.ItemType.Equals(NumberDataViewType.Double)) 365result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, col.Kind, col.ItemType, col.IsKey, meta);
Transforms\TypeConverting.cs (8)
630if (!TypeConvertingTransformer.GetNewType(Host, col.ItemType, colInfo.OutputKind.ToInternalDataKind(), colInfo.OutputKeyCount, out PrimitiveDataViewType newType)) 632if (!Data.Conversion.Conversions.DefaultInstance.TryGetStandardConversion(col.ItemType, newType, out Delegate del, out bool identity)) 635if (col.ItemType is BooleanDataViewType && newType is NumberDataViewType) 639metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, slotMeta.ItemType, false)); 641if (col.ItemType is KeyDataViewType) 642metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, keyMeta.ItemType, false)); 644if (col.ItemType is NumberDataViewType && newType is NumberDataViewType) 645metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.KeyValues, SchemaShape.Column.VectorKind.Vector, normMeta.ItemType, false));
Transforms\ValueToKeyMappingEstimator.cs (2)
187if (!col.ItemType.IsStandardScalar()) 196colInfo.AddKeyValueAnnotationsAsText ? TextDataViewType.Instance : col.ItemType, col.IsKey);
Microsoft.ML.FastTree (1)
FastTreeRanking.cs (1)
129if (!labelCol.IsKey && labelCol.ItemType != NumberDataViewType.Single)
Microsoft.ML.ImageAnalytics (8)
ImageGrayscale.cs (2)
254if (!(col.ItemType is ImageDataViewType) || col.Kind != SchemaShape.Column.VectorKind.Scalar) 257result[colInfo.outputColumnName] = new SchemaShape.Column(colInfo.outputColumnName, col.Kind, col.ItemType, col.IsKey, col.Annotations);
ImageLoader.cs (1)
445if (!(col.ItemType is TextDataViewType) || col.Kind != SchemaShape.Column.VectorKind.Scalar)
ImagePixelExtractor.cs (1)
817if (!(col.ItemType is ImageDataViewType) || col.Kind != SchemaShape.Column.VectorKind.Scalar)
ImageResizer.cs (1)
517if (!(col.ItemType is ImageDataViewType) || col.Kind != SchemaShape.Column.VectorKind.Scalar)
VectorToImageTransform.cs (3)
751if (col.Kind != SchemaShape.Column.VectorKind.Vector || (col.ItemType != NumberDataViewType.Single && col.ItemType != NumberDataViewType.Double && col.ItemType != NumberDataViewType.Byte))
Microsoft.ML.LightGbm (1)
LightGbmRankingTrainer.cs (1)
277if (!labelCol.IsKey && labelCol.ItemType != NumberDataViewType.Single)
Microsoft.ML.Mkl.Components (2)
VectorWhitening.cs (2)
898var reason = VectorWhiteningTransformer.TestColumn(col.ItemType); 901result[colPair.Name] = new SchemaShape.Column(colPair.Name, col.Kind, col.ItemType, col.IsKey, null);
Microsoft.ML.OnnxTransformer (2)
OnnxTransform.cs (2)
1079if (col.ItemType != expectedType) 1080throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", input, expectedType.ToString(), col.ItemType.ToString());
Microsoft.ML.PCA (1)
PcaTransformer.cs (1)
824if (col.Kind != SchemaShape.Column.VectorKind.Vector || !col.ItemType.Equals(NumberDataViewType.Single))
Microsoft.ML.TensorFlow (2)
TensorflowTransform.cs (2)
1041if (col.ItemType != expectedType) 1042throw _host.ExceptSchemaMismatch(nameof(inputSchema), "input", input, expectedType.ToString(), col.ItemType.ToString());
Microsoft.ML.Tests (6)
Transformers\ValueMappingTests.cs (6)
380Assert.Equal(typeof(int), dColumn.ItemType.RawType); 383Assert.Equal(typeof(int), eColumn.ItemType.RawType); 386Assert.Equal(typeof(int), fColumn.ItemType.RawType); 411Assert.Equal(typeof(uint), dColumn.ItemType.RawType); 414Assert.Equal(typeof(uint), eColumn.ItemType.RawType); 417Assert.Equal(typeof(uint), fColumn.ItemType.RawType);
Microsoft.ML.TimeSeries (6)
IidChangePointDetector.cs (1)
267if (col.ItemType != NumberDataViewType.Single)
IidSpikeDetector.cs (1)
243if (col.ItemType != NumberDataViewType.Single)
SRCNNAnomalyDetector.cs (1)
275if (col.ItemType != NumberDataViewType.Single)
SsaChangePointDetector.cs (1)
303if (col.ItemType != NumberDataViewType.Single)
SSaForecasting.cs (1)
336if (col.ItemType != NumberDataViewType.Single)
SsaSpikeDetector.cs (1)
282if (col.ItemType != NumberDataViewType.Single)
Microsoft.ML.TorchSharp (16)
AutoFormerV2\ObjectDetectionTrainer.cs (4)
482if (labelCol.Kind != SchemaShape.Column.VectorKind.VariableVector || labelCol.ItemType.RawType != typeof(UInt32)) 488if (boundingBoxCol.Kind != SchemaShape.Column.VectorKind.VariableVector || boundingBoxCol.ItemType.RawType != typeof(Single)) 494if (imageCol.ItemType.RawType != typeof(MLImage)) 578if (imageCol.ItemType != new ImageDataViewType())
NasBert\NasBertTrainer.cs (6)
367if (sentenceCol.ItemType != TextDataViewType.Instance) 376if (labelCol.ItemType != NumberDataViewType.UInt32) 385if (sentenceCol2.ItemType != TextDataViewType.Instance) 392if (labelCol.ItemType != NumberDataViewType.UInt32) 398if (labelCol.ItemType != NumberDataViewType.Single) 404if (sentenceCol2.ItemType != TextDataViewType.Instance)
Roberta\QATrainer.cs (6)
533if (contextCol.Kind != SchemaShape.Column.VectorKind.Scalar || contextCol.ItemType.RawType != typeof(ReadOnlyMemory<char>)) 539if (questionCol.Kind != SchemaShape.Column.VectorKind.Scalar || questionCol.ItemType.RawType != typeof(ReadOnlyMemory<char>)) 545if (answerCol.Kind != SchemaShape.Column.VectorKind.Scalar || answerCol.ItemType.RawType != typeof(ReadOnlyMemory<char>)) 551if (answerIndexCol.Kind != SchemaShape.Column.VectorKind.Scalar || answerIndexCol.ItemType.RawType != typeof(int)) 619if (contextCol.ItemType != TextDataViewType.Instance) 625if (questionCol.ItemType != TextDataViewType.Instance)
Microsoft.ML.TorchSharp.Tests (10)
NerTests.cs (3)
77Assert.Equal(TextDataViewType.Instance, estimatorSchema[2].ItemType); 156Assert.Equal(TextDataViewType.Instance, estimatorSchema[2].ItemType); 230Assert.Equal(TextDataViewType.Instance, estimatorSchema[2].ItemType);
QATests.cs (2)
49Assert.Equal(TextDataViewType.Instance, estimatorSchema[4].ItemType); 50Assert.Equal(NumberDataViewType.Single, estimatorSchema[5].ItemType);
TextClassificationTests.cs (5)
106Assert.Equal(TextDataViewType.Instance, estimatorSchema[3].ItemType); 244Assert.Equal(TextDataViewType.Instance, estimatorSchema[3].ItemType); 328Assert.Equal(TextDataViewType.Instance, estimatorSchema[3].ItemType); 394Assert.Equal(NumberDataViewType.Single, estimatorSchema[3].ItemType); 401Assert.Equal(NumberDataViewType.Single, estimatorSchema[3].ItemType);
Microsoft.ML.Transforms (44)
CountFeatureSelection.cs (2)
172if (!CountFeatureSelectionUtils.IsValidColumnType(col.ItemType)) 183result[colPair.Name] = new SchemaShape.Column(colPair.Name, col.Kind, col.ItemType, false, new SchemaShape(metadata.ToArray()));
CustomMappingTransformer.cs (1)
267if (itemType != column.ItemType || isKey != column.IsKey
Dracula\CountTableTransformer.cs (1)
335if (!col.IsKey || !col.ItemType.Equals(NumberDataViewType.UInt32))
ExpressionTransformer.cs (1)
128inputTypes[isrc] = col.ItemType;
GcnTransform.cs (2)
901return col.ItemType == NumberDataViewType.Single; 924result[colPair.Name] = new SchemaShape.Column(colPair.Name, col.Kind, col.ItemType, false, new SchemaShape(metadata.ToArray()));
KeyToVectorMapping.cs (4)
475if (!(col.ItemType is VectorDataViewType || col.ItemType is PrimitiveDataViewType)) 480if (col.Kind != SchemaShape.Column.VectorKind.VariableVector && keyMeta.ItemType is TextDataViewType) 481metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, keyMeta.ItemType, false));
MissingValueDroppingTransformer.cs (3)
49if (!Data.Conversion.Conversions.DefaultInstance.TryGetIsNAPredicate(originalColumn.ItemType, out _)) 50throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", originalColumn.Name, "Single, Double or Key", originalColumn.ItemType.ToString()); 51var col = new SchemaShape.Column(outputColumnName, SchemaShape.Column.VectorKind.VariableVector, originalColumn.ItemType, originalColumn.IsKey, originalColumn.Annotations);
MissingValueIndicatorTransformer.cs (2)
540if (!inputSchema.TryFindColumn(colPair.inputColumnName, out var col) || !Data.Conversion.Conversions.DefaultInstance.TryGetIsNAPredicate(col.ItemType, out Delegate del)) 546DataViewType type = !(col.ItemType is VectorDataViewType vectorType) ?
MissingValueReplacing.cs (3)
1042string reason = MissingValueReplacingTransformer.TestType(col.ItemType); 1050var type = !(col.ItemType is VectorDataViewType vectorType) ? 1051col.ItemType :
MutualInformationFeatureSelection.cs (3)
225if (!(label.IsKey || MutualInformationFeatureSelectionUtils.IsValidColumnType(label.ItemType))) 236if (!MutualInformationFeatureSelectionUtils.IsValidColumnType(col.ItemType)) 250result[colPair.outputColumnName] = new SchemaShape.Column(colPair.outputColumnName, col.Kind, col.ItemType, false, new SchemaShape(metadata.ToArray()));
RandomFourierFeaturizing.cs (1)
730if (col.ItemType.RawType != typeof(float) || col.Kind != SchemaShape.Column.VectorKind.Vector)
StatefulCustomMappingTransformer.cs (1)
400if (itemType != column.ItemType || isKey != column.IsKey
Text\LdaTransform.cs (1)
1328if (col.ItemType.RawType != typeof(float) || col.Kind == SchemaShape.Column.VectorKind.Scalar)
Text\NgramHashingTransformer.cs (1)
1201if (!NgramUtils.IsValidNgramRawType(col.ItemType.RawType))
Text\NgramTransform.cs (1)
977if (!NgramUtils.IsValidNgramRawType(col.ItemType.RawType))
Text\StopWordsRemovingTransformer.cs (4)
677if (col.Kind == SchemaShape.Column.VectorKind.Scalar || !(col.ItemType is TextDataViewType)) 678throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", colInfo.InputColumnName, ExpectedColumnType, col.ItemType.ToString()); 1245if (col.Kind == SchemaShape.Column.VectorKind.Scalar || !(col.ItemType is TextDataViewType)) 1246throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", colInfo.inputColumnName, ExpectedColumnType, col.ItemType.ToString());
Text\TextFeaturizingEstimator.cs (1)
639if (!(col.ItemType is TextDataViewType))
Text\TextNormalizing.cs (3)
586if (!IsColumnTypeValid(col.ItemType)) 587throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", colInfo.inputColumnName, TextNormalizingEstimator.ExpectedColumnType, col.ItemType.ToString()); 588result[colInfo.outputColumnName] = new SchemaShape.Column(colInfo.outputColumnName, col.Kind == SchemaShape.Column.VectorKind.Scalar ? SchemaShape.Column.VectorKind.Scalar : SchemaShape.Column.VectorKind.VariableVector, col.ItemType, false);
Text\TokenizingByCharacters.cs (3)
690if (!IsColumnTypeValid(col.ItemType)) 691throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", colInfo.inputColumnName, ExpectedColumnType, col.ItemType.ToString()); 694metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, slotMeta.ItemType, false));
Text\WordBagTransform.cs (2)
191if (!inputSchema.TryFindColumn(_columnName, out SchemaShape.Column outCol) && outCol.ItemType != TextDataViewType.Instance) 476colShape.ItemType is TextDataViewType)
Text\WordEmbeddingsExtractor.cs (1)
938if (!(col.ItemType is TextDataViewType) || (col.Kind != SchemaShape.Column.VectorKind.VariableVector && col.Kind != SchemaShape.Column.VectorKind.Vector))
Text\WordTokenizing.cs (3)
538if (!IsColumnTypeValid(col.ItemType)) 539throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", colInfo.InputColumnName, ExpectedColumnType, col.ItemType.ToString()); 540result[colInfo.Name] = new SchemaShape.Column(colInfo.Name, SchemaShape.Column.VectorKind.VariableVector, col.ItemType, false);
Microsoft.ML.Vision (2)
DnnRetrainTransform.cs (2)
1266if (col.ItemType != expectedType) 1267throw _host.ExceptSchemaMismatch(nameof(inputSchema), "input", input, expectedType.ToString(), col.ItemType.ToString());