vastorbit.machine_learning.vast.preprocessing.StandardScaler.inverse_transform¶
- StandardScaler.inverse_transform(vdf: Annotated[str | VastFrame, ''], X: Annotated[str | list[str], 'STRING representing one column or a list of columns'] | None = None) VastFrame¶
Applies the Inverse Model on a
VastFrame.- Parameters:
vdf (SQLRelation) – Input VastFrame. You can also specify a customized relation, but you must enclose it with an alias. For example:
(SELECT 1) xis valid whereas(SELECT 1)andSELECT 1are invalid.X (SQLColumns, optional) –
listof the inputVastColumn.
- Returns:
object result of the model transformation.
- Return type:
Examples
We import
vastorbit:import vastorbit as vo
For this example, we will use a dummy dataset.
data = vo.VastFrame( { "values": [1, 1.01, 1.02, 1.05, 1.024], } )
Let’s import the model:
from vastorbit.machine_learning.vast import Scaler
Then we can create the model:
model = Scaler(method = "zscore")
We can now fit the model:
model.fit(data)
To get the scaled dataset, we can use the
transformmethod. Let us transform the data:model.transform(data)
123valuesDecimal(38, 10)1 0.1903683025 2 1.7371107604 3 -1.2373939663 4 -0.642493021 5 -0.0475920756 Rows: 1-5 | Column: values | Type: decimal(38, 10)Similarly, you can perform the inverse transform to get the original features using:
model.inverse_transform(data_transformed)
The variable
data_transformedis the scaled dataset.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.