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 ramp

How to install ramp

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install ramp
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
Linux (64-bit)
0.1.4 Available View build log
 
Author
License
BSD
Lastest release
version 0.1.4 on Jan 9th, 2014

Ramp is a python module for rapid prototyping of machine learning solutions. It is essentially a [pandas](http://pandas.pydata.org) wrapper around various python machine learning and statistics libraries ([scikit-learn](http://scikit-learn.org), [rpy2](http://rpy.sourceforge.net/rpy2.html), etc.), providing a simple, declarative syntax for exploring features, algorithms and transformations quickly and efficiently.

Documentation: http://ramp.readthedocs.org

Why Ramp?

  • Clean, declarative syntax

    No more hackish one-off spaghetti scripts!

  • Complex feature transformations

    Chain and combine features:

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

Block quote ends without a blank line; unexpected unindent.

`python Normalize(Log('x')) Interactions([Log('x1'), (F('x2') + F('x3')) / 2]) `

System Message: ERROR/3 (<string>, line 27)

Unexpected indentation.
Reduce feature dimension:

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

Block quote ends without a blank line; unexpected unindent.

`python DimensionReduction([F('x%d'%i) for i in range(100)], decomposer=PCA(n_components=3)) `

System Message: ERROR/3 (<string>, line 31)

Unexpected indentation.
Incorporate residuals or predictions to blend with other models:

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

Block quote ends without a blank line; unexpected unindent.

`python Residuals(config_model1) + Predictions(config_model2) `

System Message: ERROR/3 (<string>, line 35)

Unexpected indentation.
Any feature that uses the target ("y") variable will automatically respect the current training and test sets.
  • Caching

    Ramp caches and stores on disk in fast HDF5 format (or elsewhere if you want) all features and models it computes, so nothing is recomputed unnecessarily. Results are stored and can be retrieved, compared, blended, and reused between runs.

  • Easy extensibility

    Ramp has a simple API, allowing you to plug in estimators from scikit-learn, rpy2 and elsewhere, or easily build your own feature transformations, metrics, feature selectors, reporters, or estimators.

## Quick start [Getting started with Ramp: Classifying insults](http://www.kenvanharen.com/2012/11/getting-started-with-ramp-detecting.html)

Or, the quintessential Iris example:

```python

System Message: WARNING/2 (<string>, line 122); backlink

Inline literal start-string without end-string.

System Message: WARNING/2 (<string>, line 122); backlink

Inline interpreted text or phrase reference start-string without end-string.

import pandas from ramp import * import urllib2 import sklearn from sklearn import decomposition

# fetch and clean iris data from UCI data = pandas.read_csv(urllib2.urlopen(

System Message: ERROR/3 (<string>, line 67)

Unexpected indentation.
"http://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data"))

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

Block quote ends without a blank line; unexpected unindent.

data = data.drop([149]) # bad line columns = ['sepal_length', 'sepal_width', 'petal_length', 'petal_width', 'class'] data.columns = columns

# all features features = [FillMissing(f, 0) for f in columns[:-1]]

# features, log transformed features, and interaction terms expanded_features = (

System Message: ERROR/3 (<string>, line 78)

Unexpected indentation.

features + [Log(F(f) + 1) for f in features] + [

System Message: ERROR/3 (<string>, line 81)

Unexpected indentation.
F('sepal_width') ** 2, combo.Interactions(features),

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

Block quote ends without a blank line; unexpected unindent.

]

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

Block quote ends without a blank line; unexpected unindent.

)

# Define several models and feature sets to explore, # run 5 fold cross-validation on each and print the results. # We define 2 models and 4 feature sets, so this will be # 4 * 2 = 8 models tested. shortcuts.cv_factory(

System Message: ERROR/3 (<string>, line 92)

Unexpected indentation.

data=data,

target=[AsFactor('class')], metrics=[[metrics.GeneralizedMCC()]],

# Try out two algorithms model=[

System Message: ERROR/3 (<string>, line 99)

Unexpected indentation.
sklearn.ensemble.RandomForestClassifier(n_estimators=20), sklearn.linear_model.LogisticRegression(), ],

# and 4 feature sets features=[

System Message: ERROR/3 (<string>, line 105)

Unexpected indentation.

expanded_features,

# Feature selection [trained.FeatureSelector(

System Message: ERROR/3 (<string>, line 109)

Unexpected indentation.
expanded_features, # use random forest's importance to trim selectors.RandomForestSelector(classifier=True), target=AsFactor('class'), # target to use n_keep=5, # keep top 5 features )],

# Reduce feature dimension (pointless on this dataset) [combo.DimensionReduction(expanded_features,

System Message: ERROR/3 (<string>, line 118)

Unexpected indentation.
decomposer=decomposition.PCA(n_components=4))],

# Normalized features [Normalize(f) for f in expanded_features],

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

Block quote ends without a blank line; unexpected unindent.

]

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

Block quote ends without a blank line; unexpected unindent.

)

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

Definition list ends without a blank line; unexpected unindent.

```

System Message: WARNING/2 (<string>, line 124); backlink

Inline literal start-string without end-string.

System Message: WARNING/2 (<string>, line 124); backlink

Inline interpreted text or phrase reference start-string without end-string.

## Status Ramp is very alpha currently, so expect bugs, bug fixes and API changes.

## Requirements
  • Numpy
  • Scipy
  • Pandas
  • PyTables
  • Sci-kit Learn

## Author Ken Van Haren. Email with feedback/questions: kvh@science.io

Subscribe to package updates

Last updated Jan 9th, 2014

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.