memModel.predict

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

Predicts using the model's attributes.

Parameters

Name Type Optional Description
X
list / numpy.array
❌
data.

Returns

numpy.array : Predicted values.

Example

In [13]:
from verticapy.learn.memmodel import memModel
model = memModel("BinaryTreeClassifier", {"children_left": [1, 3, None, None, None], 
                                          "children_right": [2, 4, None, None, None],
                                          "feature": [0, 1, None, None, None],
                                          "threshold": ['female', 30, None, None, None],
                                          "value": [None, None, [0.8, 0.1, 0.1], [0.1, 0.8, 0.1], [0.2, 0.2, 0.6]],
                                          "classes": ['a', 'b', 'c',]})
model.predict([['male', 100], 
               ['female', 20] , 
               ['female', 50]])
Out[13]:
array(['a', 'b', 'c'], dtype='<U1')