public void setOptions(String... options) throws Exception { wekaClassifier.setOptions(options); }
/** * Parses a given list of options. * <p/> * * <!-- options-start --> Valid options are: * <p/> * * <pre> * -B <minimum bucket size> * The minimum number of objects in a bucket (default: 6). * </pre> * * <!-- options-end --> * * @param options the list of options as an array of strings * @throws Exception if an option is not supported */ @Override public void setOptions(String[] options) throws Exception { String bucketSizeString = Utils.getOption('B', options); if (bucketSizeString.length() != 0) { m_minBucketSize = Integer.parseInt(bucketSizeString); } else { m_minBucketSize = 6; } super.setOptions(options); }
/** * Parses a given list of options. * <p/> * * <!-- options-start --> Valid options are: * <p/> * * <pre> * -B <minimum bucket size> * The minimum number of objects in a bucket (default: 6). * </pre> * * <!-- options-end --> * * @param options the list of options as an array of strings * @throws Exception if an option is not supported */ @Override public void setOptions(String[] options) throws Exception { String bucketSizeString = Utils.getOption('B', options); if (bucketSizeString.length() != 0) { m_minBucketSize = Integer.parseInt(bucketSizeString); } else { m_minBucketSize = 6; } super.setOptions(options); }
classifier.setOptions(classifierOptions);
this.classifier = (AbstractClassifier) classifierClassConstructor.newInstance(); if (classifierParameters != null && !classifierParameters.equals("")) this.classifier.setOptions(classifierParameters); String[] options = this.classifier.getOptions(); StringBuffer optionsString = new StringBuffer();
/** * Set classifier for current segmentation * * @param classifierName classifier name with complete package information * @param options classifier options */ public static void setClassifier(String classifierName, String options) { final ImageWindow iw = WindowManager.getCurrentImage().getWindow(); if( iw instanceof CustomWindow ) { final CustomWindow win = (CustomWindow) iw; final WekaSegmentation wekaSegmentation = win.getWekaSegmentation(); try { AbstractClassifier cls = (AbstractClassifier)( Class.forName(classifierName).newInstance() ); cls.setOptions( options.split(" ")); wekaSegmentation.setClassifier(cls); } catch (Exception e) { e.printStackTrace(); } } }
String tmpStr; super.setOptions(options);
/** * Set classifier for current segmentation * * @param classifierName classifier name with complete package information * @param options classifier options */ public static void setClassifier(String classifierName, String options) { final ImageWindow iw = WindowManager.getCurrentImage().getWindow(); if( iw instanceof CustomWindow ) { final CustomWindow win = (CustomWindow) iw; final WekaSegmentation wekaSegmentation = win.getWekaSegmentation(); try { AbstractClassifier cls = (AbstractClassifier)( Class.forName(classifierName).newInstance() ); cls.setOptions( options.split(" ")); wekaSegmentation.setClassifier(cls); } catch (Exception e) { e.printStackTrace(); } } }
/** * Parses a given list of options. Valid options are:<p> * * -W classname <br> * Specify the full class name of the base learner.<p> * * -I num <br> * Set the number of iterations (default 10). <p> * * -S num <br> * Set the random number seed (default 1). <p> * * Options after -- are passed to the designated classifier.<p> * * @param options the list of options as an array of strings * @exception Exception if an option is not supported */ public void setOptions(String[] options) throws Exception { String seed = Utils.getOption('S', options); if (seed.length() != 0) { setSeed(Integer.parseInt(seed)); } else { setSeed(1); } super.setOptions(options); }
/** * Parses a given list of options. Valid options are:<p> * * -W classname <br> * Specify the full class name of the base learner.<p> * * -I num <br> * Set the number of iterations (default 10). <p> * * -S num <br> * Set the random number seed (default 1). <p> * * Options after -- are passed to the designated classifier.<p> * * @param options the list of options as an array of strings * @exception Exception if an option is not supported */ public void setOptions(String[] options) throws Exception { String seed = Utils.getOption('S', options); if (seed.length() != 0) { setSeed(Integer.parseInt(seed)); } else { setSeed(1); } super.setOptions(options); }
super.setOptions(options);
super.setOptions(options);
/** * Parses a given list of options. * <p/> * * <!-- options-start --> Valid options are: * <p/> * * <pre> * -N <num> * Whether to 0=normalize/1=standardize/2=neither. * (default 0=normalize) * </pre> * * <!-- options-end --> * * @param options the list of options as an array of strings * @throws Exception if an option is not supported */ @Override public void setOptions(String[] options) throws Exception { String nString = Utils.getOption('N', options); if (nString.length() != 0) { setFilterType(new SelectedTag(Integer.parseInt(nString), TAGS_FILTER)); } else { setFilterType(new SelectedTag(FILTER_NORMALIZE, TAGS_FILTER)); } super.setOptions(options); Utils.checkForRemainingOptions(options); }
/** * Parses a given list of options. * * @param options the list of options as an array of strings * @throws Exception if an option is not supported */ @Override public void setOptions(String[] options) throws Exception { String tmpStr; tmpStr = Utils.getOption('R', options); if (tmpStr.length() != 0) { setRidge(Double.parseDouble(tmpStr)); } else { setRidge(1.0e-6); } tmpStr = Utils.getOption('A', options); if (tmpStr.length() != 0) { setAlgorithmType(new SelectedTag(Integer.parseInt(tmpStr), TAGS_ALGORITHMTYPE)); } else { setAlgorithmType(new SelectedTag(ALGORITHMTYPE_DEFAULT, TAGS_ALGORITHMTYPE)); } super.setOptions(options); Utils.checkForRemainingOptions(options); }
/** * Parses a given list of options. * * @param options the list of options as an array of strings * @throws Exception if an option is not supported */ @Override public void setOptions(String[] options) throws Exception { setDebug(Utils.getFlag('D', options)); String nString = Utils.getOption('N', options); if (nString.length() != 0) { setFilterType(new SelectedTag(Integer.parseInt(nString), TAGS_FILTER)); } else { setFilterType(new SelectedTag(FILTER_STANDARDIZE, TAGS_FILTER)); } super.setOptions(options); Utils.checkForRemainingOptions(options); }
/** * Parses a given list of options. * <p/> * * Valid options are: * <p> * * -U <br> * Use unsmoothed predictions. * <p> * * -R <br> * Build a regression tree rather than a model tree. * <p> * * @param options the list of options as an array of strings * @throws Exception if an option is not supported */ @Override public void setOptions(String[] options) throws Exception { setUnpruned(Utils.getFlag('N', options)); setUseUnsmoothed(Utils.getFlag('U', options)); setBuildRegressionTree(Utils.getFlag('R', options)); String optionString = Utils.getOption('M', options); if (optionString.length() != 0) { setMinNumInstances((new Double(optionString)).doubleValue()); } super.setOptions(options); Utils.checkForRemainingOptions(options); }
/** * Parses a given list of options. * <p/> * * Valid options are: * <p> * * -U <br> * Use unsmoothed predictions. * <p> * * -R <br> * Build a regression tree rather than a model tree. * <p> * * @param options the list of options as an array of strings * @throws Exception if an option is not supported */ @Override public void setOptions(String[] options) throws Exception { setUnpruned(Utils.getFlag('N', options)); setUseUnsmoothed(Utils.getFlag('U', options)); setBuildRegressionTree(Utils.getFlag('R', options)); String optionString = Utils.getOption('M', options); if (optionString.length() != 0) { setMinNumInstances((new Double(optionString)).doubleValue()); } super.setOptions(options); Utils.checkForRemainingOptions(options); }
setClassifier(option); super.setOptions(options);
/** * Parses a given list of options. Valid options are:<p> * * -W classname <br> * Specify the full class name of the base learner.<p> * * Options after -- are passed to the designated classifier.<p> * * @param options the list of options as an array of strings * @exception Exception if an option is not supported */ public void setOptions(String[] options) throws Exception { super.setOptions(options); String classifierName = Utils.getOption('W', options); if (classifierName.length() > 0) { setClassifier(AbstractClassifier.forName(classifierName, null)); setClassifier(AbstractClassifier.forName(classifierName, Utils.partitionOptions(options))); } else { setClassifier(AbstractClassifier.forName(defaultClassifierString(), null)); String[] classifierOptions = Utils.partitionOptions(options); if (classifierOptions.length > 0) { setClassifier(AbstractClassifier.forName(defaultClassifierString(), classifierOptions)); } else { setClassifier(AbstractClassifier.forName(defaultClassifierString(), defaultClassifierOptions())); } } }
/** * Parses a given list of options. Valid options are:<p> * * -W classname <br> * Specify the full class name of the base learner.<p> * * Options after -- are passed to the designated classifier.<p> * * @param options the list of options as an array of strings * @exception Exception if an option is not supported */ public void setOptions(String[] options) throws Exception { super.setOptions(options); String classifierName = Utils.getOption('W', options); if (classifierName.length() > 0) { setClassifier(AbstractClassifier.forName(classifierName, null)); setClassifier(AbstractClassifier.forName(classifierName, Utils.partitionOptions(options))); } else { setClassifier(AbstractClassifier.forName(defaultClassifierString(), null)); String[] classifierOptions = Utils.partitionOptions(options); if (classifierOptions.length > 0) { setClassifier(AbstractClassifier.forName(defaultClassifierString(), classifierOptions)); } else { setClassifier(AbstractClassifier.forName(defaultClassifierString(), defaultClassifierOptions())); } } }