项目作者: tonyzeng2016

项目描述 :
Maximum entropy (MaxEnt) classifier
高级语言: C
项目地址: git://github.com/tonyzeng2016/entroPy.git
创建时间: 2017-03-14T06:04:29Z
项目社区:https://github.com/tonyzeng2016/entroPy

开源协议:Other

下载


entroPy

Maximum entropy (MaxEnt) classifier in Python with CPython extension.

Note:only test in Python 2.7 and on Ubuntu 16.04.


License

Installation

for CPython,you must install python-dev on Linux System,such as Ubuntu.

To install entroPy, cd to the entroPy folder and run the install command:

  1. sudo python setup.py install

tutorial and api:

  1. from entroPy import MaxEntClassify
  2. me=MaxEntClassify()
  3. me.append(single_data_feats,single_data_label)
  4. ret=me.train(L2=1)
  5. me.saveModel(model_name)
  6. me.loadModel(model_name)
  7. re=me.classify(single_data_feats)

example:

see: example_titanic.py

data: Titanic on Kaggle.

after prepared the data,to run the example:

  1. python example_titanic.py

trained on train.csv,tested on test.csv and gendermodel.csv, the final accuracy was 82.30%(features chosen arbitrarily).