Loading...

vastorbit.machine_learning.memmodel.linear_model.LinearModel.predict_sql

LinearModel.predict_sql(X: Annotated[list | ndarray, 'Array Like Structure']) str

Returns the SQL code needed to deploy the model using its attributes.

Parameters:

X (ArrayLike) – The names or values of the input predictors.

Returns:

SQL code.

Return type:

str

Examples

Import the required module.

from vastorbit.machine_learning.memmodel.linear_model import LinearModel

We will use the following attributes:

coefficients = [0.5, 1.2]
intercept = 2.0

Let’s create a model.

model_lm = LinearModel(coefficients, intercept)

Let’s use the following column names:

cnames = ['col1', 'col2']

Get the SQL code needed to deploy the model.

model_lm.predict_sql(cnames)

Note

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