Sie sind auf Seite 1von 3

Weka Tutorials:

http://www.cs.utexas.edu/users/ml/tutorials/Weka-tut/sld001.htm
http://www.cs.ccsu.edu/~markov/weka-tutorial.pdf
http://www.cs.waikato.ac.nz/ml/weka/
http://people.stern.nyu.edu/mk3539/dm/Readings/weka_tut.pdf
http://www2.cmp.uea.ac.uk/~wjw/dmsCourse/talks/WekaTutorial.pdf

Increasing Heap Memory in WEKA (for Windows)


If you're getting the error about "heap" memory, here's how you can give Weka more:
1) Find the directory where Weka is installed. This probably is:
My Computer -> Local Disk (C:) -> Program Files -> Weka-3-6
or maybe:
My Computer -> Local Disk (C:) -> Program Files (x86) -> Weka-3-6
[If that doesn't work, go to "Start->Search" and search for the file RunWeka.ini -- it'll tell you
where the file is "In Folder"]
2) Open the RunWeka.ini file in that folder (it is the file of type Configuration settings)
3) In this file you will see the line:
maxheap=128m [or perhaps some other number]
[This means that you are allocating 128 Mbytes of main memory to Java for the Weka
process. This might not be enough for large data mining tasks with sophisticated (or
poorly written) programs.]
You can change this to some other value. Usually a power of 2 is chosen. Try 512m or 1024m
(this will give you 1 gb of memory).
[To see how much total memory your system has, go to My Computer, and look for "View
system information" or "system properties" or something like that (it depends on the
setup of Windows). In General, under Computer, it should say how much RAM you have.]
4) Save the edited RunWeka.ini. If you cannot save the file, make sure you have run Wordpad
or Word as an administrator in Windows 7 or Windows Vista.

5) Another trouble shooting tip is as follows: What you need to do is right click on the file when
you are viewing it in the Weka-3-6 folder, go to Properties > Security, and it will list a bunch of
groups, including System, Administrators, and Users. The problem is that the Users account
does not initially have permission of modifying this file, so select Users, go to Edit beneath that,
and select Users again and click "Full Control". Apply this modification, and it should work.
6) Restart Weka.
If you're wondering what "heap memory" is:
http://en.wikipedia.org/wiki/Dynamic_memory_allocation
If the above didnt work and you feel desperate, try the following:
1) If you haven't already installed jdk on your pc, download it and install it from here:
https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/
-/USD/ViewProductDetail-Start?ProductRef=jdk-6u24-oth-JPR@CDS-CDS_Developer
2) Open a terminal (in windows command window -> start -> search -> cmd) and go to the jdk
directory (by using the "cd" command) you have just installed.
3) Do:
jar -xvf "weka directory/weka.jar"
4) When the execution is done, write:
java -Xmx1024m -cp "weka directory/weka.jar" weka.gui.GUIChooser
[Note that the number 1024 indicated the number of MB that weka will use.]
You will follow these steps only the first time. Every other time, you will just need to go to
the same directory as here, and run the java command. (java -Xmx1024m -cp weka.jar
weka.gui.GUIChooser).

Increasing Heap Memory in WEKA (for Macs):


You can run weka on mac in the following way:
1) First you will have to un-jar the weka.jar file which you can find in the weka directory. (i.e., jar
-xvf weka.jar)
2) Open a terminal, go to your weka dir (e.g.: cd/Applications/weka-3-6-6/ ) and run the
following:
java -Xmx1024m -cp weka.jar weka.gui.GUIChooser

This will run weka with 1G memory. Change the number if you think you will need less.
3) You can also right click on the weka-3-6-6.app icon and select Show Package Contents.
Open Contents/Info.plist to update the defaults that Weka.app launches with. Modify the line:
<string>-Xmx256M</string>

Attribute names are not unique:


On some versions of WEKA, attributes have to have unique names. In the past some students
documents (emails) also have the name "class", just as their target variables. A way to get
around is to assign some other name, e.g., @class@ to the target variable (in the arff file).
For HW4, if you encounter this problem, you can revise the arff file. In step 2 when you
are using StringToWordVector, if your weka version allows, you need to set "first " to
attributeIndices. (If your weka does not have the parameter attributeIndices, please ignore it).
Just please make sure that @class@ is your target variable.
You can also manually edit the attribute name. Some more references are here, and you can
google for the problem as well:
https://list.scms.waikato.ac.nz/mailman/htdig/wekalist/2010-August/022963.html

Cut and Paste in WEKA


We see the drawback of a system built to run on any platform (via Java). We get lots of little
quirks when new platforms are introduced (we've had lots with Windows 7).
If right-click copy/paste, and Edit option, don't work and control-C / control-V as well, then you
may have to skip the cut-paste shortcut and type the delimiters in.

Das könnte Ihnen auch gefallen