vastorbit.machine_learning.memmodel.preprocessing.OneHotEncoder.transform¶
- OneHotEncoder.transform(X: Annotated[list | ndarray, 'Array Like Structure']) ndarray¶
Transforms and applies the
OneHotEncodermodel to the input matrix.- Parameters:
X (ArrayLike) – The data on which to make the transformation.
- Returns:
Transformed values.
- Return type:
numpy.array
Examples
Import the required module.
from vastorbit.machine_learning.memmodel.preprocessing import OneHotEncoder
Let’s create a model.
model_ohe = OneHotEncoder( categories = [["male", "female"], [1, 2, 3]], drop_first = False, column_naming = None, )
Create a dataset.
data = [["male", 1], ["female", 3]]
Transform the data.
model_ohe.transform(data)
Note
Refer to
OneHotEncoderfor more information about the different methods and usages.