Skip to content
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

error for example https://pandas-ml.readthedocs.io/en/latest/xgboost.html #121

Closed
Sandy4321 opened this issue Feb 27, 2019 · 1 comment
Closed

Comments

@Sandy4321
Copy link

code from example
https://pandas-ml.readthedocs.io/en/latest/xgboost.html
'''import pandas_ml as pdml
import sklearn.datasets as datasets
df = pdml.ModelFrame(datasets.load_digits())
train_df, test_df = df.cross_validation.train_test_split()
estimator = df.xgboost.XGBClassifier()
train_df.fit(estimator)
predicted = test_df.predict(estimator)
q=1
test_df.metrics.confusion_matrix()
train_df.xgboost.plot_importance()

tuned_parameters = [{'max_depth': [3, 4]}]
cv = df.grid_search.GridSearchCV(df.xgb.XGBClassifier(), tuned_parameters, cv=5)

df.fit(cv)
df.grid_search.describe(cv)
q=1

'''

gives error
'''
File "E:\Pandas\my_code\S_pandas_ml_feb27.py", line 10, in
train_df.xgboost.plot_importance()
File "C:\Users\sndr\Anaconda3\Lib\site-packages\pandas_ml\xgboost\base.py", line 61, in plot_importance
return xgb.plot_importance(self._df.estimator.booster(),

builtins.TypeError: 'str' object is not callable
'''
I use
Windows and 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)]
Python Type "help", "copyright", "credits" or "license" for more information.

@sinhrks
Copy link
Member

sinhrks commented Mar 5, 2019

Thanks for the report. This should be fixed in latest version (v0.6.1). Note that doc is also updated to fix deprecated module (cross_validation -> model_selection)

@sinhrks sinhrks closed this as completed Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants