From: <km...@us...> - 2011-10-26 14:34:16
|
Revision: 3327 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3327&view=rev Author: kmpf Date: 2011-10-26 14:34:10 +0000 (Wed, 26 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/scripts/src/main/java/org/dllearner/examples/pdb/HelixRDFCreator.java trunk/scripts/src/main/java/org/dllearner/examples/pdb/PDBWekaLearner.java Modified: trunk/scripts/src/main/java/org/dllearner/examples/pdb/HelixRDFCreator.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/examples/pdb/HelixRDFCreator.java 2011-10-26 13:48:52 UTC (rev 3326) +++ trunk/scripts/src/main/java/org/dllearner/examples/pdb/HelixRDFCreator.java 2011-10-26 14:34:10 UTC (rev 3327) @@ -415,8 +415,8 @@ "@ATTRIBUTE aromaticity NUMERIC\n" + // Aliphatic = 0; Aromatic = 1 "@ATTRIBUTE hydrogen_bonding NUMERIC\n"; // Donor = 1; Donor/Acceptor = 0; Acceptor = -1 - for (int i = -8; i < 8; i++) { - attributes += "@ATTRIBUTE aa_position_" + i + " CLASS\n"; // amino acid at position $i from current amino acid + for (int i = -8; i <= 8; i++) { + attributes += "@ATTRIBUTE aa_position_" + i + " {A,C,D,E,F,G,H,I,K,L,M,N,P,Q,R,S,T,V,W,Y}\n"; // amino acid at position $i from current amino acid } attributes += "@ATTRIBUTE in_helix NUMERIC\n"; // Helix = 1 Other = 0 Modified: trunk/scripts/src/main/java/org/dllearner/examples/pdb/PDBWekaLearner.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/examples/pdb/PDBWekaLearner.java 2011-10-26 13:48:52 UTC (rev 3326) +++ trunk/scripts/src/main/java/org/dllearner/examples/pdb/PDBWekaLearner.java 2011-10-26 14:34:10 UTC (rev 3327) @@ -3,7 +3,6 @@ import java.io.File; import java.io.FileWriter; import java.io.IOException; -import java.util.List; import java.util.Random; import org.apache.log4j.ConsoleAppender; @@ -11,18 +10,19 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.SimpleLayout; - +/* import weka.classifiers.Evaluation; -import weka.classifiers.trees.J48; +import weka.classifiers.bayes.NaiveBayes; import weka.core.Instances; import weka.core.converters.ConverterUtils.DataSource; +*/ public class PDBWekaLearner { private static Logger logger = Logger.getRootLogger(); public PDBWekaLearner (File arffFile) throws IOException{ - + /* // create logger (configure this to your needs) SimpleLayout layout = new SimpleLayout(); FileAppender fileAppender = new FileAppender(layout, "log/sample_log.txt", false); @@ -42,13 +42,13 @@ if (data.classIndex() == -1) data.setClassIndex(data.numAttributes() - 1); - String[] options = new String[1]; - options[0] = "-U"; // unpruned tree - J48 tree = new J48(); // new instance of tree - tree.setOptions(options); // set the options - //tree.buildClassifier(data); // build classifier + // String[] options = new String[0]; + + NaiveBayes classifier = new NaiveBayes(); // new instance of tree + // classifier.setOptions(options); // set the options + classifier.buildClassifier(data); // build classifier Evaluation eval = new Evaluation(data); - eval.crossValidateModel(tree, data, 10, new Random(1)); + eval.crossValidateModel(classifier, data, 10, new Random(1)); // gather the results of the evaluation process String resultsFileName = arffFile.getPath().replace(".arff", ".weka.res"); @@ -70,5 +70,6 @@ } catch (Exception e){ e.printStackTrace(); } + */ } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |