Loading...

verticapy.machine_learning.memmodel.preprocessing.StandardScaler.transform_sql#

StandardScaler.transform_sql(X: list | ndarray) list[str]#

Transforms and returns the SQL needed to deploy the Scaler.

Parameters#

X: ArrayLike

The names or values of the input predictors.

Returns#

list

SQL code.

Examples#

Import the required module.

from verticapy.machine_learning.memmodel.preprocessing import StandardScaler

We will use the following attributes:

mean = [0.4, 0.1]

std = [0.5, 0.2]

Let’s create a model.

model_sts = StandardScaler(mean, std)

Let’s use the following column names:

cnames = ['col1', 'col2']

Get the SQL code needed to deploy the model.

model_sts.transform_sql(cnames)
Out[32]: ['(col1 - 0.4) / 0.5', '(col2 - 0.1) / 0.2']

Important

For this example, a specific model is utilized, and it may not correspond exactly to the model you are working with. To see a comprehensive example specific to your class of interest, please refer to that particular class.