Struct tangram_linear::MulticlassClassifier [−][src]
pub struct MulticlassClassifier { pub biases: Array1<f32>, pub weights: Array2<f32>, pub means: Vec<f32>, }
Expand description
This struct describes a linear multiclass classifier model. You can train one by calling MulticlassClassifier::train
.
Fields
biases: Array1<f32>
These are the biases the model learned.
weights: Array2<f32>
These are the weights the model learned. The shape is (n_features, n_classes).
means: Vec<f32>
These are the mean values of each feature in the training set. They are used to compute SHAP values.
Implementations
pub fn train(
features: ArrayView2<'_, f32>,
labels: EnumTableColumnView<'_>,
train_options: &TrainOptions,
progress: Progress<'_>
) -> MulticlassClassifierTrainOutput
pub fn train(
features: ArrayView2<'_, f32>,
labels: EnumTableColumnView<'_>,
train_options: &TrainOptions,
progress: Progress<'_>
) -> MulticlassClassifierTrainOutput
Train a linear multiclass classifier.
pub fn compute_loss(
probabilities: ArrayView2<'_, f32>,
labels: ArrayView1<'_, Option<NonZeroUsize>>
) -> f32
Write predicted probabilities into probabilities
for the input features
.
pub fn compute_feature_contributions(
&self,
features: ArrayView2<'_, f32>
) -> Vec<Vec<ComputeShapValuesForExampleOutput>>
pub fn from_reader(
multiclass_classifier: MulticlassClassifierReader<'_>
) -> MulticlassClassifier
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for MulticlassClassifier
impl Send for MulticlassClassifier
impl Sync for MulticlassClassifier
impl Unpin for MulticlassClassifier
impl UnwindSafe for MulticlassClassifier
Blanket Implementations
Mutably borrows from an owned value. Read more