?? rbfnetwork.java
字號:
* displaying in the explorer/experimenter gui */ public String maxItsTipText() { return "Maximum number of iterations for the logistic regression to perform. " +"Only applied to discrete class problems."; } /** * Get the value of MaxIts. * * @return Value of MaxIts. */ public int getMaxIts() { return m_maxIts; } /** * Set the value of MaxIts. * * @param newMaxIts Value to assign to MaxIts. */ public void setMaxIts(int newMaxIts) { m_maxIts = newMaxIts; } /** * Returns the tip text for this property * @return tip text for this property suitable for * displaying in the explorer/experimenter gui */ public String ridgeTipText() { return "Set the Ridge value for the logistic or linear regression."; } /** * Sets the ridge value for logistic or linear regression. * * @param ridge the ridge */ public void setRidge(double ridge) { m_ridge = ridge; } /** * Gets the ridge value. * * @return the ridge */ public double getRidge() { return m_ridge; } /** * Returns the tip text for this property * @return tip text for this property suitable for * displaying in the explorer/experimenter gui */ public String numClustersTipText() { return "The number of clusters for K-Means to generate."; } /** * Set the number of clusters for K-means to generate. * * @param numClusters the number of clusters to generate. */ public void setNumClusters(int numClusters) { if (numClusters > 0) { m_numClusters = numClusters; } } /** * Return the number of clusters to generate. * * @return the number of clusters to generate. */ public int getNumClusters() { return m_numClusters; } /** * Returns the tip text for this property * @return tip text for this property suitable for * displaying in the explorer/experimenter gui */ public String clusteringSeedTipText() { return "The random seed to pass on to K-means."; } /** * Set the random seed to be passed on to K-means. * * @param seed a seed value. */ public void setClusteringSeed(int seed) { m_clusteringSeed = seed; } /** * Get the random seed used by K-means. * * @return the seed value. */ public int getClusteringSeed() { return m_clusteringSeed; } /** * Returns the tip text for this property * @return tip text for this property suitable for * displaying in the explorer/experimenter gui */ public String minStdDevTipText() { return "Sets the minimum standard deviation for the clusters."; } /** * Get the MinStdDev value. * @return the MinStdDev value. */ public double getMinStdDev() { return m_minStdDev; } /** * Set the MinStdDev value. * @param newMinStdDev The new MinStdDev value. */ public void setMinStdDev(double newMinStdDev) { m_minStdDev = newMinStdDev; } /** * Returns an enumeration describing the available options * * @return an enumeration of all the available options */ public Enumeration listOptions() { Vector newVector = new Vector(4); newVector.addElement(new Option("\tSet the number of clusters (basis functions) " +"to generate. (default = 2).", "B", 1, "-B <number>")); newVector.addElement(new Option("\tSet the random seed to be used by K-means. " +"(default = 1).", "S", 1, "-S <seed>")); newVector.addElement(new Option("\tSet the ridge value for the logistic or " +"linear regression.", "R", 1, "-R <ridge>")); newVector.addElement(new Option("\tSet the maximum number of iterations " +"for the logistic regression." + " (default -1, until convergence).", "M", 1, "-M <number>")); newVector.addElement(new Option("\tSet the minimum standard " +"deviation for the clusters." + " (default 0.1).", "W", 1, "-W <number>")); return newVector.elements(); } /** * Parses a given list of options. <p/> * <!-- options-start --> * Valid options are: <p/> * * <pre> -B <number> * Set the number of clusters (basis functions) to generate. (default = 2).</pre> * * <pre> -S <seed> * Set the random seed to be used by K-means. (default = 1).</pre> * * <pre> -R <ridge> * Set the ridge value for the logistic or linear regression.</pre> * * <pre> -M <number> * Set the maximum number of iterations for the logistic regression. (default -1, until convergence).</pre> * * <pre> -W <number> * Set the minimum standard deviation for the clusters. (default 0.1).</pre> * <!-- options-end --> * * @param options the list of options as an array of strings * @throws Exception if an option is not supported */ public void setOptions(String[] options) throws Exception { setDebug(Utils.getFlag('D', options)); String ridgeString = Utils.getOption('R', options); if (ridgeString.length() != 0) { m_ridge = Double.parseDouble(ridgeString); } else { m_ridge = 1.0e-8; } String maxItsString = Utils.getOption('M', options); if (maxItsString.length() != 0) { m_maxIts = Integer.parseInt(maxItsString); } else { m_maxIts = -1; } String numClustersString = Utils.getOption('B', options); if (numClustersString.length() != 0) { setNumClusters(Integer.parseInt(numClustersString)); } String seedString = Utils.getOption('S', options); if (seedString.length() != 0) { setClusteringSeed(Integer.parseInt(seedString)); } String stdString = Utils.getOption('W', options); if (stdString.length() != 0) { setMinStdDev(Double.parseDouble(stdString)); } Utils.checkForRemainingOptions(options); } /** * Gets the current settings of the classifier. * * @return an array of strings suitable for passing to setOptions */ public String [] getOptions() { String [] options = new String [10]; int current = 0; options[current++] = "-B"; options[current++] = "" + m_numClusters; options[current++] = "-S"; options[current++] = "" + m_clusteringSeed; options[current++] = "-R"; options[current++] = ""+m_ridge; options[current++] = "-M"; options[current++] = ""+m_maxIts; options[current++] = "-W"; options[current++] = ""+m_minStdDev; while (current < options.length) options[current++] = ""; return options; } /** * Main method for testing this class. * * @param argv should contain the command line arguments to the * scheme (see Evaluation) */ public static void main(String [] argv) { runClassifier(new RBFNetwork(), argv); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -