47 instantiations of KeyDataViewType
Microsoft.ML.AutoML.Tests (1)
TransformPostTrainerInferenceTests.cs (1)
62new DatasetColumnInfo("Label", new KeyDataViewType(typeof(uint), 3), ColumnPurpose.Label, new ColumnDimensions(null, null)),
Microsoft.ML.Core (1)
Data\AnnotationUtils.cs (1)
170Interlocked.CompareExchange(ref _scoreColumnSetIdType, new KeyDataViewType(typeof(uint), int.MaxValue), null) ??
Microsoft.ML.Core.Tests (3)
UnitTests\ColumnTypes.cs (1)
60tmp = new KeyDataViewType(rawType, count);
UnitTests\ScoreSchemaTest.cs (2)
37var expectedScoreColumnType = new KeyDataViewType(typeof(uint), keyCount); 94var expectedScoreColumnType = new KeyDataViewType(typeof(uint), keyCount);
Microsoft.ML.Data (23)
Data\SchemaDefinition.cs (1)
445itemType = new KeyDataViewType(dataType, keyAttr.KeyCount.Count.GetValueOrDefault());
DataLoadSave\Binary\Codecs.cs (2)
1261type = new KeyDataViewType(itemType.RawType, count); 1349type = new KeyDataViewType(itemType.RawType, count);
DataLoadSave\Database\DatabaseLoader.cs (2)
580itemType = new KeyDataViewType(kind.ToType(), count); 694keyType = new KeyDataViewType(rawType, keyCount.Count.GetValueOrDefault());
DataLoadSave\FakeSchema.cs (1)
51curType = new KeyDataViewType(((PrimitiveDataViewType)curType).RawType, AllKeySizes);
DataLoadSave\Text\TextLoader.cs (1)
962itemType = new KeyDataViewType(kind.ToType(), count);
DataView\ArrayDataViewBuilder.cs (1)
89_columns.Add(new AssignmentColumn<T1>(new KeyDataViewType(kind.ToType(), keyCount), values));
Evaluators\ClusteringEvaluator.cs (2)
596var key = new KeyDataViewType(typeof(uint), _numClusters); 615var key = new KeyDataViewType(typeof(uint), _numClusters);
Evaluators\EvaluatorUtils.cs (4)
414new KeyDataViewType(typeof(uint), keyCount), (in TSrc src, ref uint dst) => 614var keyType = new KeyDataViewType(typeof(uint), keyNames.Count); 648var keyType = new KeyDataViewType(typeof(uint), keyCount); 682var keyType = new KeyDataViewType(typeof(uint), keyNames.Count);
Evaluators\MulticlassClassificationEvaluator.cs (2)
632var key = new KeyDataViewType(typeof(uint), _numClasses); 661var key = new KeyDataViewType(typeof(uint), _numClasses);
Scorers\BinaryClassifierScorer.cs (1)
306return new KeyDataViewType(typeof(uint), labelNameBindableMapper.Type.Size);
Transforms\Hashing.cs (1)
165var itemType = new KeyDataViewType(typeof(uint), keyCount);
Transforms\TypeConverting.cs (1)
379itemType = new KeyDataViewType(kind.ToType(), count);
Transforms\ValueToKeyMappingTransformerImpl.cs (3)
507OutputType = new KeyDataViewType(typeof(uint), Count == 0 ? 1 : Count); 1114var dstType = new KeyDataViewType(typeof(uint), srcType.Count); 1194var dstType = new KeyDataViewType(typeof(uint), srcType.Count);
Utilities\TypeParsingUtils.cs (1)
66keyType = new KeyDataViewType(rawType, keyCount.Count.GetValueOrDefault());
Microsoft.ML.DataView (1)
KeyDataViewType.cs (1)
60/// <see cref="KeyDataViewType.KeyDataViewType(Type, ulong)"/> constructor by taking an <see cref="int"/> for
Microsoft.ML.FastTree (1)
TreeEnsembleFeaturizer.cs (1)
744KeyDataViewType dstType = new KeyDataViewType(typeof(ulong), type.Count);
Microsoft.ML.PerformanceTests (3)
HashBench.cs (3)
185InitMapMurmurHashV2(6u, new KeyDataViewType(typeof(uint), 100)); 236InitDenseVecMap(new[] { 1u, 2u, 0u, 4u, 5u }, new KeyDataViewType(typeof(uint), 100)); 261InitMapMurmurHashV1(6u, new KeyDataViewType(typeof(uint), 100));
Microsoft.ML.Recommender (2)
MatrixFactorizationPredictor.cs (2)
148MatrixColumnIndexType = new KeyDataViewType(typeof(uint), NumberOfColumns); 149MatrixRowIndexType = new KeyDataViewType(typeof(uint), NumberOfRows);
Microsoft.ML.Tests (5)
FakeSchemaTest.cs (1)
27schemaBuilder.AddColumn("B", new KeyDataViewType(typeof(uint), 17));
Transformers\HashTests.cs (4)
233HashTestCore((byte)value, new KeyDataViewType(typeof(byte), byte.MaxValue - 1), eKey, eoKey, e3Key, ecKey, 0); 238HashTestCore((ushort)value, new KeyDataViewType(typeof(ushort), ushort.MaxValue - 1), eKey, eoKey, e3Key, ecKey, 0); 243HashTestCore((uint)value, new KeyDataViewType(typeof(uint), int.MaxValue - 1), eKey, eoKey, e3Key, ecKey, 0); 269HashTestCore(value, new KeyDataViewType(typeof(ulong), int.MaxValue - 1), eKey, eoKey, e3Key, ecKey, 0);
Microsoft.ML.TorchSharp (4)
AutoFormerV2\ObjectDetectionTrainer.cs (2)
484new VectorDataViewType(new KeyDataViewType(typeof(uint), uint.MaxValue)).ToString(), labelCol.GetTypeString()); 767info[0] = new DataViewSchema.DetachedColumn(_parent.Options.PredictedLabelColumnName, new VectorDataViewType(new KeyDataViewType(typeof(uint), _parent.Options.NumberOfClasses)), labelBuilder.ToAnnotations());
NasBert\NasBertTrainer.cs (2)
534info[0] = new DataViewSchema.DetachedColumn(Parent.Options.PredictionColumnName, new KeyDataViewType(typeof(uint), Parent.Options.NumberOfClasses), labelBuilder.ToAnnotations()); 548info[0] = new DataViewSchema.DetachedColumn(Parent.Options.PredictionColumnName, new VectorDataViewType(new KeyDataViewType(typeof(uint), Parent.Options.NumberOfClasses - 1)), labelBuilder.ToAnnotations());
Microsoft.ML.Transforms (3)
HashJoiningTransform.cs (1)
150return new KeyDataViewType(typeof(uint), keyCount);
SvmLight\SvmLightLoader.cs (1)
644schemaDef[nameof(Indices.FeatureKeys)].ColumnType = new KeyDataViewType(typeof(uint), _featureCount);
Text\TokenizingByCharacters.cs (1)
202var keyType = new KeyDataViewType(typeof(ushort), CharsCount);
283 references to KeyDataViewType
Microsoft.ML.AutoML (1)
Utils\ColumnTypeExtensions.cs (1)
33return columnType is KeyDataViewType;
Microsoft.ML.Core (18)
Data\AnnotationUtils.cs (7)
39/// Annotation kind for sets of score columns. The value is typically a <see cref="KeyDataViewType"/> with raw type U4. 160private static volatile KeyDataViewType _scoreColumnSetIdType; 165public static KeyDataViewType ScoreColumnSetIdType 214/// The annotation type should be a <see cref="KeyDataViewType"/> with raw type U4. 227if (!(columnType is KeyDataViewType) || columnType.RawType != typeof(uint)) 244/// The annotation type should be a <see cref="KeyDataViewType"/> with raw type U4. 251if (columnType is KeyDataViewType && columnType.RawType == typeof(uint))
Data\ColumnTypeExtensions.cs (4)
18/// (not a <see cref="KeyDataViewType"/> or <see cref="StructuredDataViewType"/>, etc). 28public static ulong GetKeyCount(this DataViewType columnType) => (columnType as KeyDataViewType)?.Count ?? 0; 37ectx.Check(count <= int.MaxValue, nameof(KeyDataViewType) + "." + nameof(KeyDataViewType.Count) + " exceeds int.MaxValue.");
Data\IEstimator.cs (3)
66Contracts.CheckParam(!(itemType is KeyDataViewType), nameof(itemType), "Item type cannot be a key"); 68Contracts.CheckParam(!isKey || KeyDataViewType.IsValidDataType(itemType.RawType), nameof(itemType), "The item type must be valid for a key"); 169isKey = itemType is KeyDataViewType;
Data\KeyTypeExtensions.cs (4)
10/// Extension methods related to the <see cref="KeyDataViewType"/> class. 18public static int GetCountAsInt32(this KeyDataViewType key, IExceptionContext ectx = null) 20ectx.Check(key.Count <= int.MaxValue, nameof(KeyDataViewType) + "." + nameof(KeyDataViewType.Count) + " exceeds int.MaxValue.");
Microsoft.ML.Core.Tests (7)
UnitTests\ColumnTypes.cs (1)
54if (!KeyDataViewType.IsValidDataType(rawType))
UnitTests\ScoreSchemaTest.cs (6)
37var expectedScoreColumnType = new KeyDataViewType(typeof(uint), keyCount); 51var actualScoreColumnType = scoreColumn.Type as KeyDataViewType; 94var expectedScoreColumnType = new KeyDataViewType(typeof(uint), keyCount); 108var actualScoreColumnType = scoreColumn.Type as KeyDataViewType;
Microsoft.ML.Data (159)
Commands\ShowSchemaCommand.cs (2)
216if (!type.IsStandardScalar() && !(type is KeyDataViewType)) 255if (!type.ItemType.IsStandardScalar() && !(type.ItemType is KeyDataViewType))
Data\Conversion.cs (18)
51private static readonly FuncInstanceMethodInfo1<Conversions, KeyDataViewType, Delegate> _getKeyParseMethodInfo 52= FuncInstanceMethodInfo1<Conversions, KeyDataViewType, Delegate>.Create(target => target.GetKeyParse<int>); 424if (typeSrc is KeyDataViewType keySrc) 428if (typeDst is KeyDataViewType keyDst) 440if (!KeyDataViewType.IsValidDataType(typeDst.RawType)) 452else if (typeDst is KeyDataViewType keyDst) 462Contracts.Assert(typeSrc is KeyDataViewType || typeSrc.IsStandardScalar()); 463Contracts.Assert(typeDst is KeyDataViewType || typeDst.IsStandardScalar()); 491if (type is KeyDataViewType keyType) 513public ValueMapper<TSrc, SB> GetKeyStringConversion<TSrc>(KeyDataViewType key) 541Contracts.CheckParam(typeDst.IsStandardScalar() || typeDst is KeyDataViewType, nameof(typeDst), 545if (typeDst is KeyDataViewType keyType) 552private TryParseMapper<TDst> GetKeyTryParse<TDst>(KeyDataViewType key) 574private Delegate GetKeyParse(KeyDataViewType key) 579private ValueMapper<TX, TDst> GetKeyParse<TDst>(KeyDataViewType key) 628if (!t.IsStandardScalar() && !(t is KeyDataViewType) || !_isDefaultDelegates.TryGetValue(t.RawType, out del)) 665if (t is KeyDataViewType) 688if (t is KeyDataViewType)
Data\RowCursorUtils.cs (4)
309Contracts.Check(type is KeyDataViewType); 346if (allowKeys && type is KeyDataViewType) 393if (!(type is KeyDataViewType keyType)) 421if (!(type is KeyDataViewType keyType))
Data\SchemaAnnotationsExtensions.cs (1)
51if (!(column.Type.GetItemType() is KeyDataViewType keyType))
Data\SchemaDefinition.cs (7)
15/// Allow member to be marked as a <see cref="KeyDataViewType"/>. 24/// Marks member as <see cref="KeyDataViewType"/>. 27/// Cardinality of <see cref="KeyDataViewType"/> would be maximum legal value of member type. 35/// Marks member as <see cref="KeyDataViewType"/> and specifies <see cref="KeyDataViewType"/> cardinality. 41/// <param name="count">Cardinality of <see cref="KeyDataViewType"/>.</param> 440if (!KeyDataViewType.IsValidDataType(dataType))
DataLoadSave\Binary\CodecFactory.cs (1)
103if (type is KeyDataViewType)
DataLoadSave\Binary\Codecs.cs (9)
1178private readonly KeyDataViewType _type; 1186public KeyCodecOld(CodecFactory factory, KeyDataViewType type, IValueCodec<T> innerCodec) 1243Contracts.CheckDecode(KeyDataViewType.IsValidDataType(itemType.RawType)); 1244KeyDataViewType type; 1275private readonly KeyDataViewType _type; 1283public KeyCodec(CodecFactory factory, KeyDataViewType type, IValueCodec<T> innerCodec) 1340Contracts.CheckDecode(KeyDataViewType.IsValidDataType(itemType.RawType)); 1341KeyDataViewType type; 1359if (!(type is KeyDataViewType))
DataLoadSave\Database\DatabaseLoader.cs (7)
575Contracts.CheckDecode(KeyDataViewType.IsValidDataType(kind.ToType())); 644ctx.Writer.WriteBoolByte(type is KeyDataViewType); 645if (type is KeyDataViewType key) 681/// Construct a <see cref="KeyDataViewType"/> out of the DbType and the keyCount. 683private static KeyDataViewType ConstructKeyType(DbType dbType, KeyCount keyCount) 687KeyDataViewType keyType; 689Contracts.CheckUserArg(KeyDataViewType.IsValidDataType(rawType), nameof(DatabaseLoader.Column.Type), "Bad item type for Key");
DataLoadSave\DataOperationsCatalog.cs (1)
237/// Filter the dataset by the values of a <see cref="KeyDataViewType"/> column.
DataLoadSave\Text\TextLoader.cs (3)
940Contracts.CheckDecode(KeyDataViewType.IsValidDataType(kind.ToType())); 1024ctx.Writer.WriteBoolByte(type is KeyDataViewType); 1025if (type is KeyDataViewType key)
DataLoadSave\Text\TextLoaderParser.cs (7)
86Contracts.Assert(type.IsStandardScalar() || type is KeyDataViewType); 99Contracts.Assert(type.IsStandardScalar() || type is KeyDataViewType); 105public Func<RowSet, ColumnPipe> GetCreatorOne(KeyDataViewType key) 111public Func<RowSet, ColumnPipe> GetCreatorVec(KeyDataViewType key) 699if (info.ColType is KeyDataViewType keyType) 706if (vectorType?.ItemType is KeyDataViewType vectorKeyType) 713Contracts.Assert(itemType is KeyDataViewType || itemType.IsStandardScalar());
DataLoadSave\Text\TextSaver.cs (4)
100Contracts.Assert(type.IsStandardScalar() || type is KeyDataViewType); 329return item.IsStandardScalar() || item is KeyDataViewType; 403ch.Check(itemType is KeyDataViewType || itemType.IsStandardScalar()); 504if (itemType is KeyDataViewType key)
DataView\ArrayDataViewBuilder.cs (1)
82/// <param name="values">The values to add to the column. Note that since this is creating a <see cref="KeyDataViewType"/> column, the values will be offset by 1.</param>
DataView\DataViewConstructionUtils.cs (3)
285if (!(colType is KeyDataViewType keyType)) 378KeyDataViewType keyType = colType as KeyDataViewType;
DataView\LambdaColumnMapper.cs (1)
32env.Check(keyValueGetter == null || typeDst.GetItemType() is KeyDataViewType);
Evaluators\BinaryClassifierEvaluator.cs (1)
177if (labelCol.Type is KeyDataViewType &&
Evaluators\ClusteringEvaluator.cs (3)
100if (type != null && type != NumberDataViewType.Single && !(type is KeyDataViewType keyType && keyType.Count > 0)) 596var key = new KeyDataViewType(typeof(uint), _numClusters); 615var key = new KeyDataViewType(typeof(uint), _numClusters);
Evaluators\EvaluatorUtils.cs (5)
187if (!(type is KeyDataViewType) || type.RawType != typeof(uint)) 578if (!(typeItemType is KeyDataViewType itemKeyType) || typeItemType.RawType != typeof(uint)) 614var keyType = new KeyDataViewType(typeof(uint), keyNames.Count); 648var keyType = new KeyDataViewType(typeof(uint), keyCount); 682var keyType = new KeyDataViewType(typeof(uint), keyNames.Count);
Evaluators\MulticlassClassificationEvaluator.cs (3)
632var key = new KeyDataViewType(typeof(uint), _numClasses); 661var key = new KeyDataViewType(typeof(uint), _numClasses); 1061if (labelType is KeyDataViewType && (!labelCol.HasKeyValues() || labelType.RawType != typeof(uint)))
Evaluators\RankingEvaluator.cs (2)
99if (t != NumberDataViewType.Single && !(t is KeyDataViewType)) 115if (!(t is KeyDataViewType))
Model\Pfa\PfaUtils.cs (2)
180if (itemType is KeyDataViewType keyType) 229if (itemType is KeyDataViewType)
Prediction\CalibratorCatalog.cs (1)
288setIdCol.Type is KeyDataViewType setIdType && setIdType.RawType == typeof(uint) &&
Scorers\BinaryClassifierScorer.cs (3)
208if (Bindings.PredColType is KeyDataViewType) 252if (Bindings.PredColType is KeyDataViewType) 292if (!(Bindings.PredColType is KeyDataViewType))
Scorers\ClusteringScorer.cs (1)
103int keyCount = Bindings.PredColType is KeyDataViewType key ? key.GetCountAsInt32(Host) : 0;
Scorers\PredictedLabelScorerBase.cs (1)
64if (predColType is KeyDataViewType predColKeyType && predColKeyType.Count > 0)
Training\TrainerUtils.cs (5)
90if (col.Type != BooleanDataViewType.Instance && col.Type != NumberDataViewType.Single && col.Type != NumberDataViewType.Double && !(col.Type is KeyDataViewType keyType && keyType.Count == 2)) 92KeyDataViewType colKeyType = col.Type as KeyDataViewType; 145if (col.Type is KeyDataViewType keyType && keyType.Count > 0) 219if (col.Type is KeyDataViewType)
Transforms\Hashing.cs (8)
165var itemType = new KeyDataViewType(typeof(uint), keyCount); 360if (srcType is KeyDataViewType) 407if (srcType.ItemType is KeyDataViewType) 472if (srcType.ItemType is KeyDataViewType) 1375if (_srcTypes[iinfo] is KeyDataViewType) 1443if (_srcTypes[iinfo] is KeyDataViewType) 1450var input = (_srcTypes[iinfo] is KeyDataViewType) ? mulOutput : addOutput; 1894return itemType is TextDataViewType || itemType is KeyDataViewType || itemType is NumberDataViewType ||
Transforms\InvertHashUtils.cs (1)
44if (!(type is KeyDataViewType keyType))
Transforms\KeyToValue.cs (2)
263return new KeyToValueMap<TKey, TValue>(this, (KeyDataViewType)keyItemType, (PrimitiveDataViewType)valItemType, keyMetadata, iinfo); 316public KeyToValueMap(Mapper parent, KeyDataViewType typeKey, PrimitiveDataViewType typeVal, VBuffer<TValue> values, int iinfo)
Transforms\KeyToVector.cs (6)
470KeyDataViewType keyTypeSrc = _infos[iinfo].TypeSrc as KeyDataViewType; 507KeyDataViewType keyTypeSrc = srcVectorType.ItemType as KeyDataViewType; 553KeyDataViewType keyTypeSrc = srcVectorType.ItemType as KeyDataViewType;
Transforms\NAFilter.cs (1)
195if (itemType is KeyDataViewType)
Transforms\NormalizeColumn.cs (3)
813Host.Assert(type is KeyDataViewType || type is NumberDataViewType); 815if (type is KeyDataViewType keyType) 1133if (labelColumnType is KeyDataViewType labelKeyType)
Transforms\RangeFilter.cs (7)
109if (_type is KeyDataViewType) 130_includeMax = options.IncludeMax ?? (options.Max == null || (_type is KeyDataViewType && _max >= 1)); 245Host.Assert(_type is KeyDataViewType); 335Contracts.Assert(filter._type is KeyDataViewType); 343Contracts.Assert(filter._type is KeyDataViewType); 440Ch.Assert(Parent._type is KeyDataViewType); 446Ch.Assert(Parent._type is KeyDataViewType);
Transforms\SlotsDroppingTransformer.cs (1)
502=> (type is KeyDataViewType keytype && 0 < keytype.Count && keytype.Count < Utils.ArrayMaxSize)
Transforms\TypeConverting.cs (10)
331kind = srcType is KeyDataViewType ? srcType.GetRawKind() : InternalDataKind.U8; 359if (!(srcItemType is KeyDataViewType) && !(srcItemType is TextDataViewType)) 362else if (!(srcType.GetItemType() is KeyDataViewType key)) 364else if (!KeyDataViewType.IsValidDataType(kind.ToType())) 371ectx.Assert(KeyDataViewType.IsValidDataType(key.RawType)); 447KeyDataViewType srcItemKeyType = srcItemType as KeyDataViewType; 448KeyDataViewType currentItemKeyType = currentItemType as KeyDataViewType; 641if (col.ItemType is KeyDataViewType)
Transforms\ValueMapping.cs (2)
108var isKey = Transformer.ValueColumnType is KeyDataViewType; 952ValueColumn.Type is KeyDataViewType);
Transforms\ValueToKeyMappingTransformer.cs (3)
223if (itemType is KeyDataViewType || itemType.IsStandardScalar()) 725KeyDataViewType keyType = _parent._unboundMaps[i].OutputType; 761var type = _termMap[iinfo].Map.OutputType;
Transforms\ValueToKeyMappingTransformerImpl.cs (9)
494public readonly KeyDataViewType OutputType; 849if (mapT.ItemType is KeyDataViewType) 1089_host.Assert(TypedMap.ItemType is KeyDataViewType); 1112var srcType = TypedMap.ItemType as KeyDataViewType; 1114var dstType = new KeyDataViewType(typeof(uint), srcType.Count); 1192var srcType = TypedMap.ItemType as KeyDataViewType; 1194var dstType = new KeyDataViewType(typeof(uint), srcType.Count);
Utilities\TypeParsingUtils.cs (10)
53/// Construct a <see cref="KeyDataViewType"/> out of the data kind and the keyCount. 55public static KeyDataViewType ConstructKeyType(InternalDataKind? type, KeyCount keyCount) 59KeyDataViewType keyType; 61Contracts.CheckUserArg(KeyDataViewType.IsValidDataType(rawType), nameof(TextLoader.Column.Type), "Bad item type for Key"); 73/// Defines the cardinality, or count, of valid values of a <see cref="KeyDataViewType"/> column. This needs to be strictly positive. 79/// Initializes the cardinality, or count, of valid values of a <see cref="KeyDataViewType"/> column to the 80/// largest integer that can be expresed by the underlying datatype of the <see cref="KeyDataViewType"/>. 85/// Initializes the cardinality, or count, of valid values of a <see cref="KeyDataViewType"/> column to <paramref name="count"/> 91+ nameof(KeyDataViewType) + " column has to be strictly positive."); 128throw Contracts.ExceptDecode("The minimum logical value of a " + nameof(KeyDataViewType) + " is required to be zero.");
Microsoft.ML.DataView (14)
KeyDataViewType.cs (14)
36/// Initializes a new instance of the <see cref="KeyDataViewType"/> class. 53throw Contracts.ExceptParam(nameof(count), $"The cardinality of a {nameof(KeyDataViewType)} must not exceed {type.Name}.{nameof(uint.MaxValue)} " + 59/// Initializes a new instance of the <see cref="KeyDataViewType"/> class. This differs from the hypothetically more general 60/// <see cref="KeyDataViewType.KeyDataViewType(Type, ulong)"/> constructor by taking an <see cref="int"/> for 76Contracts.CheckParam(0 < count, nameof(count), "The cardinality of a " + nameof(KeyDataViewType) + " must be strictly positive."); 80/// Returns true iff the given type is valid for a <see cref="KeyDataViewType"/>. The valid ones are 119/// <see cref="Count"/> is the cardinality of the <see cref="KeyDataViewType"/>. 129/// Determine if this <see cref="KeyDataViewType"/> object is equal to another <see cref="DataViewType"/> instance. 130/// Checks if the other item is the type of <see cref="KeyDataViewType"/>, if the <see cref="DataViewType.RawType"/> 140if (!(other is KeyDataViewType tmp)) 150/// Determine if a <see cref="KeyDataViewType"/> instance is equal to another <see cref="KeyDataViewType"/> instance. 151/// Checks if any object is the type of <see cref="KeyDataViewType"/>, if the <see cref="DataViewType.RawType"/> 169/// The string representation of the <see cref="KeyDataViewType"/>.
Microsoft.ML.Ensemble (7)
OutputCombiners\BaseStacking.cs (1)
162ch.Check(data.Schema.Label.Value.Type is KeyDataViewType);
PipelineEnsemble.cs (6)
602if (!(labelType is KeyDataViewType labelKeyType)) 612return Utils.MarshalInvoke(CheckKeyLabelColumnCore<int>, mdType.ItemType.RawType, env, models, (KeyDataViewType)labelType, schema, labelCol.Index, mdType); 620env.Assert(!(labelType is KeyDataViewType)); 645private static int CheckKeyLabelColumnCore<T>(IHostEnvironment env, PredictorModel[] models, KeyDataViewType labelType, DataViewSchema schema, int labelIndex, VectorDataViewType keyValuesType) 665var curLabelType = labelCol.Type as KeyDataViewType;
Microsoft.ML.EntryPoints (2)
FeatureCombiner.cs (2)
171if (type is KeyDataViewType keyType) 240if (labelType is KeyDataViewType || labelType is BooleanDataViewType)
Microsoft.ML.FastTree (5)
TreeEnsembleFeaturizer.cs (4)
740string col, KeyDataViewType type, int seed) 744KeyDataViewType dstType = new KeyDataViewType(typeof(ulong), type.Count); 804if (!(labelType is KeyDataViewType)) 811return Utils.MarshalInvoke(AppendFloatMapper<int>, labelType.RawType, env, ch, input, labelName, (KeyDataViewType)labelType,
TreeTrainersCatalog.cs (1)
130/// <param name="labelColumnName">The name of the label column. The column data must be <see cref="System.Single"/> or <see cref="KeyDataViewType"/>.</param>
Microsoft.ML.LightGbm (8)
LightGbmBinaryTrainer.cs (1)
271if (!(labelType is BooleanDataViewType || labelType is KeyDataViewType || labelType == NumberDataViewType.Single))
LightGbmCatalog.cs (2)
159/// <param name="labelColumnName">The name of the label column. The column data must be <see cref="System.Single"/> or <see cref="KeyDataViewType"/>.</param> 230/// <param name="labelColumnName">The name of the label column. The column data must be <see cref="KeyDataViewType"/>.</param>
LightGbmMulticlassTrainer.cs (2)
241if (!(labelType is BooleanDataViewType || labelType is KeyDataViewType || labelType == NumberDataViewType.Single)) 293if (data.Schema.Label.Value.Type is KeyDataViewType keyType)
LightGbmRankingTrainer.cs (2)
250if (!(labelType is KeyDataViewType || labelType == NumberDataViewType.Single)) 260if (!(groupType == NumberDataViewType.UInt32 || groupType is KeyDataViewType))
LightGbmRegressionTrainer.cs (1)
233if (!(labelType is BooleanDataViewType || labelType is KeyDataViewType || labelType == NumberDataViewType.Single))
Microsoft.ML.OnnxConverter (1)
SaveOnnxCommand.cs (1)
249if (column.Type.GetItemType() is KeyDataViewType keyType)
Microsoft.ML.OnnxTransformer (1)
OnnxTransform.cs (1)
548var isKeyType = itemType is KeyDataViewType;
Microsoft.ML.Recommender (14)
MatrixFactorizationPredictor.cs (2)
92internal MatrixFactorizationModelParameters(IHostEnvironment env, SafeTrainingAndModelBuffer buffer, KeyDataViewType matrixColumnIndexType, KeyDataViewType matrixRowIndexType)
MatrixFactorizationTrainer.cs (6)
151/// The column data must be <see cref="Microsoft.ML.Data.KeyDataViewType"/>. 157/// The column data must be <see cref="Microsoft.ML.Data.KeyDataViewType"/>. 487predictor = new MatrixFactorizationModelParameters(_host, buffer, (KeyDataViewType)matrixColumnIndexColInfo.Type, (KeyDataViewType)matrixRowIndexColInfo.Type); 505predictor = new MatrixFactorizationModelParameters(_host, buffer, (KeyDataViewType)matrixColumnIndexColInfo.Type, (KeyDataViewType)matrixRowIndexColInfo.Type);
RecommenderCatalog.cs (2)
56/// The column data must be <see cref="Microsoft.ML.Data.KeyDataViewType"/>.</param> 58/// The column data must be <see cref="Microsoft.ML.Data.KeyDataViewType"/>.</param>
RecommenderUtils.cs (4)
33private static bool TryMarshalGoodRowColumnType(DataViewType type, out KeyDataViewType keyType) 35keyType = type as KeyDataViewType; 48private static KeyDataViewType CheckRowColumnType(RoleMappedData data, RoleMappedSchema.ColumnRole role, out DataViewSchema.Column col, bool isDecode) 66KeyDataViewType keyType;
Microsoft.ML.StandardTrainers (5)
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (2)
138Host.Check(labelCol.Type == NumberDataViewType.Single || labelCol.Type is KeyDataViewType, 145if (labelCol.Type is KeyDataViewType labelKeyType)
StandardTrainersCatalog.cs (3)
297/// <param name="labelColumnName">The name of the label column. The column data must be <see cref="Microsoft.ML.Data.KeyDataViewType"/>.</param> 347/// <param name="labelColumnName">The name of the label column. The column data must be <see cref="Microsoft.ML.Data.KeyDataViewType"/>.</param> 636/// <param name="labelColumnName">The name of the label column. The column data must be <see cref="Microsoft.ML.Data.KeyDataViewType"/>.</param>
Microsoft.ML.TestFrameworkCommon (3)
TestCommon.cs (3)
123ulong ksize = type1.GetItemType() is KeyDataViewType keyType ? keyType.Count : 0; 249Assert.False(size > int.MaxValue, $"{nameof(KeyDataViewType)}.{nameof(KeyDataViewType.Count)} is larger than int.MaxValue");
Microsoft.ML.Tests (19)
TextLoaderTests.cs (1)
822Assert.True(result.Schema[featureIdx].Type is KeyDataViewType keyType && keyType.Count == typeof(uint).ToMaxInt());
TrainerEstimators\MatrixFactorizationTests.cs (14)
236Assert.True(model.MatrixColumnIndexColumnType is KeyDataViewType); 237Assert.True(model.MatrixRowIndexColumnType is KeyDataViewType); 238var matColKeyType = (KeyDataViewType)model.MatrixColumnIndexColumnType; 240var matRowKeyType = (KeyDataViewType)model.MatrixRowIndexColumnType; 348var matColKeyType = model.MatrixColumnIndexColumnType as KeyDataViewType; 350var matRowKeyType = model.MatrixRowIndexColumnType as KeyDataViewType; 795var matColKeyType = model.MatrixColumnIndexColumnType as KeyDataViewType; 797var matRowKeyType = model.MatrixRowIndexColumnType as KeyDataViewType;
Transformers\CopyColumnEstimatorTests.cs (2)
149var key = itemType1 as KeyDataViewType;
Transformers\HashTests.cs (1)
367Assert.True(hashedCol.Type.GetItemType() is KeyDataViewType);
Transformers\ValueMappingTests.cs (1)
741Assert.True(result.Schema[labelIdx].Type is KeyDataViewType);
Microsoft.ML.Transforms (17)
Dracula\CountTableTransformer.cs (2)
226_host.Assert(type is KeyDataViewType || type is NumberDataViewType || type is BooleanDataViewType); 242if (type is KeyDataViewType)
HashJoiningTransform.cs (2)
136var itemType = GetItemType(numberOfBits); 147private static KeyDataViewType GetItemType(int numberOfBits)
KeyToVectorMapping.cs (2)
354Host.Assert(_infos[iinfo].TypeSrc is KeyDataViewType); 385Host.Assert(typeSrc.ItemType is KeyDataViewType);
PermutationFeatureImportanceExtensions.cs (4)
363/// <param name="labelColumnName">Label column name. The column data must be <see cref="KeyDataViewType"/>.</param> 426/// <param name="labelColumnName">Label column name. The column data must be <see cref="KeyDataViewType"/>.</param> 522/// <param name="labelColumnName">Label column name. The column data must be <see cref="System.Single"/> or <see cref="KeyDataViewType"/>.</param> 587/// <param name="labelColumnName">Label column name. The column data must be <see cref="System.Single"/> or <see cref="KeyDataViewType"/>.</param>
SvmLight\SvmLightLoader.cs (2)
584var keyType = keyCol.Value.Type.GetItemType() as KeyDataViewType;
Text\NgramHashingTransformer.cs (2)
572t => (t.GetItemType() is KeyDataViewType keyType && keyType.Count > 0) ? (uint)keyType.Count : uint.MaxValue).ToArray(); 1186if (!(vectorType.ItemType is KeyDataViewType itemKeyType))
Text\NgramTransform.cs (2)
245env.Assert(srcTypes[iinfo] is VectorDataViewType vectorType && vectorType.ItemType is KeyDataViewType); 962if (!(vectorType.ItemType is KeyDataViewType itemKeyType))
Text\TokenizingByCharacters.cs (1)
202var keyType = new KeyDataViewType(typeof(ushort), CharsCount);
Microsoft.ML.Vision (2)
DnnRetrainTransform.cs (2)
266if (type is KeyDataViewType && actualType == typeof(UInt32)) 473if (input.Schema[colIndex].Type is KeyDataViewType && type.RawType == typeof(Int64))