Permalink
Browse files

Deleted old project layout

  • Loading branch information...
1 parent c258bf8 commit b2c9e4134e92452e0dc8ed19066b525905ce97a0 @fbrubacher committed Jul 3, 2012
Showing with 114 additions and 414 deletions.
  1. +0 −36 storm-learning/pom.xml
  2. +0 −13 storm-learning/src/main/java/org/twitter/storm_learning/App.java
  3. +0 −5 storm-learning/src/main/java/org/twitter/storm_learning/ClassifierClass.java
  4. +0 −57 storm-learning/src/main/java/org/twitter/storm_learning/KNN.java
  5. +0 −22 storm-learning/src/main/java/org/twitter/storm_learning/Point.java
  6. +0 −38 storm-learning/src/test/java/org/twitter/storm_learning/AppTest.java
  7. +0 −8 storm-learning/storm-learning/.classpath
  8. +0 −23 storm-learning/storm-learning/.project
  9. +0 −4 storm-learning/storm-learning/.settings/org.eclipse.core.resources.prefs
  10. +0 −5 storm-learning/storm-learning/.settings/org.eclipse.jdt.core.prefs
  11. +0 −4 storm-learning/storm-learning/.settings/org.eclipse.m2e.core.prefs
  12. +0 −36 storm-learning/storm-learning/pom.xml
  13. +0 −13 storm-learning/storm-learning/src/main/java/org/twitter/storm_learning/App.java
  14. +0 −5 storm-learning/storm-learning/src/main/java/org/twitter/storm_learning/ClassifierClass.java
  15. +0 −57 storm-learning/storm-learning/src/main/java/org/twitter/storm_learning/KNN.java
  16. +0 −22 storm-learning/storm-learning/src/main/java/org/twitter/storm_learning/Point.java
  17. +0 −38 storm-learning/storm-learning/src/test/java/org/twitter/storm_learning/AppTest.java
  18. BIN storm-learning/storm-learning/target/test-classes/org/twitter/storm_learning/AppTest.class
  19. +113 −27 storm-ml/src/jvm/storm/ml/Main.java
  20. +1 −1 storm-ml/src/jvm/storm/ml/PerceptronTopologyBuilder.java
View
@@ -1,36 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.twitter</groupId>
- <artifactId>storm-learning</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <name>storm-learning</name>
- <url>http://maven.apache.org</url>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.mahout</groupId>
- <artifactId>mahout-math</artifactId>
- <version>0.6</version>
- </dependency>
- <dependency>
- <groupId>org.functionaljava</groupId>
- <artifactId>functionaljava</artifactId>
- <version>3.1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
@@ -1,13 +0,0 @@
-package org.twitter.storm_learning;
-
-/**
- * Hello world!
- *
- */
-public class App
-{
- public static void main( String[] args )
- {
- System.out.println( "Hello World!" );
- }
-}
@@ -1,5 +0,0 @@
-package org.twitter.storm_learning;
-
-public class ClassifierClass {
-
-}
@@ -1,57 +0,0 @@
-package org.twitter.storm_learning;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.lang.Math;
-import static fj.data.List.list;
-
-import org.apache.mahout.math.DenseMatrix;
-import org.apache.mahout.math.Matrix;
-import org.apache.mahout.math.MatrixSlice;
-import org.apache.mahout.math.Vector;
-
-import fj.F;
-import fj.data.List;
-import fj.data.Array;
-import static fj.function.Doubles.add;
-
-
-public class KNN {
-
- private DenseMatrix trainingData;
-
- public KNN (DenseMatrix data) {
- this.trainingData = data;
- }
-
- public List<Point> matrixToArray(DenseMatrix matrix){
- Iterator<MatrixSlice> trainingIterator = matrix.iterator();
- while(trainingIterator.hasNext())
- {
- //trainingData2 = trainingIterator.next().vector();
- }
- //TODO fix mocked out for the time being
- return list(new Point(), new Point());
- }
-
- public List<Double> eucludianDistance(Integer nbrNeighbors, final Point myPoint){
- List<Point> a = matrixToArray(trainingData);
- return a.map(new F<Point, Double>(){
- // get euclidian distance
- @Override
- public Double f(Point neighbor) {
- return java.lang.Math.sqrt(java.lang.Math.pow(neighbor.getX() - myPoint.getX(), 2.0)
- + java.lang.Math.pow(neighbor.getY() - myPoint.getY(),2.0));
- }
- }).take(nbrNeighbors);
-
-
- }
-
- public Double executeLabeling(Integer nbrNeighbors, Point point) {
- List<Double> distances = eucludianDistance(nbrNeighbors, point);
- final Double sumDistance = distances.foldLeft(add,0.0);
- return sumDistance/(Double)sumDistance;
- }
-
-}
@@ -1,22 +0,0 @@
-package org.twitter.storm_learning;
-
-public class Point {
-
- private double x;
- private double y;
-
- public double getX() {
- return x;
- }
- public void setX(double x) {
- this.x = x;
- }
- public double getY() {
- return y;
- }
- public void setY(double y) {
- this.y = y;
- }
-
-
-}
@@ -1,38 +0,0 @@
-package org.twitter.storm_learning;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Unit test for simple App.
- */
-public class AppTest
- extends TestCase
-{
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public AppTest( String testName )
- {
- super( testName );
- }
-
- /**
- * @return the suite of tests being tested
- */
- public static Test suite()
- {
- return new TestSuite( AppTest.class );
- }
-
- /**
- * Rigourous Test :-)
- */
- public void testApp()
- {
- assertTrue( true );
- }
-}
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>storm-learning</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
@@ -1,4 +0,0 @@
-eclipse.preferences.version=1
-encoding//src/main/java=UTF-8
-encoding//src/test/java=UTF-8
-encoding/<project>=UTF-8
@@ -1,5 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.source=1.5
@@ -1,4 +0,0 @@
-activeProfiles=
-eclipse.preferences.version=1
-resolveWorkspaceProjects=true
-version=1
@@ -1,36 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.twitter</groupId>
- <artifactId>storm-learning</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <name>storm-learning</name>
- <url>http://maven.apache.org</url>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.mahout</groupId>
- <artifactId>mahout-math</artifactId>
- <version>0.6</version>
- </dependency>
- <dependency>
- <groupId>org.functionaljava</groupId>
- <artifactId>functionaljava</artifactId>
- <version>3.1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
@@ -1,13 +0,0 @@
-package org.twitter.storm_learning;
-
-/**
- * Hello world!
- *
- */
-public class App
-{
- public static void main( String[] args )
- {
- System.out.println( "Hello World!" );
- }
-}
@@ -1,5 +0,0 @@
-package org.twitter.storm_learning;
-
-public class ClassifierClass {
-
-}
@@ -1,57 +0,0 @@
-package org.twitter.storm_learning;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.lang.Math;
-import static fj.data.List.list;
-
-import org.apache.mahout.math.DenseMatrix;
-import org.apache.mahout.math.Matrix;
-import org.apache.mahout.math.MatrixSlice;
-import org.apache.mahout.math.Vector;
-
-import fj.F;
-import fj.data.List;
-import fj.data.Array;
-import static fj.function.Doubles.add;
-
-
-public class KNN {
-
- private DenseMatrix trainingData;
-
- public KNN (DenseMatrix data) {
- this.trainingData = data;
- }
-
- public List<Point> matrixToArray(DenseMatrix matrix){
- Iterator<MatrixSlice> trainingIterator = matrix.iterator();
- while(trainingIterator.hasNext())
- {
- //trainingData2 = trainingIterator.next().vector();
- }
- //TODO fix mocked out for the time being
- return list(new Point(), new Point());
- }
-
- public List<Double> eucludianDistance(Integer nbrNeighbors, final Point myPoint){
- List<Point> a = matrixToArray(trainingData);
- return a.map(new F<Point, Double>(){
- // get euclidian distance
- @Override
- public Double f(Point neighbor) {
- return java.lang.Math.sqrt(java.lang.Math.pow(neighbor.getX() - myPoint.getX(), 2.0)
- + java.lang.Math.pow(neighbor.getY() - myPoint.getY(),2.0));
- }
- }).take(nbrNeighbors);
-
-
- }
-
- public Double executeLabeling(Integer nbrNeighbors, Point point) {
- List<Double> distances = eucludianDistance(nbrNeighbors, point);
- final Double sumDistance = distances.foldLeft(add,0.0);
- return sumDistance/(Double)sumDistance;
- }
-
-}
@@ -1,22 +0,0 @@
-package org.twitter.storm_learning;
-
-public class Point {
-
- private double x;
- private double y;
-
- public double getX() {
- return x;
- }
- public void setX(double x) {
- this.x = x;
- }
- public double getY() {
- return y;
- }
- public void setY(double y) {
- this.y = y;
- }
-
-
-}
Oops, something went wrong.

0 comments on commit b2c9e41

Please sign in to comment.