Skip to content

Commit

Permalink
bump version: v1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
tasdikrahman committed Apr 13, 2016
1 parent 20e799b commit 8cc89db
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
35 changes: 29 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spammy
:alt:

:Author: `Tasdik Rahman <http://tasdikrahman.me>`__
:Latest version: 1.0.2
:Latest version: 1.0.3

.. contents::
:backlinks: none
Expand All @@ -34,6 +34,25 @@ Example
-------
`[back to top] <#overview>`__

- Your data directory structure should be something similar to

```bash
$ tree /home/tasdik/Dropbox/projects/spammy/examples/test_dataset
/home/tasdik/Dropbox/projects/spammy/examples/test_dataset
├── ham
│   ├── 5458.2001-04-25.kaminski.ham.txt
│   ├── 5459.2001-04-25.kaminski.ham.txt
│   ...
│   ...
│   └── 5851.2001-05-22.kaminski.ham.txt
└── spam
├── 4136.2005-07-05.SA_and_HP.spam.txt
├── 4137.2005-07-05.SA_and_HP.spam.txt
...
...
└── 5269.2005-07-19.SA_and_HP.spam.txt
```

.. code:: python
>>> import os
Expand All @@ -44,8 +63,8 @@ Example
>>> # directory structure
>>> os.listdir(directory)
['spam', 'Summary.txt', 'ham']
>>> os.listdir(os.path.join(directory, 'spam'))[:5]
['4257.2005-04-06.BG.spam.txt', '0724.2004-09-21.BG.spam.txt', '2835.2005-01-19.BG.spam.txt', '2505.2005-01-03.BG.spam.txt', '3992.2005-03-19.BG.spam.txt']
>>> os.listdir(os.path.join(directory, 'spam'))[:3]
['4257.2005-04-06.BG.spam.txt', '0724.2004-09-21.BG.spam.txt', '2835.2005-01-19.BG.spam.txt']
>>>
>>> # Spammy object created
>>> cl = Spammy(directory, limit=100)
Expand Down Expand Up @@ -89,13 +108,17 @@ Example
>>> directory = '/home/tasdik/Dropbox/projects/spammy/examples/training_dataset'
>>> cl = Spammy(directory, limit=300) # training on only 300 spam and ham files
>>> cl.train()
>>> cl.accuracy(directory='/home/tasdik/Dropbox/projects/spammy/examples/test_dataset', label='spam', limit=300)
>>> data_dir = '/home/tasdik/Dropbox/projects/spammy/examples/test_dataset'
>>>
>>> cl.accuracy(directory=data_dir, label='spam', limit=300)
0.9554794520547946
>>> cl.accuracy(directory='/home/tasdik/Dropbox/projects/spammy/examples/test_dataset', label='ham', limit=300)
>>> cl.accuracy(directory=data_dir, label='ham', limit=300)
0.9033333333333333
>>>
**NOTE**: More examples can be found over in the `examples directory <https://github.com/prodicus/spammy/tree/master/examples>`__
**NOTE**:

- More examples can be found over in the `examples directory <https://github.com/prodicus/spammy/tree/master/examples>`__

Installation
------------
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: GPLv3',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
Expand Down
4 changes: 2 additions & 2 deletions spammy/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# @Author: Tasdik Rahman
# @Date: 2016-04-12 10:09:44
# @Last Modified by: Tasdik Rahman
# @Last Modified time: 2016-04-12 16:39:52
# @Last Modified time: 2016-04-12 23:07:34
# @GPLv3 License
# @http://tasdikrahman.me
# @https://github.com/prodicus

VERSION = '1.0.2'
VERSION = '1.0.3'

0 comments on commit 8cc89db

Please sign in to comment.