Git Product home page Git Product logo

python-weka-wrapper-examples's Introduction

END OF LIFE

Python 2.7 has reached its end-of-life in 2020, you should consider using the Python 3 version of this library, as the Python 2.7 version will no longer get updates!

Examples for the Python3 version are available here.

python-weka-wrapper-examples

Example code for the Python wrapper for Weka (https://github.com/fracpete/python-weka-wrapper).

Some of the examples are modelled after the original Examples for Weka (https://svn.cms.waikato.ac.nz/svn/weka/trunk/wekaexamples/).

Requirements:

  • Python
  • python-weka-wrapper (>= 0.2.0)
  • JDK 1.6+

The Python libraries you can either install using pip install <name> or use pre-built packages available for your platform.

Forum

You can post questions, patches or enhancement requests in the following Google Group:

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

IDEs

Library Setup in Eclipse PyDev

  1. when add external library, path should stop at site-packages, and then import will work as import weka.core.jvm as jvm
  • working: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
  • not working: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/weka
  1. when add source folder as library, same as above, path stop at "src", then then imporit will work as "import wekaexamples.helper as helper"
  • working: ${PROJ_DIR_NAME}/src
  • not working: ${PROJ_DIR_NAME}/src/wekaexamples

python-weka-wrapper-examples's People

Contributors

fracpete avatar keypointt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

python-weka-wrapper-examples's Issues

fix jwrapper() usage

Some example files, like attribute_selection_test still use jwrapper() method call instead of property call jwrapper.

Can't import modules python-weka-wrapper from file

Hi @fracpete i have success install python-weka-wrapper...and running at REPL python...but when i tried in file.py it's always ImportError: No module named core.jvm i install with :

  • sudo pip install javabridge
  • sudo pip install python-weka-wrapper

name 'args' is not defined

Hello, sorry again, i want to ask, why i am getting "name 'args' is not defined" error when i try to run:

load a dataset

helper.print_info("Loading train: " + args[1])
loader = Loader(classname="weka.core.converters.ArffLoader")
train = loader.load_file(args[1])
train.class_index = train.num_attributes - 1
helper.print_info("Loading test: " + args[2])
test = loader.load_file(args[2])
test.class_is_last()

from your "output_class_distribution" example.
Btw i am trying to build prediction using weka classifier. Thank you. Sorry if my question's so basic.

Wii you implement bayes net ?

I have tried this library, but when i want to try classifier bayes net is does not implement right ? maybe it's good to implement

JVMNotFoundError: Can't find the Java Virtual Machine

I want to use Weka in my python code, so I install java-wrapper python(2.7.16 ) according to https://fracpete.github.io/python-weka-wrapper/install.html and my java version is:
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

Also, I added the JDK path to user variable PATH according to https://troubleshooter.xyz/wiki/fix-java-virtual-machine-jvm-not-found-error/

but it raise error:

   >>>import os
   >>>import traceback
   >>>import weka.core.jvm as jvm
   Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "C:\Python27\lib\site-packages\weka\core\jvm.py", line 17, in 
   <module>
    import javabridge
   File "C:\Python27\lib\site-packages\javabridge\__init__.py", line 38, in 
    <module>
    from .jutil import start_vm, kill_vm, vm, activate_awt, deactivate_awt
    File "C:\Python27\lib\site-packages\javabridge\jutil.py", line 151, in 
    <module>
    os.pathsep + os.path.join(find_javahome(), "bin")
    File "C:\Python27\lib\site-packages\javabridge\jutil.py", line 139, in 
    _find_jvm
    raise JVMNotFoundError()
    javabridge.jutil.JVMNotFoundError: Can't find the Java Virtual Machine

I am using Windows 10, Does it may be related to my Windows?
for both user variable and system variable --> JAVA_HOME=C:\Program Files\Java\jdk1.8.0_181\bin and JAVA_HOME= C:\Program Files\Java\jre1.8.0_181\bin
PATH=C:\Program Files\Java\jdk1.8.0_181\bin and PATH=C:\Program Files\Java\jre1.8.0_181\bin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.