Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

Commit

Permalink
specifying Python version as 2.7 now
Browse files Browse the repository at this point in the history
  • Loading branch information
fracpete committed May 3, 2016
1 parent 8fc11c3 commit 5967765
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 84 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Expand Up @@ -4,7 +4,7 @@ Changelog
0.3.7 (????-??-??)
------------------

- ...
- upgraded Weka to 3.9.0


0.3.6 (2016-04-02)
Expand Down
84 changes: 4 additions & 80 deletions README.md
Expand Up @@ -6,14 +6,14 @@ using the [javabridge](https://pypi.python.org/pypi/javabridge) library.
Requirements:

* Python 2.7 (does not work with Python 3)
* javabridge (>= 1.0.11)
* javabridge (1.0.11)
* matplotlib (optional)
* pygraphviz (optional)
* PIL (optional)
* Oracle JDK 1.6+
* Oracle JDK 1.7+

Uses:
* Weka (3.7.14-SNAPSHOT rev 12410)
* Weka (3.9.0)

## Installation

Expand All @@ -28,7 +28,7 @@ You can post questions, patches or enhancement requests in the following Google

https://groups.google.com/forum/#!forum/python-weka-wrapper

## Code examples
## Examples
See [python-weka-wrapper-examples](https://github.com/fracpete/python-weka-wrapper-examples)
repository for example code on the various APIs. Also, check out the sphinx
documentation in the **doc** directory. You can generate HTML documentation
Expand All @@ -41,79 +41,3 @@ Available online documentation:
* [API](http://pythonhosted.org/python-weka-wrapper/api.html)
* [Examples](http://pythonhosted.org/python-weka-wrapper/examples.html)

## Command-line examples

Below are some examples of command-line use of the library. You can find these also
on [PyPi](http://pythonhosted.org/python-weka-wrapper/commandline.html).

### Data generators

Artifical data can be generated using one of Weka's data generators, e.g., the `Agrawal` classification generator:

<pre>
python weka/datagenerators.py \
weka.datagenerators.classifiers.classification.Agrawal \
-o /tmp/out.arff
</pre>

### Filters

Filtering a single ARFF dataset, removing the last attribute using the `Remove` filter:

<pre>
python weka/filters.py \
-i /my/datasets/iris.arff \
-o /tmp/out.arff \
-c last \
weka.filters.unsupervised.attribute.Remove \
-R last
</pre>

### Classifiers

Example on how to cross-validate a `J48` classifier (with confidence factor 0.3) on the iris UCI dataset:

<pre>
python weka/classifiers.py \
-t /my/datasets/iris.arff \
-c last \
weka.classifiers.trees.J48
-C 0.3
</pre>

### Clusterers

Example on how to perform classes-to-clusters evaluation for `SimpleKMeans` (with 3 clusters) using the iris UCI dataset:

<pre>
python weka/clusterers.py \
-t /my/datasets/iris.arff \
-c last \
weka.clusterers.SimpleKMeans
-N 3
</pre>

### Attribute selection

You can perform attribute selection using `BestFirst` as search algorithm and `CfsSubsetEval` as evaluator as follows:

<pre>
python weka/attribute_selection.py \
-i /my/datasets/iris.arff \
-x 5 \
-n 42 \
-s "weka.attributeSelection.BestFirst -D 1 -N 5"
weka.attributeSelection.CfsSubsetEval \
-P 1 \
-E 1
</pre>

### Associator

Associators, like `Apriori`, can be run like this:

<pre>
python weka/associators.py \
-t /my/datasets/lung-cancer.arff \
weka.associations.Apriori -N 9 -I
</pre>
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -49,9 +49,9 @@ def download_file(url, outfile):

def download_weka():
"""
Downloads the monolithic Weka jar from sourceforget.net if nececssary.
Downloads the Weka jar from github associated with this release if nececssary.
"""
url = "https://github.com/fracpete/python-weka-wrapper/blob/e4518862a42f234c2f75da46965d4051b07898b4/python/weka/lib/weka.jar?raw=true"
url = "https://github.com/fracpete/python-weka-wrapper/raw/8fc11c3f728fbde705fb817953cb7844d6987ae6/python/weka/lib/weka.jar"
outfile = os.path.join(os.path.dirname(__file__), "python", "weka", "lib", "weka.jar")
if not os.path.exists(outfile):
if not download_file(url, outfile):
Expand Down
2 changes: 1 addition & 1 deletion tests/wekatests/coretests/version.py
Expand Up @@ -26,7 +26,7 @@ def test_version(self):
"""
Tests the version.weka_version() method
"""
self.assertEqual("3.7.14-SNAPSHOT", version.weka_version())
self.assertEqual("3.9.0", version.weka_version())


def suite():
Expand Down

0 comments on commit 5967765

Please sign in to comment.