-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: 'int' object is not subscriptable #313
Comments
Having the same issue as you, did you manage to resolve it? |
@kevlariii I see that you are using the old API of the library, could you try with the new version ? You can find examples here : https://github.com/parrt/dtreeviz/tree/master/notebooks If the error still persists, would be very helpful if you could prepare a sharable notebook (like google colab) to investigate the issue. Thanks. @LegalWiggle if you could provide one also, would be great. |
@kevlariii @LegalWiggle Just add dtreeviz .model( from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
import dtreeviz
print(dtreeviz.__version__)
#---------------------
viz = dtreeviz.model(regr_TreeClassifier_model,
X_train, # pandas.DataFrame
y_train, # pandas.Series
target_name=Y_TARGET,
feature_names=list(X_train.columns) )
viz.view(scale=0.8) @tlapusan this kind import |
I successfully imported dtreeviz with the command:
from dtreeviz import *
I tried this command:
viz = dtreeviz(clf, xdev, ydev, target_name="isFraud", feature_names = list(xdev.columns), class_names = ['notFraud', 'isFraud'])
I get the error:
TypeError: 'int' object is not subscriptable
Here are my xdev and ydev:
Any idea on where this error might be coming from?
Thank you so much!
The text was updated successfully, but these errors were encountered: