Skip to content

tonyzeng2016/entroPy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

sudo python setup.py install

tutorial and api:

from entroPy  import MaxEntClassify

me=MaxEntClassify() 

me.append(single_data_feats,single_data_label)

ret=me.train(L2=1)

me.saveModel(model_name)

me.loadModel(model_name)

re=me.classify(single_data_feats)

example:

see: example_titanic.py

data: Titanic on Kaggle.

after prepared the data,to run the example:

python example_titanic.py

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

Releases

No releases published

Packages

No packages published