- Notifications
You must be signed in to change notification settings - Fork78
pandas, scikit-learn, xgboost and seaborn integration
License
NotificationsYou must be signed in to change notification settings
pandas-ml/pandas-ml
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
pandas,scikit-learnandxgboost integration.
$ pip install pandas_ml
http://pandas-ml.readthedocs.org/en/stable/
>>>importpandas_mlaspdml>>>importsklearn.datasetsasdatasets# create ModelFrame instance from sklearn.datasets>>>df=pdml.ModelFrame(datasets.load_digits())>>> type(df)<class'pandas_ml.core.frame.ModelFrame'># binarize data (features), not touching target>>>df.data=df.data.preprocessing.binarize()>>>df.head() .target012345678 ...5455565758596061626300001111000 ...000011100011000111000 ...000001110022000111000 ...100001111033001111000 ...100011110044000110000 ...0000011100[5rowsx65columns]# split to training and test data>>>train_df,test_df=df.model_selection.train_test_split()# create estimator (accessor is mapped to sklearn namespace)>>>estimator=df.svm.LinearSVC()# fit to training data>>>train_df.fit(estimator)# predict test data>>>test_df.predict(estimator)041227...44854498Length:450,dtype:int64# Evaluate the result>>>test_df.metrics.confusion_matrix()Predicted0123456789Target052000000000103710010033202481000110311044010031410004301000501000390000601001035000700002004210802101000331902120000138
scikit-learnpatsyxgboost
About
pandas, scikit-learn, xgboost and seaborn integration
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.