memModel.transform

In [ ]:
memModel.transform(X: list)

Transforms the data using the model's attributes. The type of transformation depends on the type of model. For example, a normalizer model normalizes its data, a PCA model returns the different components, a one-hot encoder returns the encoded columns, etc.

Parameters

Name Type Optional Description
X
list / numpy.array
❌
Data to transform.

Returns

numpy.array : Transformed data.

Example

In [17]:
from verticapy.learn.memmodel import memModel
model = memModel("PCA", {"principal_components": [[0.4, 0.5], [0.3, 0.2],],
                         "mean": [0.1, 0.3]})
model.transform([[0.4, 0.5],
                 [1.3, 4.5],
                 [7.4, 0.9],])
Out[17]:
array([[0.18, 0.19],
       [1.74, 1.44],
       [3.1 , 3.77]])