Merge pull request #196 from Doha2012/master

modify reddit classifier
This commit is contained in:
Eugen 2015-04-20 10:53:11 +03:00
commit 608d2dbca9
5 changed files with 8181 additions and 8161 deletions

View File

@ -1,13 +1,17 @@
package org.baeldung.reddit.classifier;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.TimeZone;
import org.apache.mahout.classifier.sgd.AdaptiveLogisticRegression;
import org.apache.mahout.classifier.sgd.CrossFoldLearner;
import org.apache.mahout.classifier.sgd.L2;
import org.apache.mahout.classifier.sgd.OnlineLogisticRegression;
import org.apache.mahout.math.NamedVector;
import org.apache.mahout.math.RandomAccessSparseVector;
import org.apache.mahout.math.Vector;
import org.apache.mahout.vectorizer.encoders.AdaptiveWordValueEncoder;
@ -15,22 +19,25 @@ import org.apache.mahout.vectorizer.encoders.FeatureVectorEncoder;
import org.apache.mahout.vectorizer.encoders.StaticWordValueEncoder;
import com.google.common.base.Splitter;
import com.google.common.io.Files;
public class RedditClassifier {
public static int GOOD = 0;
public static int BAD = 1;
public static int MIN_SCORE = 5;
private final OnlineLogisticRegression classifier;
public static int MIN_SCORE = 10;
private final AdaptiveLogisticRegression classifier;
private final FeatureVectorEncoder titleEncoder;
private final FeatureVectorEncoder domainEncoder;
private CrossFoldLearner learner;
private final int[] trainCount = { 0, 0 };
private final int[] evalCount = { 0, 0 };
public RedditClassifier() {
classifier = new OnlineLogisticRegression(2, 4, new L2(1));
classifier = new AdaptiveLogisticRegression(2, 4, new L2());
classifier.setPoolSize(25);
titleEncoder = new AdaptiveWordValueEncoder("title");
titleEncoder.setProbes(1);
domainEncoder = new StaticWordValueEncoder("domain");
@ -38,27 +45,35 @@ public class RedditClassifier {
}
public void trainClassifier(String fileName) throws IOException {
final BufferedReader reader = new BufferedReader(new FileReader(fileName));
final List<NamedVector> vectors = extractVectors(readDataFile(fileName));
int category;
Vector features;
String line = reader.readLine();
if (line == null) {
new RedditDataCollector().collectData();
}
while ((line != null) && (line != "")) {
category = extractCategory(line);
for (final NamedVector vector : vectors) {
category = (vector.getName() == "GOOD") ? GOOD : BAD;
classifier.train(category, vector);
trainCount[category]++;
features = convertLineToVector(line);
classifier.train(category, features);
line = reader.readLine();
}
reader.close();
System.out.println("Training count ========= " + trainCount[0] + "___" + trainCount[1]);
}
public int classify(Vector features) {
return classifier.classifyFull(features).maxValueIndex();
public double evaluateClassifier() throws IOException {
final List<NamedVector> vectors = extractVectors(readDataFile(RedditDataCollector.TEST_FILE));
int category, result;
int correct = 0;
int wrong = 0;
for (final NamedVector vector : vectors) {
category = (vector.getName() == "GOOD") ? GOOD : BAD;
result = classify(vector);
evalCount[category]++;
if (category == result) {
correct++;
} else {
wrong++;
}
}
System.out.println(correct + " ----- " + wrong);
System.out.println("Eval count ========= " + evalCount[0] + "___" + evalCount[1]);
return correct / (wrong + correct + 0.0);
}
public Vector convertPost(String title, String domain, int hour) {
@ -71,49 +86,50 @@ public class RedditClassifier {
return features;
}
public double evaluateClassifier() throws IOException {
final BufferedReader reader = new BufferedReader(new FileReader(RedditDataCollector.TEST_FILE));
int category, result;
int correct = 0;
int wrong = 0;
Vector features;
String line = reader.readLine();
while ((line != null) && (line != "")) {
category = extractCategory(line);
evalCount[category]++;
features = convertLineToVector(line);
result = classify(features);
if (category == result) {
correct++;
} else {
wrong++;
}
line = reader.readLine();
public int classify(Vector features) {
if (learner == null) {
learner = classifier.getBest().getPayload().getLearner();
}
reader.close();
System.out.println(correct + " ----- " + wrong);
System.out.println("Eval count ========= " + evalCount[0] + "___" + evalCount[1]);
return correct / (wrong + correct + 0.0);
return learner.classifyFull(features).maxValueIndex();
}
// ==== private
private int extractCategory(String line) {
final int score = Integer.parseInt(line.substring(0, line.indexOf(';')));
return (score < MIN_SCORE) ? BAD : GOOD;
// ==== Private methods
private List<String> readDataFile(String fileName) throws IOException {
List<String> lines = Files.readLines(new File(fileName), Charset.forName("utf-8"));
if ((lines == null) || (lines.size() == 0)) {
new RedditDataCollector().collectData();
lines = Files.readLines(new File(fileName), Charset.forName("utf-8"));
}
lines.remove(0);
return lines;
}
private Vector convertLineToVector(String line) {
final Vector features = new RandomAccessSparseVector(4);
final String[] items = line.split(";");
private List<NamedVector> extractVectors(List<String> lines) {
final List<NamedVector> vectors = new ArrayList<NamedVector>(lines.size());
for (final String line : lines) {
vectors.add(extractVector(line));
}
return vectors;
}
private NamedVector extractVector(String line) {
final String[] items = line.split(",");
final String category = extractCategory(Integer.parseInt(items[0]));
final NamedVector vector = new NamedVector(new RandomAccessSparseVector(4), category);
final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
cal.setTimeInMillis(Long.parseLong(items[1]) * 1000);
final int hour = cal.get(Calendar.HOUR_OF_DAY);
titleEncoder.addToVector(items[3], features);
domainEncoder.addToVector(items[4], features);
features.set(2, hour); // hour of day
features.set(3, Integer.parseInt(items[2])); // number of words in the title
return features;
titleEncoder.addToVector(items[3], vector);
domainEncoder.addToVector(items[4], vector);
vector.set(2, cal.get(Calendar.HOUR_OF_DAY)); // hour of day
vector.set(3, Integer.parseInt(items[2])); // number of words in the title
return vector;
}
private String extractCategory(int score) {
return (score < MIN_SCORE) ? "BAD" : "GOOD";
}
}

View File

@ -47,12 +47,14 @@ public class RedditDataCollector {
timestamp = System.currentTimeMillis() / 1000;
try {
final FileWriter writer = new FileWriter(TRAINING_FILE);
writer.write("Score, Timestamp in utc, Number of wrods in title, Title, Domain \n");
for (int i = 0; i < noOfRounds; i++) {
getPosts(writer);
}
writer.close();
final FileWriter testWriter = new FileWriter(TEST_FILE);
testWriter.write("Score, Timestamp in utc, Number of wrods in title, Title, Domain \n");
getPosts(testWriter);
testWriter.close();
} catch (final Exception e) {
@ -83,9 +85,9 @@ public class RedditDataCollector {
words = Splitter.onPattern("\\W").omitEmptyStrings().splitToList(child.get("data").get("title").asText());
timestamp = child.get("data").get("created_utc").asLong();
line = score + ";";
line += timestamp + ";";
line += words.size() + ";" + Joiner.on(' ').join(words) + ";";
line = score + ",";
line += timestamp + ",";
line += words.size() + "," + Joiner.on(' ').join(words) + ",";
line += child.get("data").get("domain").asText() + "\n";
writer.write(line);
}

View File

@ -1,100 +1,101 @@
3;1357021066;7;Good Examples of Component dragging and dropping;self.java
0;1357017936;10;Game only works on mac need help porting to windows;self.java
2;1357008210;4;eclipse or keyboard issues;self.java
37;1356977564;6;The Long Strange Trip to Java;blinkenlights.com
5;1356970069;9;How to Send Email with Embedded Images Using Java;blog.smartbear.com
0;1356956937;4;What makes you architect;programming.freeblog.hu
0;1356900338;4;Apache Maven I of;javaxperiments.blogspot.com
0;1356896219;5;Custom functions per class instance;self.java
0;1356891056;5;JMeter Performance and Tuning Tips;ubik-ingenierie.com
12;1356888358;19;First fully functional GUI program about making acronyms easier to remember Was wondering if you guys had any tips;github.com
2;1356881034;12;Social Tech 101 Why do I love Java Developer Edition Part 1;socialtech101.blogspot.com
5;1356826782;7;Configurable deployment descriptors proposal for Java EE;java.net
31;1356793800;16;Finished my very first game in java Snake clone It s not much but it works;self.java
18;1356766107;10;la4j Linear Alebra for Java 0 3 0 is out;la4j.org
1;1356747219;6;RubyFlux a Ruby to Java compiler;github.com
15;1356735585;10;Simple JMS 2 0 Sample JMSDestinationDefinition and Synchronous Message Receive;blogs.oracle.com
9;1356717174;3;Java Use WebCam;self.java
4;1356711735;5;Compiler Optimisation for saving memory;self.java
4;1356662279;22;I m interested in your opinion about Java for Python Programmers by Brad Miller or a better alternative for a Java newbie;self.java
0;1356633508;4;A good android game;self.java
4;1356631759;12;a java library i saw mentioned here can t find pls help;self.java
1;1356627923;5;About learning Java a question;self.java
0;1356623761;3;Objects and java2d;self.java
0;1356593886;2;AffineTransform halp;self.java
43;1356584047;7;Java Was Strongly Influenced by Objective C;cs.gmu.edu
1;1356580543;7;Having trouble Setting Up Android Development Environment;self.java
0;1356560732;13;How can I fetch the first X links of reddit into a list;self.java
0;1356551788;4;JDK Download page error;self.java
9;1356536557;12;looking for a good book website to learn intermediate core java spring;self.java
7;1356487079;11;A popup menu like Filemaker s Any library have an implementation;self.java
1;1356455255;6;Just a Few Helpful Solr Functions;ignatyev-dev.blogspot.ru
13;1356433373;7;Bart s Blog Xtend the better compromise;bartnaudts.blogspot.de
4;1356410180;3;Beginner Question Here;self.java
19;1356283667;5;Nashorn JavaScript for the JVM;blogs.oracle.com
0;1356234086;5;Problem with Java memory use;self.java
0;1356195953;5;Learning Java in two weeks;self.java
0;1356127053;10;Twitter4J Download a Twitter Users Tweets to a Text File;github.com
20;1356118151;15;Using Apache Commons Functor functional interfaces with Java 8 lambdas cross post from r functionalprogramming;kinoshita.eti.br
13;1356102153;7;Date and Time in Java 8 Timezones;insightfullogic.com
10;1356088959;8;Implementing a collapsible ui repeat rows in JSF;kahimyang.info
8;1356034544;5;OmniFaces 1 3 is released;balusc.blogspot.com
1;1356027563;11;How to Configure a JNDI DataSource in the OpenShift Tomcat Cartridge;openshift.redhat.com
82;1356020780;7;Doomsday Sale IntelliJ 75 off today only;jetbrains.com
3;1355976320;3;IntelliJ Working Directory;self.java
0;1355966433;5;Help with java problem please;self.java
17;1355928745;12;What s new in Servlet 3 1 Java EE 7 moving forward;blogs.oracle.com
11;1355864485;5;Quick poll for research project;self.java
0;1355851994;5;Eclipse Text Problem Need Help;self.java
29;1355823193;4;Java 8 vs Xtend;blog.efftinge.de
2;1355805047;4;Learning Java between semesters;self.java
6;1355798488;11;I m a beginner programmer any tips on where to start;self.java
7;1355784039;9;Java Advent Calendar far sight look at JDK 8;javaadvent.com
2;1355782111;9;Technical Interview coming up Suggestions Pointers Words of Wisdom;self.java
0;1355775350;6;someone may help me out here;stackoverflow.com
2;1355765235;14;THC and a bit of Thunking Creative ways to deal with multiple return types;kingsfleet.blogspot.it
0;1355749586;12;Newbie here can you explain to me what class private stack is;self.java
0;1355748318;4;When StackOverflow Goes Bad;blogs.windward.net
0;1355721981;4;Java Graphics Projectile HELP;self.java
0;1355719622;12;Which one of the following statements about object oriented programming is false;self.java
16;1355707814;8;What s the skinny on JavaFX these days;self.java
2;1355685929;20;Can someone explain exactly what Apache Ant is How does it differ from just creating a jar file in blueJ;self.java
4;1355621071;7;Looking to add test code in Github;self.java
7;1355613608;6;Java Version of Jarvis Must Haves;self.java
5;1355599765;6;Java Advent Calendar Functional Java Collections;javaadvent.com
7;1355597483;13;I m working on a text based RPG and I have some questions;self.java
2;1355574445;6;Java EE 7 Community Survey Results;blog.eisele.net
0;1355576629;4;Evolution of Java Technology;compilr.org
18;1355574828;10;Are your Garbage Collection Logs speaking to you Censum does;blog.eisele.net
10;1355559380;13;What is the best GUI tool for creating a 2d platformer in Java;self.java
0;1355555357;7;Hit me with your best arrays tutorial;self.java
10;1355542403;11;Does any one know of clean 2d graphics library for java;self.java
23;1355511507;9;Dark Juno A Dark UI Theme for Eclipse 4;rogerdudler.github.com
0;1355504132;10;Java devs that work remote I have a few questions;self.java
0;1355501999;9;How do you make use of your Java knowledge;self.java
1;1355492027;5;How ClassLoader works in Java;javarevisited.blogspot.com.au
0;1355489352;9;Main difference between Abstract Class and Interface Compilr org;compilr.org
48;1355487006;8;Date and Time in Java 8 Part 1;insightfullogic.com
0;1355485766;3;Java JSON problem;self.java
10;1355448875;16;Open source applications large small worth looking at in Java I want to understand application structure;self.java
1;1355444452;4;lo mexor pz xxx;heavy-r.com
0;1355402889;11;JRebel Remoting to Push Changes to Your Toaster in The Cloud;zeroturnaround.com
0;1355402734;6;Are bugs part of technical debt;swreflections.blogspot.ca
2;1355400483;9;Compile and Run Java programs with Sublime Text 2;compilr.org
0;1355391115;4;console input like craftbukkit;self.java
7;1355390023;8;Hosting suggestions needed for a java web app;self.java
6;1355359227;17;Java novice here Have noticed funny performance differences across laptop and desktop Nvidia optimus related Details inside;self.java
1;1355327090;18;Please advice which java server technology should I choose for this new web app in my new work;self.java
0;1355326137;6;code to convert digits into words;compilr.org
34;1355319442;7;I want to learn REAL WORLD Java;self.java
5;1355285442;3;Hiring Java Developers;self.java
0;1355282335;14;Help How can I count the amount of a specific integer in an ArrayList;self.java
1;1355272303;24;I m taking a Java 1 final tomorrow I m fairly confident but I would appreciate any tips on things to look out for;self.java
38;1355267143;6;Will Java become the next COBOL;self.java
0;1355263047;2;Understanding recursion;imgur.com
1;1355257558;15;How can I clear the command prompt terminal with java and make it cross platform;self.java
2;1355253849;18;Is there a strategy for reducing code clutter when you are printing to the terminal alot Beginner Programmer;self.java
1;1355253049;5;BlockingQueues and multiple producer threads;self.java
1;1355241441;6;Beginner Struggling with classes Need help;self.java
0;1355238089;8;Simple Steps to Merge PDF files using Java;compilr.org
23;1355236940;8;Java and vs Python within a business context;self.java
Score, Timestamp in utc, Number of wrods in title, Title, Domain
3,1357021066,7,Good Examples of Component dragging and dropping,self.java
0,1357017936,10,Game only works on mac need help porting to windows,self.java
2,1357008210,4,eclipse or keyboard issues,self.java
37,1356977564,6,The Long Strange Trip to Java,blinkenlights.com
5,1356970069,9,How to Send Email with Embedded Images Using Java,blog.smartbear.com
0,1356956937,4,What makes you architect,programming.freeblog.hu
0,1356900338,4,Apache Maven I of,javaxperiments.blogspot.com
0,1356896219,5,Custom functions per class instance,self.java
0,1356891056,5,JMeter Performance and Tuning Tips,ubik-ingenierie.com
12,1356888358,19,First fully functional GUI program about making acronyms easier to remember Was wondering if you guys had any tips,github.com
2,1356881034,12,Social Tech 101 Why do I love Java Developer Edition Part 1,socialtech101.blogspot.com
5,1356826782,7,Configurable deployment descriptors proposal for Java EE,java.net
31,1356793800,16,Finished my very first game in java Snake clone It s not much but it works,self.java
18,1356766107,10,la4j Linear Alebra for Java 0 3 0 is out,la4j.org
1,1356747219,6,RubyFlux a Ruby to Java compiler,github.com
15,1356735585,10,Simple JMS 2 0 Sample JMSDestinationDefinition and Synchronous Message Receive,blogs.oracle.com
9,1356717174,3,Java Use WebCam,self.java
4,1356711735,5,Compiler Optimisation for saving memory,self.java
4,1356662279,22,I m interested in your opinion about Java for Python Programmers by Brad Miller or a better alternative for a Java newbie,self.java
0,1356633508,4,A good android game,self.java
4,1356631759,12,a java library i saw mentioned here can t find pls help,self.java
1,1356627923,5,About learning Java a question,self.java
0,1356623761,3,Objects and java2d,self.java
0,1356593886,2,AffineTransform halp,self.java
43,1356584047,7,Java Was Strongly Influenced by Objective C,cs.gmu.edu
1,1356580543,7,Having trouble Setting Up Android Development Environment,self.java
0,1356560732,13,How can I fetch the first X links of reddit into a list,self.java
0,1356551788,4,JDK Download page error,self.java
9,1356536557,12,looking for a good book website to learn intermediate core java spring,self.java
7,1356487079,11,A popup menu like Filemaker s Any library have an implementation,self.java
1,1356455255,6,Just a Few Helpful Solr Functions,ignatyev-dev.blogspot.ru
13,1356433373,7,Bart s Blog Xtend the better compromise,bartnaudts.blogspot.de
4,1356410180,3,Beginner Question Here,self.java
19,1356283667,5,Nashorn JavaScript for the JVM,blogs.oracle.com
0,1356234086,5,Problem with Java memory use,self.java
0,1356195953,5,Learning Java in two weeks,self.java
0,1356127053,10,Twitter4J Download a Twitter Users Tweets to a Text File,github.com
20,1356118151,15,Using Apache Commons Functor functional interfaces with Java 8 lambdas cross post from r functionalprogramming,kinoshita.eti.br
13,1356102153,7,Date and Time in Java 8 Timezones,insightfullogic.com
10,1356088959,8,Implementing a collapsible ui repeat rows in JSF,kahimyang.info
8,1356034544,5,OmniFaces 1 3 is released,balusc.blogspot.com
1,1356027563,11,How to Configure a JNDI DataSource in the OpenShift Tomcat Cartridge,openshift.redhat.com
82,1356020780,7,Doomsday Sale IntelliJ 75 off today only,jetbrains.com
3,1355976320,3,IntelliJ Working Directory,self.java
0,1355966433,5,Help with java problem please,self.java
17,1355928745,12,What s new in Servlet 3 1 Java EE 7 moving forward,blogs.oracle.com
11,1355864485,5,Quick poll for research project,self.java
0,1355851994,5,Eclipse Text Problem Need Help,self.java
29,1355823193,4,Java 8 vs Xtend,blog.efftinge.de
2,1355805047,4,Learning Java between semesters,self.java
6,1355798488,11,I m a beginner programmer any tips on where to start,self.java
7,1355784039,9,Java Advent Calendar far sight look at JDK 8,javaadvent.com
2,1355782111,9,Technical Interview coming up Suggestions Pointers Words of Wisdom,self.java
0,1355775350,6,someone may help me out here,stackoverflow.com
2,1355765235,14,THC and a bit of Thunking Creative ways to deal with multiple return types,kingsfleet.blogspot.it
0,1355749586,12,Newbie here can you explain to me what class private stack is,self.java
0,1355748318,4,When StackOverflow Goes Bad,blogs.windward.net
0,1355721981,4,Java Graphics Projectile HELP,self.java
0,1355719622,12,Which one of the following statements about object oriented programming is false,self.java
16,1355707814,8,What s the skinny on JavaFX these days,self.java
2,1355685929,20,Can someone explain exactly what Apache Ant is How does it differ from just creating a jar file in blueJ,self.java
4,1355621071,7,Looking to add test code in Github,self.java
7,1355613608,6,Java Version of Jarvis Must Haves,self.java
5,1355599765,6,Java Advent Calendar Functional Java Collections,javaadvent.com
7,1355597483,13,I m working on a text based RPG and I have some questions,self.java
2,1355574445,6,Java EE 7 Community Survey Results,blog.eisele.net
0,1355576629,4,Evolution of Java Technology,compilr.org
18,1355574828,10,Are your Garbage Collection Logs speaking to you Censum does,blog.eisele.net
10,1355559380,13,What is the best GUI tool for creating a 2d platformer in Java,self.java
0,1355555357,7,Hit me with your best arrays tutorial,self.java
10,1355542403,11,Does any one know of clean 2d graphics library for java,self.java
23,1355511507,9,Dark Juno A Dark UI Theme for Eclipse 4,rogerdudler.github.com
0,1355504132,10,Java devs that work remote I have a few questions,self.java
0,1355501999,9,How do you make use of your Java knowledge,self.java
1,1355492027,5,How ClassLoader works in Java,javarevisited.blogspot.com.au
0,1355489352,9,Main difference between Abstract Class and Interface Compilr org,compilr.org
48,1355487006,8,Date and Time in Java 8 Part 1,insightfullogic.com
0,1355485766,3,Java JSON problem,self.java
10,1355448875,16,Open source applications large small worth looking at in Java I want to understand application structure,self.java
1,1355444452,4,lo mexor pz xxx,heavy-r.com
0,1355402889,11,JRebel Remoting to Push Changes to Your Toaster in The Cloud,zeroturnaround.com
0,1355402734,6,Are bugs part of technical debt,swreflections.blogspot.ca
2,1355400483,9,Compile and Run Java programs with Sublime Text 2,compilr.org
0,1355391115,4,console input like craftbukkit,self.java
7,1355390023,8,Hosting suggestions needed for a java web app,self.java
6,1355359227,17,Java novice here Have noticed funny performance differences across laptop and desktop Nvidia optimus related Details inside,self.java
1,1355327090,18,Please advice which java server technology should I choose for this new web app in my new work,self.java
0,1355326137,6,code to convert digits into words,compilr.org
34,1355319442,7,I want to learn REAL WORLD Java,self.java
5,1355285442,3,Hiring Java Developers,self.java
0,1355282335,14,Help How can I count the amount of a specific integer in an ArrayList,self.java
1,1355272303,24,I m taking a Java 1 final tomorrow I m fairly confident but I would appreciate any tips on things to look out for,self.java
38,1355267143,6,Will Java become the next COBOL,self.java
0,1355263047,2,Understanding recursion,imgur.com
1,1355257558,15,How can I clear the command prompt terminal with java and make it cross platform,self.java
2,1355253849,18,Is there a strategy for reducing code clutter when you are printing to the terminal alot Beginner Programmer,self.java
1,1355253049,5,BlockingQueues and multiple producer threads,self.java
1,1355241441,6,Beginner Struggling with classes Need help,self.java
0,1355238089,8,Simple Steps to Merge PDF files using Java,compilr.org
23,1355236940,8,Java and vs Python within a business context,self.java

1 3 Score 1357021066 Timestamp in utc 7 Number of wrods in title Good Examples of Component dragging and dropping Title self.java Domain
2 0 3 1357017936 1357021066 10 7 Game only works on mac need help porting to windows Good Examples of Component dragging and dropping self.java self.java
3 2 0 1357008210 1357017936 4 10 eclipse or keyboard issues Game only works on mac need help porting to windows self.java self.java
4 37 2 1356977564 1357008210 6 4 The Long Strange Trip to Java eclipse or keyboard issues blinkenlights.com self.java
5 5 37 1356970069 1356977564 9 6 How to Send Email with Embedded Images Using Java The Long Strange Trip to Java blog.smartbear.com blinkenlights.com
6 0 5 1356956937 1356970069 4 9 What makes you architect How to Send Email with Embedded Images Using Java programming.freeblog.hu blog.smartbear.com
7 0 0 1356900338 1356956937 4 4 Apache Maven I of What makes you architect javaxperiments.blogspot.com programming.freeblog.hu
8 0 0 1356896219 1356900338 5 4 Custom functions per class instance Apache Maven I of self.java javaxperiments.blogspot.com
9 0 0 1356891056 1356896219 5 5 JMeter Performance and Tuning Tips Custom functions per class instance ubik-ingenierie.com self.java
10 12 0 1356888358 1356891056 19 5 First fully functional GUI program about making acronyms easier to remember Was wondering if you guys had any tips JMeter Performance and Tuning Tips github.com ubik-ingenierie.com
11 2 12 1356881034 1356888358 12 19 Social Tech 101 Why do I love Java Developer Edition Part 1 First fully functional GUI program about making acronyms easier to remember Was wondering if you guys had any tips socialtech101.blogspot.com github.com
12 5 2 1356826782 1356881034 7 12 Configurable deployment descriptors proposal for Java EE Social Tech 101 Why do I love Java Developer Edition Part 1 java.net socialtech101.blogspot.com
13 31 5 1356793800 1356826782 16 7 Finished my very first game in java Snake clone It s not much but it works Configurable deployment descriptors proposal for Java EE self.java java.net
14 18 31 1356766107 1356793800 10 16 la4j Linear Alebra for Java 0 3 0 is out Finished my very first game in java Snake clone It s not much but it works la4j.org self.java
15 1 18 1356747219 1356766107 6 10 RubyFlux a Ruby to Java compiler la4j Linear Alebra for Java 0 3 0 is out github.com la4j.org
16 15 1 1356735585 1356747219 10 6 Simple JMS 2 0 Sample JMSDestinationDefinition and Synchronous Message Receive RubyFlux a Ruby to Java compiler blogs.oracle.com github.com
17 9 15 1356717174 1356735585 3 10 Java Use WebCam Simple JMS 2 0 Sample JMSDestinationDefinition and Synchronous Message Receive self.java blogs.oracle.com
18 4 9 1356711735 1356717174 5 3 Compiler Optimisation for saving memory Java Use WebCam self.java self.java
19 4 4 1356662279 1356711735 22 5 I m interested in your opinion about Java for Python Programmers by Brad Miller or a better alternative for a Java newbie Compiler Optimisation for saving memory self.java self.java
20 0 4 1356633508 1356662279 4 22 A good android game I m interested in your opinion about Java for Python Programmers by Brad Miller or a better alternative for a Java newbie self.java self.java
21 4 0 1356631759 1356633508 12 4 a java library i saw mentioned here can t find pls help A good android game self.java self.java
22 1 4 1356627923 1356631759 5 12 About learning Java a question a java library i saw mentioned here can t find pls help self.java self.java
23 0 1 1356623761 1356627923 3 5 Objects and java2d About learning Java a question self.java self.java
24 0 0 1356593886 1356623761 2 3 AffineTransform halp Objects and java2d self.java self.java
25 43 0 1356584047 1356593886 7 2 Java Was Strongly Influenced by Objective C AffineTransform halp cs.gmu.edu self.java
26 1 43 1356580543 1356584047 7 7 Having trouble Setting Up Android Development Environment Java Was Strongly Influenced by Objective C self.java cs.gmu.edu
27 0 1 1356560732 1356580543 13 7 How can I fetch the first X links of reddit into a list Having trouble Setting Up Android Development Environment self.java self.java
28 0 0 1356551788 1356560732 4 13 JDK Download page error How can I fetch the first X links of reddit into a list self.java self.java
29 9 0 1356536557 1356551788 12 4 looking for a good book website to learn intermediate core java spring JDK Download page error self.java self.java
30 7 9 1356487079 1356536557 11 12 A popup menu like Filemaker s Any library have an implementation looking for a good book website to learn intermediate core java spring self.java self.java
31 1 7 1356455255 1356487079 6 11 Just a Few Helpful Solr Functions A popup menu like Filemaker s Any library have an implementation ignatyev-dev.blogspot.ru self.java
32 13 1 1356433373 1356455255 7 6 Bart s Blog Xtend the better compromise Just a Few Helpful Solr Functions bartnaudts.blogspot.de ignatyev-dev.blogspot.ru
33 4 13 1356410180 1356433373 3 7 Beginner Question Here Bart s Blog Xtend the better compromise self.java bartnaudts.blogspot.de
34 19 4 1356283667 1356410180 5 3 Nashorn JavaScript for the JVM Beginner Question Here blogs.oracle.com self.java
35 0 19 1356234086 1356283667 5 5 Problem with Java memory use Nashorn JavaScript for the JVM self.java blogs.oracle.com
36 0 0 1356195953 1356234086 5 5 Learning Java in two weeks Problem with Java memory use self.java self.java
37 0 0 1356127053 1356195953 10 5 Twitter4J Download a Twitter Users Tweets to a Text File Learning Java in two weeks github.com self.java
38 20 0 1356118151 1356127053 15 10 Using Apache Commons Functor functional interfaces with Java 8 lambdas cross post from r functionalprogramming Twitter4J Download a Twitter Users Tweets to a Text File kinoshita.eti.br github.com
39 13 20 1356102153 1356118151 7 15 Date and Time in Java 8 Timezones Using Apache Commons Functor functional interfaces with Java 8 lambdas cross post from r functionalprogramming insightfullogic.com kinoshita.eti.br
40 10 13 1356088959 1356102153 8 7 Implementing a collapsible ui repeat rows in JSF Date and Time in Java 8 Timezones kahimyang.info insightfullogic.com
41 8 10 1356034544 1356088959 5 8 OmniFaces 1 3 is released Implementing a collapsible ui repeat rows in JSF balusc.blogspot.com kahimyang.info
42 1 8 1356027563 1356034544 11 5 How to Configure a JNDI DataSource in the OpenShift Tomcat Cartridge OmniFaces 1 3 is released openshift.redhat.com balusc.blogspot.com
43 82 1 1356020780 1356027563 7 11 Doomsday Sale IntelliJ 75 off today only How to Configure a JNDI DataSource in the OpenShift Tomcat Cartridge jetbrains.com openshift.redhat.com
44 3 82 1355976320 1356020780 3 7 IntelliJ Working Directory Doomsday Sale IntelliJ 75 off today only self.java jetbrains.com
45 0 3 1355966433 1355976320 5 3 Help with java problem please IntelliJ Working Directory self.java self.java
46 17 0 1355928745 1355966433 12 5 What s new in Servlet 3 1 Java EE 7 moving forward Help with java problem please blogs.oracle.com self.java
47 11 17 1355864485 1355928745 5 12 Quick poll for research project What s new in Servlet 3 1 Java EE 7 moving forward self.java blogs.oracle.com
48 0 11 1355851994 1355864485 5 5 Eclipse Text Problem Need Help Quick poll for research project self.java self.java
49 29 0 1355823193 1355851994 4 5 Java 8 vs Xtend Eclipse Text Problem Need Help blog.efftinge.de self.java
50 2 29 1355805047 1355823193 4 4 Learning Java between semesters Java 8 vs Xtend self.java blog.efftinge.de
51 6 2 1355798488 1355805047 11 4 I m a beginner programmer any tips on where to start Learning Java between semesters self.java self.java
52 7 6 1355784039 1355798488 9 11 Java Advent Calendar far sight look at JDK 8 I m a beginner programmer any tips on where to start javaadvent.com self.java
53 2 7 1355782111 1355784039 9 9 Technical Interview coming up Suggestions Pointers Words of Wisdom Java Advent Calendar far sight look at JDK 8 self.java javaadvent.com
54 0 2 1355775350 1355782111 6 9 someone may help me out here Technical Interview coming up Suggestions Pointers Words of Wisdom stackoverflow.com self.java
55 2 0 1355765235 1355775350 14 6 THC and a bit of Thunking Creative ways to deal with multiple return types someone may help me out here kingsfleet.blogspot.it stackoverflow.com
56 0 2 1355749586 1355765235 12 14 Newbie here can you explain to me what class private stack is THC and a bit of Thunking Creative ways to deal with multiple return types self.java kingsfleet.blogspot.it
57 0 0 1355748318 1355749586 4 12 When StackOverflow Goes Bad Newbie here can you explain to me what class private stack is blogs.windward.net self.java
58 0 0 1355721981 1355748318 4 4 Java Graphics Projectile HELP When StackOverflow Goes Bad self.java blogs.windward.net
59 0 0 1355719622 1355721981 12 4 Which one of the following statements about object oriented programming is false Java Graphics Projectile HELP self.java self.java
60 16 0 1355707814 1355719622 8 12 What s the skinny on JavaFX these days Which one of the following statements about object oriented programming is false self.java self.java
61 2 16 1355685929 1355707814 20 8 Can someone explain exactly what Apache Ant is How does it differ from just creating a jar file in blueJ What s the skinny on JavaFX these days self.java self.java
62 4 2 1355621071 1355685929 7 20 Looking to add test code in Github Can someone explain exactly what Apache Ant is How does it differ from just creating a jar file in blueJ self.java self.java
63 7 4 1355613608 1355621071 6 7 Java Version of Jarvis Must Haves Looking to add test code in Github self.java self.java
64 5 7 1355599765 1355613608 6 6 Java Advent Calendar Functional Java Collections Java Version of Jarvis Must Haves javaadvent.com self.java
65 7 5 1355597483 1355599765 13 6 I m working on a text based RPG and I have some questions Java Advent Calendar Functional Java Collections self.java javaadvent.com
66 2 7 1355574445 1355597483 6 13 Java EE 7 Community Survey Results I m working on a text based RPG and I have some questions blog.eisele.net self.java
67 0 2 1355576629 1355574445 4 6 Evolution of Java Technology Java EE 7 Community Survey Results compilr.org blog.eisele.net
68 18 0 1355574828 1355576629 10 4 Are your Garbage Collection Logs speaking to you Censum does Evolution of Java Technology blog.eisele.net compilr.org
69 10 18 1355559380 1355574828 13 10 What is the best GUI tool for creating a 2d platformer in Java Are your Garbage Collection Logs speaking to you Censum does self.java blog.eisele.net
70 0 10 1355555357 1355559380 7 13 Hit me with your best arrays tutorial What is the best GUI tool for creating a 2d platformer in Java self.java self.java
71 10 0 1355542403 1355555357 11 7 Does any one know of clean 2d graphics library for java Hit me with your best arrays tutorial self.java self.java
72 23 10 1355511507 1355542403 9 11 Dark Juno A Dark UI Theme for Eclipse 4 Does any one know of clean 2d graphics library for java rogerdudler.github.com self.java
73 0 23 1355504132 1355511507 10 9 Java devs that work remote I have a few questions Dark Juno A Dark UI Theme for Eclipse 4 self.java rogerdudler.github.com
74 0 0 1355501999 1355504132 9 10 How do you make use of your Java knowledge Java devs that work remote I have a few questions self.java self.java
75 1 0 1355492027 1355501999 5 9 How ClassLoader works in Java How do you make use of your Java knowledge javarevisited.blogspot.com.au self.java
76 0 1 1355489352 1355492027 9 5 Main difference between Abstract Class and Interface Compilr org How ClassLoader works in Java compilr.org javarevisited.blogspot.com.au
77 48 0 1355487006 1355489352 8 9 Date and Time in Java 8 Part 1 Main difference between Abstract Class and Interface Compilr org insightfullogic.com compilr.org
78 0 48 1355485766 1355487006 3 8 Java JSON problem Date and Time in Java 8 Part 1 self.java insightfullogic.com
79 10 0 1355448875 1355485766 16 3 Open source applications large small worth looking at in Java I want to understand application structure Java JSON problem self.java self.java
80 1 10 1355444452 1355448875 4 16 lo mexor pz xxx Open source applications large small worth looking at in Java I want to understand application structure heavy-r.com self.java
81 0 1 1355402889 1355444452 11 4 JRebel Remoting to Push Changes to Your Toaster in The Cloud lo mexor pz xxx zeroturnaround.com heavy-r.com
82 0 0 1355402734 1355402889 6 11 Are bugs part of technical debt JRebel Remoting to Push Changes to Your Toaster in The Cloud swreflections.blogspot.ca zeroturnaround.com
83 2 0 1355400483 1355402734 9 6 Compile and Run Java programs with Sublime Text 2 Are bugs part of technical debt compilr.org swreflections.blogspot.ca
84 0 2 1355391115 1355400483 4 9 console input like craftbukkit Compile and Run Java programs with Sublime Text 2 self.java compilr.org
85 7 0 1355390023 1355391115 8 4 Hosting suggestions needed for a java web app console input like craftbukkit self.java self.java
86 6 7 1355359227 1355390023 17 8 Java novice here Have noticed funny performance differences across laptop and desktop Nvidia optimus related Details inside Hosting suggestions needed for a java web app self.java self.java
87 1 6 1355327090 1355359227 18 17 Please advice which java server technology should I choose for this new web app in my new work Java novice here Have noticed funny performance differences across laptop and desktop Nvidia optimus related Details inside self.java self.java
88 0 1 1355326137 1355327090 6 18 code to convert digits into words Please advice which java server technology should I choose for this new web app in my new work compilr.org self.java
89 34 0 1355319442 1355326137 7 6 I want to learn REAL WORLD Java code to convert digits into words self.java compilr.org
90 5 34 1355285442 1355319442 3 7 Hiring Java Developers I want to learn REAL WORLD Java self.java self.java
91 0 5 1355282335 1355285442 14 3 Help How can I count the amount of a specific integer in an ArrayList Hiring Java Developers self.java self.java
92 1 0 1355272303 1355282335 24 14 I m taking a Java 1 final tomorrow I m fairly confident but I would appreciate any tips on things to look out for Help How can I count the amount of a specific integer in an ArrayList self.java self.java
93 38 1 1355267143 1355272303 6 24 Will Java become the next COBOL I m taking a Java 1 final tomorrow I m fairly confident but I would appreciate any tips on things to look out for self.java self.java
94 0 38 1355263047 1355267143 2 6 Understanding recursion Will Java become the next COBOL imgur.com self.java
95 1 0 1355257558 1355263047 15 2 How can I clear the command prompt terminal with java and make it cross platform Understanding recursion self.java imgur.com
96 2 1 1355253849 1355257558 18 15 Is there a strategy for reducing code clutter when you are printing to the terminal alot Beginner Programmer How can I clear the command prompt terminal with java and make it cross platform self.java self.java
97 1 2 1355253049 1355253849 5 18 BlockingQueues and multiple producer threads Is there a strategy for reducing code clutter when you are printing to the terminal alot Beginner Programmer self.java self.java
98 1 1 1355241441 1355253049 6 5 Beginner Struggling with classes Need help BlockingQueues and multiple producer threads self.java self.java
99 0 1 1355238089 1355241441 8 6 Simple Steps to Merge PDF files using Java Beginner Struggling with classes Need help compilr.org self.java
100 23 0 1355236940 1355238089 8 8 Java and vs Python within a business context Simple Steps to Merge PDF files using Java self.java compilr.org
101 23 1355236940 8 Java and vs Python within a business context self.java

File diff suppressed because it is too large Load Diff

View File

@ -7,10 +7,9 @@ import java.io.IOException;
import org.baeldung.reddit.classifier.RedditClassifier;
import org.baeldung.reddit.classifier.RedditDataCollector;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
@Ignore
//@Ignore
public class RedditClassifierTest {
private RedditClassifier classifier;
@ -27,4 +26,5 @@ public class RedditClassifierTest {
System.out.println("Accuracy = " + result);
assertTrue(result > 0.8);
}
}