pub type ValidLogisticRegression<F> = LogisticRegressionValidParams<F, Ix1>;
Expand description
Validated version of LogisticRegression
Aliased Type§
struct ValidLogisticRegression<F> { /* private fields */ }
Trait Implementations§
Source§impl<C: Ord + Clone, F: Float, D: Data<Elem = F>, T: AsSingleTargets<Elem = C>> Fit<ArrayBase<D, Dim<[usize; 2]>>, T, Error> for ValidLogisticRegression<F>
impl<C: Ord + Clone, F: Float, D: Data<Elem = F>, T: AsSingleTargets<Elem = C>> Fit<ArrayBase<D, Dim<[usize; 2]>>, T, Error> for ValidLogisticRegression<F>
Source§fn fit(
&self,
dataset: &DatasetBase<ArrayBase<D, Ix2>, T>,
) -> Result<Self::Object>
fn fit( &self, dataset: &DatasetBase<ArrayBase<D, Ix2>, T>, ) -> Result<Self::Object>
Given a 2-dimensional feature matrix array x
with shape
(n_samples, n_features) and an array of target classes to predict,
create a FittedLinearRegression
object which allows making
predictions.
The array of target classes y
must have exactly two discrete values, (e.g. 0 and 1, “cat”
and “dog”, …), which represent the two different classes the model is supposed to
predict.
The array y
must also have exactly n_samples
items, i.e.
exactly as many items as there are rows in the feature matrix x
.
This method returns an error if any of the preconditions are violated,
i.e. any values are Inf
or NaN
, y
doesn’t have as many items as
x
has rows, or if other parameters (gradient_tolerance, alpha) have
been set to inalid values.