Struct tangram_linear::Regressor [−][src]
Expand description
This struct describes a linear regressor model. You can train one by calling Regressor::train
.
Fields
bias: f32
This is the bias the model learned.
weights: Array1<f32>
These are the weights the model learned.
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: NumberTableColumnView<'_>,
train_options: &TrainOptions,
progress: Progress<'_>
) -> RegressorTrainOutput
pub fn train(
features: ArrayView2<'_, f32>,
labels: NumberTableColumnView<'_>,
train_options: &TrainOptions,
progress: Progress<'_>
) -> RegressorTrainOutput
Train a linear regressor.
Write predictions into predictions
for the input features
.
pub fn compute_feature_contributions(
&self,
features: ArrayView2<'_, f32>
) -> Vec<ComputeShapValuesForExampleOutput>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Regressor
impl UnwindSafe for Regressor
Blanket Implementations
Mutably borrows from an owned value. Read more