Skip to main content.
October 25th, 2006

How to ACTUALLY USE a saved model in Weka!

This was a frusterating 30 minutes of searching to find out how to get Weka to do something that really should have been obvious.

In this data mining competition I was trying out, they give you a final test set without the actual answers and your job is to predict that the actual values are, and well, send them in. I did manage to get it figured out after a lot of searching. So I’m back on my path to winning ;-)

So here’s the easiest way to use a model to simply get its predictions without training it again:

If you right-click on the result list you’ll get a popup
with options including “Load model” which allows you to load
some saved model; and there is another option “Re-evaluate
model on the current test-set”; obviously before you can
do that, you will have to load some test-set: tick “Supplied
test set” and then the “Set” button and select your file …

I found that answer here, and later in the thread they also mention a way to do it with the command line interface (CLI).

If that quoted answer above still isn’t clear, allow me to summarize:

1. You open Weka and get that little window with the four buttons.
2. Click on Explorer.
3. load any old bogus data set you’re not going to need just so it allows you to get to the classifier tab.
4. Then under test options you choose “supplied test set” and point it to the data you want it to make predictions on. (Note: this 5. must have all of the same attributes, in the same order that you trained your model on.).
6. Finally right click in the result list area and select load model.
7. Point it to your saved model.
8. Next right click to model you just loaded and tell it to re-evaluate on current test set.

Here’s what your output might look like:
Weka actually using a model to make predictions without retraining OMG

You know, all frusteration aside, Weka really is an incredibly useful, free program, and perhaps I should be glad the developers are spending time on the machine learning side of development instead of my personal needs…

My search terms (see the frusteration build):

  1. weka run a model on test data
  2. weka use a model
  3. weka + “use a model”
  4. weka + (get OR output) + predictions + without + training
  5. weka + “without training”
  6. weka don’t have actual
  7. weka cli
  8. weka + sucks
  9. “weka sucks”

Here is more information about saving models in Weka.

Tags: , , ,

Posted by Greg Pinero (Primary Searcher) as Machine Learning at 11:43 PM MST

2 Comments »

October 23rd, 2006

Avoid Spelling I.e and E.g Wrong I.e, Here’s How

Well we all know the correct usage of (e.g.) and (i.e.), … right?

Well here it is courtesy of Wikipedia:

Exempli gratia (e.g.) and id est (i.e.) are commonly confused and misused in colloquial English. The former, exempli gratia, means “for example”, and is used before giving examples of something (”I have lots of favorite colors, e.g., blue, green, and hot pink”). The latter, id est, means “that is”, and is used before clarifying the meaning of something, when elaborating, specifying, or explaining rather than when giving examples (”I have lots of favorite colors, i.e., I can’t decide on just one”).

So armed with that knowledge I’d like to start using them in real sentences everywhere e.g., class papers, blog posts, etc. But my frakin Open Office thingy tells me it’s mispelled:
—-
(i.e.) Usage
—-
So I went on a journey to find an answer i.e., a 5 minute internet search.

While I didn’t find anything addressing this topic i.e., I may well be the first! Wikipedia does offer this confusing guideline:

American style guides tend to recommend that “e.g.” and “i.e.” should generally be followed by a comma, just as “for example” and “that is” would be; U.K. style tends to omit the comma. See Dictionary.com and their discussion of commas for more information. Google for “comma after i.e.” for other opinions.

So in conclusion here is your answer to the best of my ability i.e., an educated guess (see disclaimer):

  1. Put a period after each letter since they are abbreviations for latin things.
  2. Capitalize as you would any other word e.g., Upper case at begining of sentence or in titles, and lower case otherwise.
  3. Put a comma after it e.g., “e.g.,” <- Funny! ;-) unless you live in the UK.

Disclaimer: I may be completely wrong on this whole i.e. and e.g. thing. In which case please let me know and I’ll rewrite this.

Posted by Greg Pinero (Primary Searcher) as Other, Idle Curiosities at 11:48 AM MST

Comments Off

October 22nd, 2006

Four Free Neural Network Libraries for Python


Here is an exhaustive list of the 4 free Artificial Neural Network Libraries for use with your Python code. In the coming weeks I’m going to try out a few of them and update this post. I’d love to hear anyone’s experiences with any of these. If you’ve used them please leave us a comment.

Here they are listed in the order of my perception of their overall quality:

1. First we have the Fast Artificial Neural Network Library (FANN). It is written in C but says it has Python bindings. The bindings for Python look hard to set up but on the plus side it looks well maintained and claims to be extremely fast.

2. Next there is the bpnn.py neural network code by Neil Schemenauer. It’s just a lone .py file sitting out in the middle of the internet. What looks good about this is that it’s written in pure Python, and it’s really short. This makes me think it will be easy to understand and verify. It’s also public domain which is nice. I’m also encouraged by the fact that this fancy IBM type article used this module. Perhaps that article will serve as a de facto documentation for the module?

3. The Pyro Python Robotics project seems to have some neural network stuff but on a cursory glance it appears to be more a tutorial than something you can download and use.

4. Finally, NEURObjects is a set of C++ library classes for neural networks development. I only include it here because I always hear that it’s easy to make a Python wrapper for C++ code. Of course I’ve never been able to figure out how myself, but it might work as a last resort. (Python experts, please give us a tutorial on this wrapper stuff!)

I’m surpsised I didn’t find more free Python neural network libraries. If you know of any I’ve left out, please leave a comment. I would especially think that something would have been done with numpy since that would make for a fast running neural network.

And just in case you want to use a neural network but can’t think of a good excuse, here are a couple of good (financial) ideas to get you started.

Tags: , , , , , , , , , , ,

Posted by Greg Pinero (Primary Searcher) as Python, Machine Learning at 9:07 PM MST

11 Comments »

October 20th, 2006

Definitive Syntax for Windows Explorer Search

Ever wondered what the * means in *.txt? Well see below. I finally bothered to look it up so that I could find all *GM*.dll files on my computer and delete them!

Asterisk (*)
Use the asterisk as a substitute for zero or more characters. If you are looking for a file that you know starts with “gloss” but you cannot remember the rest of the file name, type the following:
gloss*
This locates all files of any file type that begin with “gloss” including Glossary.txt, Glossary.doc, and Glossy.doc. To narrow the search to a specific type of file, type:
gloss*.doc
This locates all files that begin with “gloss” but have the file name extension .doc, such as Glossary.doc and Glossy.doc.

Question mark (?)
Use the question mark as a substitute for a single character in a name. For example, if you type gloss?.doc, you will locate the file Glossy.doc or Gloss1.doc but not Glossary.doc.

Courtesy of this MSDN page.

My Search Queries

  1. windows search syntax
  2. windows + “search companion” + syntax
  3. windows explorer search syntax

Posted by Greg Pinero (Primary Searcher) as win32, GoldMine at 3:12 PM MST

Comments Off

October 10th, 2006

How to Make MediaWiki Allow All File Types


Just go into your localSettings.php file and add these lines (or change their values if the variables are already mentioned in this file):

$wgCheckFileExtensions = false;
$wgStrictFileExtensions = false;
$wgVerifyMimeType = false;
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg' );
$wgFileBlacklist = array();
$wgMimeTypeBlacklist= array();

Since my MediaWiki installation is only for my own personal use, I got sick and tired of it telling me I couldn’t upload this and that file. What really took me a while to figure out is that if a file extension is lised in the variable $wgFileBlacklist then it doesn’t matter how you change the other variables, it will be blocked! (at least for version 1.6.8 of MediaWiki.)

My Search Terms:

  1. mediawiki upload formats
  2. “.py” + “is not a recommended image file format”
  3. “.py” is not a recommended image file format.
  4. mediawiki allow all upload files formats
  5. mediawiki allow all uploads
  6. mediawiki settings upload

Posted by Greg Pinero (Primary Searcher) as Uncategorized, Other at 12:21 AM MST

1 Comment »

« Previous Entries