
verticapy.machine_learning.memmodel.linear_model.LinearModelClassifier.predict¶
- LinearModelClassifier.predict(X: Annotated[list | ndarray, 'Array Like Structure']) ndarray ¶
Predicts using the input matrix.
Parameters¶
- X: ArrayLike
The data on which to make the prediction.
Returns¶
- numpy.array
Predicted values.
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(data) Out[6]: array([1, 1])
Note
Refer to
LinearModelClassifier
for more information about the different methods and usages.