verticapy.machine_learning.memmodel.linear_model.LinearModel.predict_proba#
- LinearModel.predict_proba(X: list | ndarray) ndarray #
Computes the model’s probabilites using the input matrix.
Parameters#
- X: ArrayLike
The data on which to make the prediction.
Returns#
- numpy.array
Probabilities.
Examples#
Import the required module.
from verticapy.machine_learning.memmodel.linear_model import LinearModelClassifier
We will use the following attributes:
coefficients = [0.5, 1.2] intercept = 2.0
Let’s create a model.
model_lm = LinearModelClassifier(coefficients, intercept)
Create a dataset.
data = [[1.0, 0.3], [2.0, -0.6]]
Compute the predictions.
model_lm.predict_proba(data) Out[6]: array([[0.0541667 , 0.9458333 ], [0.09279295, 0.90720705]])
Note
Refer to
LinearModelClassifier
for more information about the different methods and usages.