Model.get_attr

In [ ]:
Model.get_attr(attr_name: str = "")

Returns the model attribute.

Parameters

Name Type Optional Description
attr_name
str
Attribute Name.

Returns

tablesample : model attribute.

Example

In [1]:
from verticapy.learn.cluster import KMeans
model = KMeans(name = "public.kmeans_iris")
model.fit("public.iris", ["PetalLengthCm", "SepalLengthCm", "SepalWidthCm"])
model.get_attr()
Abc
attr_name
Varchar(128)
Abc
Long varchar(32000000)
123
#_of_rows
Integer
1centers8
2metrics1
Out[1]:

In [2]:
model.get_attr("centers")
123
petallengthcm
Float
123
sepallengthcm
Float
123
sepalwidthcm
Float
11.517647058823535.370588235294123.8
26.37.4753.125
33.883333333333335.51252.58333333333333
45.568181818181826.527272727272733.04090909090909
54.767857142857145.985714285714292.78928571428571
64.76.642857142857143.05
71.04.63.6
81.454.8253.209375
Out[2]: