https://github.com/alpacatechjp/multiarow
Multi-class AROW in python
https://github.com/alpacatechjp/multiarow
Last synced: about 1 year ago
JSON representation
Multi-class AROW in python
- Host: GitHub
- URL: https://github.com/alpacatechjp/multiarow
- Owner: AlpacaTechJP
- Created: 2015-06-23T13:14:35.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-07-09T04:47:03.000Z (about 11 years ago)
- Last Synced: 2024-11-09T11:42:08.748Z (over 1 year ago)
- Language: Python
- Size: 180 KB
- Stars: 4
- Watchers: 9
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Multi-class AROW
This is a simple, mimimalist AROW implementation in python.
## Install
```
$ pip install multiarow
```
## Usage
It is super-simple.
```python
import multiarow
# create an instance
arow = multiarow.AROW()
# train
arow.train('label1', np.array([1,2,3], dtype=np.float))
arow.train('label2', np.array([-1,-2,-3], dtype=np.float))
# classify
predicted = arow.classify(np.array([4,5,9], dtype=np.float))
=> 'label1'
# list up previously trained class labels
labels = arow.list_label()
=> ['label1', 'label2']
# delete a class label
arow.delete_label(label1)
```
If you need to persist the current learning result, you can simply use pickle or joblib.