memModel.set_attributes

In [ ]:
memModel.set_attributes(attributes: dict,)

Sets a model's attributes.

Parameters

Name Type Optional Description
attributes
dict
❌
New attributes. See method '__init__' for more information.

Returns

self : memModel.

Example

In [24]:
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.get_attributes()
Out[24]:
{'mean': array([0.1, 0.3]), 'principal_components': array([[0.4, 0.5],
        [0.3, 0.2]])}
In [25]:
model.set_attributes({"principal_components": [[0.1, 0.2], [0.7, 0.8],], "mean": [0.9, 0.8]})
model.get_attributes()
Out[25]:
{'mean': array([0.9, 0.8]), 'principal_components': array([[0.1, 0.2],
        [0.7, 0.8]])}