pub struct FittedLogisticRegression<F> { /* private fields */ }Expand description
Fitted logistic regression classifier.
Stores the learned coefficients, intercept, and class labels. For binary classification, stores a single coefficient vector. For multiclass, stores one coefficient vector per class.
Implementations§
Source§impl<F: Float + Send + Sync + ScalarOperand + 'static> FittedLogisticRegression<F>
impl<F: Float + Send + Sync + ScalarOperand + 'static> FittedLogisticRegression<F>
Sourcepub fn weight_matrix(&self) -> &Array2<F>
pub fn weight_matrix(&self) -> &Array2<F>
Returns a reference to the full weight matrix.
For binary classification, shape is (1, n_features).
For multiclass, shape is (n_classes, n_features).
Sourcepub fn intercept_vec(&self) -> &Array1<F>
pub fn intercept_vec(&self) -> &Array1<F>
Returns a reference to the intercept vector (one per class).
Sourcepub fn predict_proba(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
pub fn predict_proba(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
Predict class probabilities for the given feature matrix.
For binary classification, returns an array of shape (n_samples, 2).
For multiclass, returns shape (n_samples, n_classes).
§Errors
Returns FerroError::ShapeMismatch if the number of features
does not match the fitted model.
Trait Implementations§
Source§impl<F: Clone> Clone for FittedLogisticRegression<F>
impl<F: Clone> Clone for FittedLogisticRegression<F>
Source§fn clone(&self) -> FittedLogisticRegression<F>
fn clone(&self) -> FittedLogisticRegression<F>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<F: Debug> Debug for FittedLogisticRegression<F>
impl<F: Debug> Debug for FittedLogisticRegression<F>
Source§impl<F: Float + Send + Sync + ScalarOperand + 'static> HasClasses for FittedLogisticRegression<F>
impl<F: Float + Send + Sync + ScalarOperand + 'static> HasClasses for FittedLogisticRegression<F>
Source§impl<F: Float + Send + Sync + ScalarOperand + 'static> HasCoefficients<F> for FittedLogisticRegression<F>
impl<F: Float + Send + Sync + ScalarOperand + 'static> HasCoefficients<F> for FittedLogisticRegression<F>
Source§impl<F: Float + Send + Sync + ScalarOperand + 'static> Predict<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FittedLogisticRegression<F>
impl<F: Float + Send + Sync + ScalarOperand + 'static> Predict<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FittedLogisticRegression<F>
Source§fn predict(&self, x: &Array2<F>) -> Result<Array1<usize>, FerroError>
fn predict(&self, x: &Array2<F>) -> Result<Array1<usize>, FerroError>
Predict class labels for the given feature matrix.
Returns the class with the highest predicted probability.
§Errors
Returns FerroError::ShapeMismatch if the number of features
does not match the fitted model.
Source§type Output = ArrayBase<OwnedRepr<usize>, Dim<[usize; 1]>>
type Output = ArrayBase<OwnedRepr<usize>, Dim<[usize; 1]>>
ndarray::Array1<F> or ndarray::Array1<usize>).Source§type Error = FerroError
type Error = FerroError
predict.Auto Trait Implementations§
impl<F> Freeze for FittedLogisticRegression<F>where
F: Freeze,
impl<F> RefUnwindSafe for FittedLogisticRegression<F>where
F: RefUnwindSafe,
impl<F> Send for FittedLogisticRegression<F>where
F: Send,
impl<F> Sync for FittedLogisticRegression<F>where
F: Sync,
impl<F> Unpin for FittedLogisticRegression<F>where
F: Unpin,
impl<F> UnsafeUnpin for FittedLogisticRegression<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for FittedLogisticRegression<F>where
F: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more