Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1,320 changes: 1,320 additions & 0 deletions .metadata/.log

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package org.sanket.codingGym.DataMining.utilities;

import java.util.List;

import internal.tools.machine.learning.DatasetProtoOuterClass;
import internal.tools.machine.learning.DatasetProtoOuterClass.DatasetProto;
import internal.tools.machine.learning.DatasetProtoOuterClass.DatasetProto.Pair;
import internal.tools.machine.learning.DatasetProtoOuterClass.DatasetProto.Sample;
import net.sf.javaml.core.Dataset;
import net.sf.javaml.core.DefaultDataset;
import net.sf.javaml.core.DenseInstance;
import net.sf.javaml.core.Instance;
import net.sf.javaml.tools.InstanceTools;

public class DatasetToProtoConverter {

public static Dataset fromProtoToDataset(DatasetProto proto){
Dataset data = new DefaultDataset();

List<Sample> samples = proto.getSamplesList();
for(Sample s: samples){
List<Pair> dataPoints = s.getInputVectorList();
double[] vals = new double[dataPoints.size()];
for(int j=0; j < dataPoints.size(); j++){
vals[j] = dataPoints.get(j).getValue();
}
Instance i = new DenseInstance(vals);
i.setClassValue(s.getClassId());
data.add(i);
}

return data;
}

public static DatasetProto fromDatasetToProto(Dataset data){
DatasetProto.Builder builder = DatasetProto.newBuilder();
for(int i = 0; i < data.size(); i++){
Instance instance = data.get(i);
for(int j = 0; j < instance.entrySet().size(); j++ ){
SampleBuilder sampleBuilder = DatasetProto.Sample.newBuilder();
builder.setSamples(i, s);

}
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package org.sanket.codingGym.DataMining.utilities;

import java.util.List;

import internal.tools.machine.learning.DatasetProtoOuterClass;
import internal.tools.machine.learning.DatasetProtoOuterClass.DatasetProto;
import internal.tools.machine.learning.DatasetProtoOuterClass.DatasetProto.Pair;
import internal.tools.machine.learning.DatasetProtoOuterClass.DatasetProto.Sample;
import internal.tools.machine.learning.DatasetProtoOuterClass.DatasetProto.Sample.Builder;
import net.sf.javaml.core.Dataset;
import net.sf.javaml.core.DefaultDataset;
import net.sf.javaml.core.DenseInstance;
import net.sf.javaml.core.Instance;
import net.sf.javaml.tools.InstanceTools;

public class DatasetToProtoConverter {

public static Dataset fromProtoToDataset(DatasetProto proto){
Dataset data = new DefaultDataset();

List<Sample> samples = proto.getSamplesList();
for(Sample s: samples){
List<Pair> dataPoints = s.getInputVectorList();
double[] vals = new double[dataPoints.size()];
for(int j=0; j < dataPoints.size(); j++){
vals[j] = dataPoints.get(j).getValue();
}
Instance i = new DenseInstance(vals);
i.setClassValue(s.getClassId());
data.add(i);
}

return data;
}

public static DatasetProto fromDatasetToProto(Dataset data){
DatasetProto.Builder builder = DatasetProto.newBuilder();
for(int i = 0; i < data.size(); i++){
Instance instance = data.get(i);
Builder sampleBuilder = DatasetProto.Sample.newBuilder();
for(Integer j : instance.keySet()){
Pair.Builder pairBuilder = Pair.newBuilder();
pairBuilder.setKey(j);
pairBuilder.setValue(instance.get(j));
sampleBuilder.addInputVector(pairBuilder.build());
}
builder.addSamples(sampleBuilder.build());
}
builder.build();
}

}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<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.sanket.codingGym</groupId>
<artifactId>DataMining</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>DataMining</name>
<url>http://maven.apache.org</url>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.0</version>
<configuration>
<protocExecutable>/usr/local/bin/protoc</protocExecutable>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sf</groupId>
<artifactId>javaml</artifactId>
<version>0.1.7</version>
<scope>system</scope>
<systemPath>/home/sanket/Documents/Code/MyProjects/Java/MavenProjects/codingGym/DataMining/src/main/resources/javaml/javaml-0.1.7.jar</systemPath>
</dependency>
<dependency>
<groupId>net.sf</groupId>
<artifactId>ajt</artifactId>
<version>2.9</version>
<scope>system</scope>
<systemPath>/home/sanket/Documents/Code/MyProjects/Java/MavenProjects/codingGym/DataMining/src/main/resources/javaml/ajt-2.9.jar</systemPath>
</dependency>
<dependency>
<groupId>net.sf</groupId>
<artifactId>commons-math</artifactId>
<version>1.2</version>
<scope>system</scope>
<systemPath>/home/sanket/Documents/Code/MyProjects/Java/MavenProjects/codingGym/DataMining/src/main/resources/javaml/commons-math-1.2.jar</systemPath>
</dependency>
<dependency>
<groupId>net.sf</groupId>
<artifactId>Jama</artifactId>
<version>1.0.2</version>
<scope>system</scope>
<systemPath>/home/sanket/Documents/Code/MyProjects/Java/MavenProjects/codingGym/DataMining/src/main/resources/javaml/Jama-1.0.2.jar</systemPath>
</dependency>
<dependency>
<groupId>net.sf</groupId>
<artifactId>libsvm</artifactId>
<version>0.1.7</version>
<scope>system</scope>
<systemPath>/home/sanket/Documents/Code/MyProjects/Java/MavenProjects/codingGym/DataMining/src/main/resources/javaml/libsvm.jar</systemPath>
</dependency>
<dependency>
<groupId>net.sf</groupId>
<artifactId>weka</artifactId>
<version>0.1.7</version>
<scope>system</scope>
<systemPath>/home/sanket/Documents/Code/MyProjects/Java/MavenProjects/codingGym/DataMining/src/main/resources/javaml/weka.jar</systemPath>
</dependency>
</dependencies>
</project>

This file was deleted.

Loading