glassbox.models.linear_model.logistic¶
LogisticRegression model.
LogisticRegression
¶
Bases: BaseLinearModel
Logistic regression model for binary classification.
Source code in glassbox/models/linear_model/_base.py
fit
¶
Fit the logistic regression model to training data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
X
|
ndarray
|
Training feature matrix of shape (n_samples, n_features). |
required |
y
|
ndarray
|
Training target vector of shape (n_samples,). |
required |
Returns:
| Type | Description |
|---|---|
Self
|
The fitted model instance. |
Source code in glassbox/models/linear_model/logistic.py
predict
¶
Predict class labels for input samples.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
X
|
ndarray
|
Input feature matrix of shape (n_samples, n_features). |
required |
**kwargs
|
Any
|
Additional keyword arguments for prediction. |
{}
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Predicted class labels of shape (n_samples,). |
Source code in glassbox/models/linear_model/logistic.py
predict_proba
¶
Predict class probabilities for input samples.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
X
|
ndarray
|
Input feature matrix of shape (n_samples, n_features). |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Predicted probabilities of shape (n_samples,). |