Loading...

vastorbit.machine_learning.memmodel.decomposition.PCA.transform_sql

PCA.transform_sql(X: Annotated[list | ndarray, 'Array Like Structure']) list[str]

Transforms and returns the SQL needed to deploy the PCA model.

Parameters:

X (ArrayLike) – The names or values of the input predictors.

Returns:

SQL code.

Return type:

list

Examples

Import the required module.

from vastorbit.machine_learning.memmodel.decomposition import PCA

We will use the following attributes:

principal_components = [
    [0.4, 0.5],
    [0.3, 0.2],
]
mean = [0.1, 0.3]

Let’s create a model.

model_pca = PCA(principal_components, mean)

Create a dataset.

data = [[4, 5]]

Let’s use the following column names:

cnames = ['col1', 'col2']

Get the SQL code needed to deploy the model.

model_pca.transform_sql(cnames)

Note

Refer to PCA for more information about the different methods and usages.