1 write to Count
Microsoft.ML.DataView (1)
KeyDataViewType.cs (1)
55Count = count;
77 references to Count
Microsoft.ML.Core (5)
Data\ColumnTypeExtensions.cs (2)
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\KeyTypeExtensions.cs (3)
20ectx.Check(key.Count <= int.MaxValue, nameof(KeyDataViewType) + "." + nameof(KeyDataViewType.Count) + " exceeds int.MaxValue."); 21return (int)key.Count;
Microsoft.ML.Core.Tests (4)
UnitTests\ScoreSchemaTest.cs (4)
53Assert.Equal(expectedScoreColumnType.Count, actualScoreColumnType.Count); 110Assert.Equal(expectedScoreColumnType.Count, actualScoreColumnType.Count);
Microsoft.ML.Data (36)
Data\Conversion.cs (6)
432if (keySrc.Count != keyDst.Count) 444if (keySrc.Count > typeDst.RawType.ToMaxInt()) 519ulong count = key.Count; 557ulong max = key.Count - 1; 584ulong max = key.Count - 1;
Data\RowCursorUtils.cs (2)
397ulong keyMax = (ulong)keyType.Count; 426ulong keyMax = (ulong)keyType.Count;
Data\SchemaAnnotationsExtensions.cs (1)
61&& keyType.Count == (ulong)vectorType.Size
DataLoadSave\Binary\Codecs.cs (2)
1203writer.Write(_type.Count); 1300writer.Write(_type.Count);
DataLoadSave\Database\DatabaseLoader.cs (1)
646ctx.Writer.Write(key.Count);
DataLoadSave\Text\TextLoader.cs (1)
1026ctx.Writer.Write(key.Count);
DataLoadSave\Text\TextSaver.cs (1)
505keyCount = new KeyCount(key.Count);
DataView\DataViewConstructionUtils.cs (1)
390ulong max = keyType.Count - 1;
Evaluators\ClusteringEvaluator.cs (1)
100if (type != null && type != NumberDataViewType.Single && !(type is KeyDataViewType keyType && keyType.Count > 0))
Evaluators\EvaluatorUtils.cs (1)
583keyValueMappers[i] = new int[itemKeyType.Count];
Model\Pfa\PfaUtils.cs (1)
184if (keyType.Count > 0 || keyType.RawType != typeof(ulong))
Scorers\PredictedLabelScorerBase.cs (2)
64if (predColType is KeyDataViewType predColKeyType && predColKeyType.Count > 0) 69if (trainLabelColumn?.Type is VectorDataViewType trainLabelColVecType && (ulong)trainLabelColVecType.Size == predColKeyType.Count)
Training\TrainerUtils.cs (7)
90if (col.Type != BooleanDataViewType.Instance && col.Type != NumberDataViewType.Single && col.Type != NumberDataViewType.Double && !(col.Type is KeyDataViewType keyType && keyType.Count == 2)) 95if (colKeyType.Count == 1) 101else if (colKeyType.Count > 2) 145if (col.Type is KeyDataViewType keyType && keyType.Count > 0) 147if (keyType.Count >= Utils.ArrayMaxSize) 148throw Contracts.ExceptParam(nameof(data), "Maximum label is too large for multi-class: {0}.", keyType.Count); 149count = (int)keyType.Count;
Transforms\NormalizeColumn.cs (1)
1134host.CheckUserArg(labelKeyType.Count > 0, nameof(args.LabelColumn), "Label column must have a known cardinality");
Transforms\SlotsDroppingTransformer.cs (2)
502=> (type is KeyDataViewType keytype && 0 < keytype.Count && keytype.Count < Utils.ArrayMaxSize)
Transforms\TypeConverting.cs (4)
372ulong count = key.Count; 450srcItemKeyType.Count > 0 && srcItemKeyType.Count == currentItemKeyType.Count)
Transforms\ValueToKeyMappingTransformerImpl.cs (2)
1114var dstType = new KeyDataViewType(typeof(uint), srcType.Count); 1194var dstType = new KeyDataViewType(typeof(uint), srcType.Count);
Microsoft.ML.DataView (10)
KeyDataViewType.cs (10)
26/// The other values range up to the value of <see cref="Count"/>. 28/// For example, if you have a key value with a <see cref="Count"/> of 3, then 119/// <see cref="Count"/> is the cardinality of the <see cref="KeyDataViewType"/>. 123/// values ranging from to <c>1</c> through <see cref="Count"/>, inclusive, being the enumeration into whatever 131/// is the same, and if the <see cref="Count"/> is the same. 144if (Count != tmp.Count) 152/// is the same, and if the <see cref="Count"/> is the same. 165return Hashing.CombineHash(RawType.GetHashCode(), Count.GetHashCode()); 175return string.Format("Key<{0}, {1}-{2}>", rawTypeName, 0, Count - 1);
Microsoft.ML.Ensemble (1)
PipelineEnsemble.cs (1)
605if (isBinary && labelKeyType.Count != 2)
Microsoft.ML.EntryPoints (1)
FeatureCombiner.cs (1)
173if (keyType.Count > 0)
Microsoft.ML.FastTree (2)
TreeEnsembleFeaturizer.cs (2)
744KeyDataViewType dstType = new KeyDataViewType(typeof(ulong), type.Count); 770ch.Check(type.Count > 0, "Label must be of known cardinality.");
Microsoft.ML.OnnxConverter (1)
SaveOnnxCommand.cs (1)
254keyType.Count == (ulong)vectorType.Size;
Microsoft.ML.Recommender (1)
RecommenderUtils.cs (1)
36return keyType?.Count > 0 && type.RawType == typeof(uint);
Microsoft.ML.TestFrameworkCommon (2)
TestCommon.cs (2)
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 (9)
TextLoaderTests.cs (1)
822Assert.True(result.Schema[featureIdx].Type is KeyDataViewType keyType && keyType.Count == typeof(uint).ToMaxInt());
TrainerEstimators\MatrixFactorizationTests.cs (6)
239Assert.True(matColKeyType.Count == _synthesizedMatrixColumnCount + _synthesizedMatrixFirstColumnIndex); 241Assert.True(matRowKeyType.Count == _synthesizedMatrixRowCount + _synthesizedMatrixRowCount); 352Assert.True(matColKeyType.Count == _synthesizedMatrixColumnCount); 353Assert.True(matRowKeyType.Count == _synthesizedMatrixRowCount); 799Assert.True(matColKeyType.Count == _matrixColumnCount); 800Assert.True(matRowKeyType.Count == _matrixRowCount);
Transformers\CopyColumnEstimatorTests.cs (2)
151Assert.InRange<ulong>(key.Count, 0, int.MaxValue); 152int size = (int)key.Count;
Microsoft.ML.Transforms (5)
SvmLight\SvmLightLoader.cs (1)
586_featureCount = keyType.Count;
Text\NgramHashingTransformer.cs (3)
572t => (t.GetItemType() is KeyDataViewType keyType && keyType.Count > 0) ? (uint)keyType.Count : uint.MaxValue).ToArray(); 1189if (itemKeyType.Count == 0 && !NgramUtils.IsValidNgramRawType(itemKeyType.RawType))
Text\NgramTransform.cs (1)
965if (itemKeyType.Count == 0 && !NgramUtils.IsValidNgramRawType(itemKeyType.RawType))