1 write to _numClasses
Microsoft.ML.StandardTrainers (1)
Standard\LogisticRegression\MulticlassLogisticRegression.cs (1)
175
data.CheckMulticlassLabel(out
_numClasses
);
21 references to _numClasses
Microsoft.ML.StandardTrainers (21)
Standard\LogisticRegression\MulticlassLogisticRegression.cs (21)
127
private protected override int ClassCount =>
_numClasses
;
178
_prior = new Double[
_numClasses
];
183
if (!(labelMetadataType is VectorDataViewType vecType && vecType.ItemType == TextDataViewType.Instance && vecType.Size ==
_numClasses
))
202
_labelNames = new string[
_numClasses
];
207
for (int i = 0; i <
_numClasses
; i++)
228
Contracts.Assert(_labelNames == null || _labelNames.Length ==
_numClasses
);
247
if (Utils.Size(scores) <
_numClasses
)
248
scores = new float[
_numClasses
];
251
for (int c = 0, start =
_numClasses
; c <
_numClasses
; c++, start += NumFeatures)
257
float logZ = MathUtils.SoftMax(scores.AsSpan(0,
_numClasses
));
261
Contracts.Assert(0 <= lab && lab <
_numClasses
);
262
for (int c = 0, start =
_numClasses
; c <
_numClasses
; c++, start += NumFeatures)
295
if (
_numClasses
< 1)
296
throw Contracts.Except("Cannot create a multiclass predictor with {0} classes",
_numClasses
);
297
if (
_numClasses
== 1)
305
return new MaximumEntropyModelParameters(Host, in CurrentWeights,
_numClasses
, NumFeatures, _labelNames, _stats);
314
Contracts.Assert(BiasCount ==
_numClasses
);
345
for (int iLabel = 0; iLabel <
_numClasses
; iLabel++)
365
Contracts.Assert(0 <= iLabel && iLabel <
_numClasses
);