Commit ae69e02e authored by Markus Krug's avatar Markus Krug
Browse files

initial upload

*contains 3 Projects, 2 of those are still empty
parents
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>de.uniwue.ls6.rulelearning</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>
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
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>DataStructure</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.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
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
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
<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>de.uniwue.ls6.rulelearning</groupId>
<artifactId>DataStructure</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>de.uniwue.ls6.rulelearning</groupId>
<relativePath>../</relativePath>
<artifactId>ruleLearningParent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>com.googlecode.matrix-toolkits-java</groupId>
<artifactId>mtj</artifactId>
<version>1.0.2</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package de.uniwue.ls6.datastructure;
public class Instance {
/*
* a datapoint to CLASSIFY
*/
//featureset
private int[][] featureArray;
private int label;
public Instance(int nrRows,int nrCols) {
super();
featureArray = new int[nrRows][nrCols];
}
public Instance(int nrRows,int nrCols,int label) {
super();
featureArray = new int[nrRows][nrCols];
this.label = label;
}
public int getLabel() {
return label;
}
public void setLabel(int label) {
this.label = label;
}
public int[][] getFeatureArray() {
return featureArray;
}
}
package de.uniwue.ls6.datastructure;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class LabelAlphabet {
/*
* maps between String and ints
*/
private static Map<String, Integer> featureToIdMap = new ConcurrentHashMap<String, Integer>();
private static Map<Integer, String> idToFeatureMap = new ConcurrentHashMap<Integer, String>();
private LabelAlphabet() {
}
public static synchronized int getIdToFeature(String feature) {
Integer integer = featureToIdMap.get(feature);
if (integer != null) {
return integer;
} else {
int size = featureToIdMap.size();
addToMaps(feature, size);
return size;
}
// TODO MAX INT OVERFLOW SO BAD!
}
public static String getFeatureToId(int id) {
String feature = idToFeatureMap.get(id);
if (feature != null) {
return feature;
}
return null;
}
private static void addToMaps(String feature, int value) {
featureToIdMap.put(feature, value);
idToFeatureMap.put(value, feature);
}
}
package de.uniwue.ls6.datastructure;
import no.uib.cipr.matrix.sparse.FlexCompColMatrix;
public class MatrixMcMatrixFace {
/*
* contains obviously (as indicated by the name) exactly 2 matrices
*/
private FlexCompColMatrix tpMatrix;
private FlexCompColMatrix fpMatrix;
private int goldLabel;
public MatrixMcMatrixFace(int amountFeatures, int windowSize, int goldLabel) {
tpMatrix = new FlexCompColMatrix(amountFeatures, windowSize);
fpMatrix = new FlexCompColMatrix(amountFeatures, windowSize);
this.goldLabel = goldLabel;
}
public void addInstance(Instance... instances) {
for (Instance i : instances) {
int[][] featureArray = i.getFeatureArray();
// for each column, #columns == windowsize
// l2r t2B
for (int col = 0; col < featureArray[0].length; col++) {
for (int row = 0; row < featureArray.length; row++) {
if(goldLabel==i.getLabel()){
//add to TP matrix
addToMatrix(featureArray[row][col],col,tpMatrix);
}
else{
//add to FP matrix
addToMatrix(featureArray[row][col],col,fpMatrix);
}
}
}
}
}
private void addToMatrix(int feature, int windowcolumn, FlexCompColMatrix matrix) {
matrix.add(feature, windowcolumn, 1);
}
/*
* 1. Differenzmatrix ausrechnen => Best Score ist Max(Matrix)
* 2. Setze Werte auf Sparse wenn Summe von TP un FP <=? MaxScore
* 3. Expansion der Matrix (Gruppierung von n+1 Windowelementen) (ber alle Instanzen gehen)
*/
}
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Evaluation</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.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
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
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
<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>de.uniwue.ls6.rulelearning</groupId>
<artifactId>Evaluation</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>de.uniwue.ls6.rulelearning</groupId>
<relativePath>../</relativePath>
<artifactId>ruleLearningParent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
</project>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment