Loading...

verticapy.machine_learning.vertica.preprocessing.Scaler.deploySQL#

Scaler.deploySQL(X: str | list[str] | None = None, key_columns: str | list[str] | None = None, exclude_columns: str | list[str] | 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)

To get the Model Vertica SQL, use below:

model.deploySQL()
Out[22]: 'APPLY_NORMALIZE("values" USING PARAMETERS model_name = \'"public"."_verticapy_tmp_scaler_v_demo_7c4952c4e22d11eea3a80242ac120002_"\', 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.