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