Source

ITE / code / shared / embedded / KDP / INSTALL

Full commit

 "kdpee", k-d partitioning entropy estimator.
 (c) 2008-2009 Dan Stowell and Queen Mary University of London.
 All rights reserved.


INSTALLING FOR MATLAB / OCTAVE
==============================

Run the following from within matlab / octave:

  cd ..../path/to/kdpee/mat_oct
  mexme

The "mexme" script is a very simple M-file that calls "mex" -
look at the source of "mexme" and tweak it if you like.


Basic usage in matlab/octave might look something like this:

  addpath('..../path/to/kdpee/mat_oct');
  a = [1,6; 2,7; 3,8; 4,9; 5,0; 1,6; 2,7; 3,8; 4,9; 5,0];
  kdpee(a)           % (result is 3.0723)



INSTALLING FOR PYTHON (NUMPY)
=============================
Tested on python 2.5 and 2.6, on Mac systems.

REQUIREMENTS: 
You'll need to have python as well as the numpy module installed,
and you'll need a C compiler (e.g. gcc, I used gcc v4.0) too.

To install this module, first edit the file "python/setup.py". Find the 
line which specifies a value for "include_dirs", and edit it to match
the location of numpy/arrayobject.h on your system.

Then run "setup.py" from a command-line as follows:

  cd ..../path/to/kdpee/python
  python setup.py build
  python setup.py install

You might need to be the super-user (e.g. use sudo) for the install step.


Basic usage in python might look something like this:

  from numpy import *
  from kdpee import *
  # entropy of a 2D distribution with 10 data points:
  kdpee(array( [[1,2,3,4,5,1,2,3,4,5], [6,7,8,9,0,6,7,8,9,0]]))
  # (result is 3.072320520444161)