Giter VIP home page Giter VIP logo

storm-pattern's Introduction

#Storm.pattern

This project is based on the cascading.pattern project. The pattern sub-project for http://Cascading.org/ which uses flows as containers for machine learning models, importing PMML model descriptions from R, SAS, Weka, RapidMiner, KNIME, SQL Server, etc.

All Credit to Chris and Paco for the excellent work!

Current support for PMML includes:

Use in Storm Topology

First include the clojars repo in your POM (or project.clj or sbt or wherever):

<repositories>
	<repository>
		<id>clojars.org</id>
		<url>http://clojars.org/repo</url>
	</repository>
</repositories>

And then add the dependency:

<dependency>
	<groupId>com.github.quintona</groupId>
	<artifactId>storm-pattern</artifactId>
	<version>0.0.2-SNAPSHOT</version>
</dependency>

I have created a very simple trident topology to illustrate the usage, it is available from here.. At a high level, this is all that is required:

topology.newStream("valueStream", spout)
			.each(new Fields(fields), new ClassifierFunction(pmml_file),
					new Fields("prediction"))
			.each(new Fields("prediction"), new PrintlnFunction(),
					new Fields());

You simply need to create the Classifier function and pass in the model.

Build Instructions (if you are extending storm-pattern)


To build and then run its unit tests:

mvn clean install

The following scripts generate a baseline (model+data) for the Random Forest algorithm. This baseline includes a reference data set -- 1000 independent variables, 500 rows of simulated ecommerce orders -- plus a predictive model in PMML:

./src/py/gen_orders.py 500 1000 > orders.tsv
R --vanilla < ./src/r/rf_pmml.R > model.log

This will generate huge.rf.xml as the PMML export for a Random Forest classifier plus huge.tsv as a baseline data set for regression testing.

Example Models

Check the src/r/rattle_pmml.R script for examples of predictive models which are created in R, then exported using Rattle. These examples use the popular Iris data set.

  • random forest (rf)
  • linear regression (lm)
  • hierarchical clustering (hclust)
  • k-means clustering (kmeans)
  • logistic regression (glm)
  • multinomial model (multinom)
  • single hidden-layer neural network (nnet)
  • support vector machine (ksvm)
  • recursive partition classification tree (rpart)
  • association rules

To execute the R script:

R --vanilla < src/r/rattle_pmml.R

It is possible to extend PMML support for other kinds of modeling in R and other analytics platforms. Contact the developers to discuss on the cascading-user email forum.

PMML Resources

storm-pattern's People

Contributors

ceteri avatar quintona avatar cwensel avatar girish-a1 avatar

Watchers

Sergey Yaroslavtsev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.