Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install milk

How to install milk

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install milk
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.4.3
0.5.3Never BuiltWhy not?
0.4.3 Available View build log
0.4.2 Available View build log
0.4.1 Available View build log
0.4.0 Available View build log
0.3.10 Available View build log
0.3.9 Available View build log
0.3.8 Available View build log
0.3.7 Failed View build log
0.3.6 Failed View build log
0.3.5 Failed View build log
0.3.4 Failed View build log
0.3.3 Available View build log
0.3.2 Failed View build log
0.3.1 Available View build log
0.3 Available View build log
0.2.1 Failed View build log
0.2 Failed View build log
Windows (64-bit)
0.4.2
0.5.3Never BuiltWhy not?
0.4.2 Available View build log
0.4.1 Available View build log
0.4.0 Available View build log
0.3.10 Failed View build log
0.3.9 Available View build log
0.3.8 Available View build log
0.3.7 Failed View build log
0.3.6 Failed View build log
0.3.5 Failed View build log
0.3.4 Failed View build log
0.3.3 Available View build log
0.3.2 Failed View build log
0.3.1 Available View build log
0.3 Available View build log
0.2.1 Failed View build log
0.2 Failed View build log
Mac OS X (10.5+)
0.4.3
0.5.3Never BuiltWhy not?
0.4.3 Available View build log
0.4.2 Available View build log
0.4.1 Available View build log
0.4.0 Available View build log
0.3.10 Available View build log
0.3.9 Available View build log
0.3.8 Available View build log
0.3.7 Available View build log
0.3.6 Available View build log
0.3.5 Available View build log
0.3.4 Available View build log
0.3.3 Available View build log
0.3.2 Failed View build log
0.3.1 Available View build log
0.3 Available View build log
0.2.1 Available View build log
0.2 Available View build log
Linux (32-bit)
0.4.3
0.5.3Never BuiltWhy not?
0.5 Failed View build log
0.4.3 Available View build log
0.4.2 Available View build log
0.4.1 Available View build log
0.4.0 Available View build log
0.3.10 Available View build log
0.3.9 Available View build log
0.3.8 Available View build log
0.3.7 Available View build log
0.3.6 Available View build log
0.3.5 Available View build log
0.3.4 Available View build log
0.3.3 Available View build log
0.3.2 Failed View build log
0.3.1 Available View build log
0.3 Available View build log
0.2.1 Available View build log
0.2 Available View build log
Linux (64-bit)
0.4.3
0.5.3 Failed View build log
0.5 Failed View build log
0.4.3 Available View build log
0.4.2 Available View build log
0.4.1 Available View build log
0.4.0 Available View build log
0.3.10 Available View build log
0.3.9 Available View build log
0.3.8 Available View build log
0.3.7 Available View build log
0.3.6 Available View build log
0.3.5 Available View build log
0.3.4 Available View build log
0.3.3 Available View build log
0.3.2 Failed View build log
0.3.1 Available View build log
0.3 Available View build log
0.2.1 Available View build log
0.2 Available View build log
 
License
MIT
Depended by
Lastest release
version 0.5.3 on Jan 9th, 2014

Machine Learning in Python

Milk is a machine learning toolkit in Python.

Its focus is on supervised classification with several classifiers available: SVMs (based on libsvm), k-NN, random forests, decision trees. It also performs feature selection. These classifiers can be combined in many ways to form different classification systems.

For unsupervised learning, milk supports k-means clustering and affinity propagation.

Milk is flexible about its inputs. It optimised for numpy arrays, but can often handle anything (for example, for SVMs, you can use any dataype and any kernel and it does the right thing).

There is a strong emphasis on speed and low memory usage. Therefore, most of the performance sensitive code is in C++. This is behind Python-based interfaces for convenience.

To learn more, check the docs at http://packages.python.org/milk/ or the code demos included with the source at milk/demos/.

Examples

Here is how to test how well you can classify some features,labels data, measured by cross-validation:

import numpy as np
import milk
features = np.random.rand(100,10) # 2d array of features: 100 examples of 10 features each
labels = np.zeros(100)
features[50:] += .5
labels[50:] = 1
confusion_matrix, names = milk.nfoldcrossvalidation(features, labels)
print 'Accuracy:', confusion_matrix.trace()/float(confusion_matrix.sum())

If want to use a classifier, you instanciate a learner object and call its train() method:

import numpy as np
import milk
features = np.random.rand(100,10)
labels = np.zeros(100)
features[50:] += .5
labels[50:] = 1
learner = milk.defaultclassifier()
model = learner.train(features, labels)

# Now you can use the model on new examples:
example = np.random.rand(10)
print model.apply(example)
example2 = np.random.rand(10)
example2 += .5
print model.apply(example2)

There are several classification methods in the package, but they all use the same interface: train() returns a model object, which has an apply() method to execute on new instances.

Details

License: MIT

Author: Luis Pedro Coelho (with code from LibSVM and scikits.learn)

API Documentation: http://packages.python.org/milk/

Mailing List: http://groups.google.com/group/milk-users

Features

  • SVMs. Using the libsvm solver with a pythonesque wrapper around it.
  • LASSO
  • K-means using as little memory as possible. It can cluster millions of instances efficiently.
  • Random forests
  • Self organising maps
  • Stepwise Discriminant Analysis for feature selection.
  • Non-negative matrix factorisation
  • Affinity propagation

Recent History

The ChangeLog file contains a more complete history.

New in 0.5.3 (19 Jun 2013)

System Message: WARNING/2 (<string>, line 97)

Title underline too short.

New in 0.5.3 (19 Jun 2013)
~~~~~~~~~~~~~~~~~~~~~~~~~
  • Fix MDS for non-array inputs
  • Fix MDS bug
  • Add return_* arguments to kmeans
  • Extend zscore() to work on non-ndarrays
  • Add frac_precluster_learner
  • Work with older C++ compilers
New in 0.5.2 (7 Mar 2013)
  • Fix distribution of Eigen with source
New in 0.5.1 (11 Jan 2013)
  • Add subspace projection kNN
  • Export pdist in milk namespace
  • Add Eigen to source distribution
  • Add measures.curves.roc
  • Add mds_dists function
  • Add verbose argument to milk.tests.run
New in 0.5 (05 Nov 2012)
  • Add coordinate-descent based LASSO
  • Add unsupervised.center function
  • Make zscore work with NaNs (by ignoring them)
  • Propagate apply_many calls through transformers
  • Much faster SVM classification with means a much faster defaultlearner() [measured 2.5x speedup on yeast dataset!]

For older versions, see ChangeLog file

Subscribe to package updates

Last updated Jan 9th, 2014

Download Stats

Last month:22

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.