Loading...

verticapy.machine_learning.vertica.preprocessing.OneHotEncoder.deployInverseSQL

OneHotEncoder.deployInverseSQL(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, X: Annotated[str | list[str], 'STRING representing one column or a list of columns'] | None = None) str

Returns the SQL code needed to deploy the inverse model.

Parameters

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.

X: SQLColumns, optional

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

Returns

str

the SQL code needed to deploy the inverse 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 Inverse SQL, use below:

model.deployInverseSQL()
Out[14]: 'REVERSE_NORMALIZE("values" USING PARAMETERS model_name = \'"public"."_verticapy_tmp_scaler_v_demo_bddf269c55a411ef880f0242ac120002_"\', 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.