Loading...

verticapy.machine_learning.vertica.decomposition.PCA.deployInverseSQL#

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

To get the Model Vertica Inverse SQL, use below:

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