karuiwu / reparse

1 stars 0 forks source link

Check out the Mega-M classifier #2

Closed junekihong closed 11 years ago

junekihong commented 11 years ago

Download its source. Take a look at how it works.

jeisner commented 11 years ago

You could also check out other classifiers -- SVMLight is the standard package for SVM classifiers, and Vowpal Wabbit has very fast implementations of all kinds of classifiers.

However, MegaM is a reasonable starting point, and it's kind of nice that it gives you a probabilistic classifier so you know not only that the classifier said "YES" but also how sure it was.

jeisner commented 11 years ago

http://www.umiacs.umd.edu/~hal/megam/index.html

karuiwu commented 11 years ago

First steps to compiling MegaM for Mac: http://blog.vene.ro/2012/06/08/compiling-megam-on-macos-x/ ~~Even so, some of the header files are outdated (such as changing "alloc.h" to , and currently "bigarray.h" to ?). Writing this as a note just in case we need to recompile MegaM.~~

Necessary to compile new binary for OS X. Comment is complete.

  1. In "fastdot_c.c", change the headers from:
#include <stddef.h>
#include <stdarg.h>
#include <string.h>
#include "alloc.h"
#include "bigarray.h"
#include "custom.h"
#include "fail.h"
#include "intext.h"
#include "memory.h"
#include "mlvalues.h"
#include "math.h"

... to:

#include <stddef.h>
#include <stdarg.h>
#include <string.h>
#include <caml/alloc.h>
#include <caml/bigarray.h>
#include <caml/custom.h>
#include <caml/fail.h>
#include <caml/intext.h>
#include <caml/memory.h>
#include <caml/mlvalues.h>
#include "math.h"
  1. Type make to create "megam" and make opt to create "megam.opt"
  2. Download training data "small2"
  3. Use: ./megam.opt multiclass small2 > weights