SoftmaxRegressionResult
Snapshot from SoftmaxRegressionStat: per-class linear-model parameters plus cumulative bookkeeping. The K-by-p weights matrix and length-K biases vector define the linear predictors eta[k] = biases[k] + weights[k] . x; the predicted class probability is the softmax over the K logits.
Constructors
SoftmaxRegressionResult
Properties
biases
crossEntropy
Accumulated weighted negative log-likelihood (cross-entropy) over the stream.
featureSize
Number of input features (columns of weights).
numClasses
Number of classes (rows of weights and length of biases).
step
totalWeights
Cumulative weight of observations folded into this result.
weights
True when totalWeights is not positive, including zero, negative values, and NaN.
Functions
logit
logitsInto
Writes the per-class logits for x into destination.
predict
Finds the argmax for x.
All numClasses logits come from one pass over x rather than a pass per class. Scoring a class at a time re-reads the whole context K times, and on a sparse x each of those reads is a search through its stored indices. The single pass costs one length-numClasses buffer, which is the cheaper side of that trade.
probabilities
Softmax probabilities across all classes for x; length numClasses.
probabilitiesInto
Writes softmax probabilities for x into caller-owned destination.