Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

pandas, scikit-learn, xgboost and seaborn integration

License

NotificationsYou must be signed in to change notification settings

pandas-ml/pandas-ml

Repository files navigation

Latest Docshttps://travis-ci.org/pandas-ml/pandas-ml.svg?branch=master

Overview

pandas,scikit-learnandxgboost integration.

Installation

$ pip install pandas_ml

Documentation

http://pandas-ml.readthedocs.org/en/stable/

Example

>>>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

Supported Packages

  • scikit-learn
  • patsy
  • xgboost

About

pandas, scikit-learn, xgboost and seaborn integration

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp