Loading...

verticapy.machine_learning.vertica.preprocessing.RobustScaler.deploySQL

RobustScaler.deploySQL(X: Annotated[str | list[str], 'STRING representing one column or a list of columns'] | None = None, key_columns: Annotated[str | list[str], 'STRING representing one column or a list of columns'] | None = None, exclude_columns: Annotated[str | list[str], 'STRING representing one column or a list of columns'] | None = None) str

Returns the SQL code needed to deploy the model.

Parameters

X: SQLColumns, optional

list of the columns used to deploy the model. If empty, the model predictors are used.

key_columns: SQLColumns, optional

Predictors used during the algorithm computation which will be deployed with the principal components.

exclude_columns: SQLColumns, optional

Columns to exclude from the prediction.

Returns

str

the SQL code needed to deploy the model.

Examples

We import verticapy:

import verticapy as vp

For this example, we will use a dummy dataset.

data = vp.vDataFrame(
    {
        "values": [1, 1.01, 1.02, 1.05, 1.024],
    }
)

Let’s import the model:

from verticapy.machine_learning.vertica import Scaler

Then we can create the model:

model = Scaler(method = "zscore")

We can now fit the model:

model.fit(data)


=======
details
=======
column_name|  avg   |std_dev 
-----------+--------+--------
  values   | 1.02080| 0.01879

To get the Model Vertica SQL, use below:

model.deploySQL()
Out[76]: 'APPLY_NORMALIZE("values" USING PARAMETERS model_name = \'"public"."_verticapy_tmp_scaler_v_demo_c556689055a411ef880f0242ac120002_"\', match_by_pos = \'true\')'

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.