Loading...

vastorbit.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:

Predicted values.

Return type:

numpy.array

Examples

Import the required module.

from vastorbit.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)

Note

Refer to LinearModelClassifier for more information about the different methods and usages.