kds library gives AttributeError: module 'kds' has no attribute 'metrics'

Viewed 282

Hi I am trying to use pypi kds package. I have installed it with: pip install kds
I didn't have any installation problem. But when I ran the following example script:

# REPRODUCABLE EXAMPLE
# Load Dataset and train-test split
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn import tree

X, y = load_iris(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33,random_state=3)
clf = tree.DecisionTreeClassifier(max_depth=1,random_state=3)
clf = clf.fit(X_train, y_train)
y_prob = clf.predict_proba(X_test)

# The magic happens here
import kds
kds.metrics.report(y_test, y_prob)

It gives an error:

AttributeError                            Traceback (most recent call last)
<ipython-input-4-fa00bcb248e7> in <module>
     13 # The magic happens here
     14 import kds
---> 15 kds.metrics.report(y_test, y_prob)

AttributeError: module 'kds' has no attribute 'metrics'
1 Answers

Issue is resolved in the latest version. Please update the package using pip install kds

Also don't forget the y_prob[:,1] in the last line. (output of scikit learn has 2 columns, so select 1 column)

# The magic happens here
import kds
kds.metrics.plot_lift(y_test, y_prob[:,1])
Related