Swimming upstream on the technology tide, one technology at a time. A collection of articles, tips, and random musings on application development and system design. Thursday, April 12, Image Classification Photo or Drawing using Weka Some time back, I was asked if there was a simple way to automatically classify images as either photographs or drawings.
If you want to be able to change the source code for the algorithms, WEKA is a good tool to use. It also reimplements many classic data mining algorithms, including C4. For more information, check out the WEKA web page. Once it is downloaded, you just double click on the program to launch it if it does not create an icon automatically, go to "programs" and run it that way.
You should download the latest stable version of WEKA. For my Spring data mining course you should use version 3.
In this case, it is invoked differently. First, you will need an account login, password for the erdos machine. You can invoke weka in one of two ways.
The first is to issue the commands: If you click on "documentation" you will find many useful resources, including a WEKA manual. If you scroll down, you will find direct links to the latest WEKA manual. As of that is version 3.
The tutorial that I will use in class is avialable below we will only cover the Explorer mode: The tutorial is now slightly out of synch with the version of Weka. Also, the results in the tutorial for J48 on the iris data is without the discretization step so if you follow the tutorial and discretize the variables, undo it before going on.
Also, the results are with the "binary-split" flag set to true even though this apparently is not set in the tutorial. We will not be going over the "User Classifier", so when you get to it you can skip to the Clustering section of the tutorial.
WEKA ideally would like an. The format of the. There are some sample data sets that come with WEKA that you can access and play with. Thus, when you install them to your PC, you might find them under C: But just in case you cannot find them, I have a local copy of the sample Weka databases.
If you want to enter the url using the "Open URL" optionit is: Then simply add the filename at the end of this string e. Very often you will want to use a dataset that does not have an. I think the best method may just be to manually create the arff file although you can try to inmport a csv file.
The format is fairly simple. You start with relation, then have a bunch of attribute statements, and then have a data command, followed by the data, one record per line.
Very often you will have a file with the data only. This could be a regular. Some things to watch out for.
As I found out, the. A blank line after the relation command before the attribute commands causes an error! This may not be apparent from the documentation on the. I suggest that beyond just looking at the. You will need to edit the file with some type of text editor.Super easy way - upload your CSV file on this website and it does it for you - Convert CSV to ARFF online Nerdy way - Write the code to convert CSV to ARFF.
ARFF files from Text Collections Now here the input file must be CSV. Apr 10, · For testing, I once again manually annotated another set of images, embedded the Weka NaiveBayes classifier inside my Java code (shown below), trained it with the ARFF file for the training data, then passed each of the manually annotated images through the classifier.
Jan 06, · The WEKA tool uses input and output files iridis-photo-restoration.com (Attribute Relation File Format). Before you can apply any algorithm to your data, it must be converted to ARFF form.
We know that the bulk of an ARFF file consists of a list of all the instances, with the attribute values for each instance being separated by iridis-photo-restoration.com: Gokarna Sharma.
file => weka will output the source type. 4) Run your feature extractor for the language given this source type and the story A, it should build your new feature vector for story A. write it in your arff file. A comment in the ARFF format is started with the percent character % and continues until the end of the line.
6. Load your ARFF file into Weka and repeat the steps you performed on the first data set. Record your results and observations. You may run into errors as you load your ARFF file. If you do, try running the command (on one line). I created a ARFF file but when I try to upload it into WEKA I get the following message: iridis-photo-restoration.comption: end of line expected, read Token(Inequality), line 3).
I searched online but I cannot manage to find any solutions for my problem. Below is part of my ARFF file.
ARFF file for GII index [email protected] Gender Inequality.