Ignore:
Timestamp:
10/31/14 15:54:08 (10 years ago)
Author:
atrautsch
Message:

Mehr kommentiert.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrossPare/src/de/ugoe/cs/cpdp/training/WekaBaseTraining2.java

    r7 r20  
    55 
    66import de.ugoe.cs.util.console.Console; 
     7 
    78import weka.core.OptionHandler; 
    89import weka.classifiers.Classifier; 
    910import weka.classifiers.meta.CVParameterSelection; 
    1011 
     12/** 
     13 * WekaBaseTraining2 
     14 *  
     15 * Allows specification of the Weka classifier and its params in the XML experiment configuration. 
     16 *  
     17 * Important conventions of the XML format:  
     18 * Cross Validation params come always last and are prepended with -CVPARAM 
     19 * Example: <trainer name="WekaClusterTraining2" param="RandomForestLocal weka.classifiers.trees.RandomForest -CVPARAM I 5 25 5"/> 
     20 */ 
    1121public abstract class WekaBaseTraining2 implements WekaCompatibleTrainer { 
    1222         
     
    2030                String[] params = parameters.split(" "); 
    2131 
    22                 // first is classifierName 
     32                // first part of the params is the classifierName (e.g. SMORBF) 
    2333                classifierName = params[0]; 
    2434                 
    25                 // all following parameters can be copied from weka! 
     35                // the following parameters can be copied from weka! 
    2636                 
    27                 // second param is classifierClassName 
     37                // second param is classifierClassName (e.g. weka.classifiers.functions.SMO) 
    2838                classifierClassName = params[1]; 
    2939         
    30                 // rest are params to the specified classifier 
     40                // rest are params to the specified classifier (e.g. -K weka.classifiers.functions.supportVector.RBFKernel) 
    3141                classifierParams = Arrays.copyOfRange(params, 2, params.length); 
    3242                 
     
    4656                        Classifier obj = (Classifier) c.newInstance(); 
    4757                         
    48                         // Filter -CVPARAM 
     58                        // Filter out -CVPARAM, these are special because they do not belong to the Weka classifier class as parameters 
    4959                        String[] param = Arrays.copyOf(classifierParams, classifierParams.length); 
    5060                        String[] cvparam = {}; 
     
    6878                         
    6979                        // we have cross val params 
    70                         // cant check on cvparam.length may not be initialized                   
     80                        // cant check on cvparam.length here, it may not be initialized                  
    7181                        if(cv) { 
    7282                                final CVParameterSelection ps = new CVParameterSelection(); 
Note: See TracChangeset for help on using the changeset viewer.