亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? cls.java

?? 一個數(shù)據(jù)挖掘系統(tǒng)的源碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:

/**
 *   
 *   AgentAcademy - an open source Data Mining framework for
 *   training intelligent agents
 *
 *   Copyright (C)   2001-2003 AA Consortium.
 *
 *   This library is open source software; you can redistribute it 
 *   and/or modify it under the terms of the GNU Lesser General 
 *   Public License as published by the Free Software Foundation;   
 *   either version 2.0 of the License, or (at your option) any later 
 *   version.
 *
 *   This library is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU Lesser General Public
 *   License along with this library; if not, write to the Free 
 *   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
 *   MA  02111-1307 USA
 * 
 */

package org.agentacademy.modules.dataminer.classifiers;

/**
 * <p>Title: The Data Miner prototype</p>
 * <p>Description: A prototype for the DataMiner (DM), the Agent Academy (AA) module responsible for performing data mining on the contents of the Agent Use Repository (AUR). The extracted knowledge is to be sent back to the AUR in the form of a PMML document.</p>
 * <p>Copyright: Copyright (c) 2002</p>
 * <p>Company: CERTH</p>
 * @author asymeon
 * @version 0.3
 */

import java.util.Enumeration;
import java.util.Vector;

import org.agentacademy.modules.dataminer.classifiers.evaluation.DistributionClassifier;
import org.agentacademy.modules.dataminer.core.AdditionalMeasureProducer;
import org.agentacademy.modules.dataminer.core.Drawable;
import org.agentacademy.modules.dataminer.core.Instance;
import org.agentacademy.modules.dataminer.core.Instances;
import org.agentacademy.modules.dataminer.core.Matchable;
import org.agentacademy.modules.dataminer.core.Option;
import org.agentacademy.modules.dataminer.core.OptionHandler;
import org.agentacademy.modules.dataminer.core.Summarizable;
import org.agentacademy.modules.dataminer.core.Utils;
import org.agentacademy.modules.dataminer.core.WeightedInstancesHandler;


/**
 * Class for generating an unpruned or a pruned CLS decision tree.
 *
 * Valid options are: <p>
 *
 * -U <br>
 * Use unpruned tree.<p>
 *
 * -C confidence <br>
 * Set confidence threshold for pruning. (Default: 0.25) <p>
 *
 * -M number <br>
 * Set minimum number of instances per leaf. (Default: 2) <p>
 *
 * -B <br>
 * Use binary splits for nominal attributes. <p>
 *
 * -S <br>
 * Don't perform subtree raising. <p>
 *
 * -L <br>
 * Do not clean up after the tree has been built. <p>
 *
 * -A <br>
 * If set, Laplace smoothing is used for predicted probabilites. <p>
 *
 */

public class CLS extends DistributionClassifier implements OptionHandler,
  Drawable, Matchable, Sourcable, WeightedInstancesHandler, Summarizable,
  AdditionalMeasureProducer {

  // To maintain the same version number after adding m_ClassAttribute
  static final long serialVersionUID = -217733168393644444L;

  /** The decision tree */
  private ClassifierTree m_root;

  /** Unpruned tree? */
  private boolean m_unpruned = false;

  /** Confidence level */
  private float m_CF = 0.25f;

  /** Minimum number of instances */
  private int m_minNumObj = 2;

  /** Determines whether probabilities are smoothed using
      Laplace correction when predictions are generated */
  private boolean m_useLaplace = false;

  /** Use reduced error pruning? */
  private boolean m_reducedErrorPruning = false;

  /** Number of folds for reduced error pruning. */
  private int m_numFolds = 3;

  /** Binary splits on nominal attributes? */
  private boolean m_binarySplits = false;

  /** Subtree raising to be performed? */
  private boolean m_subtreeRaising = true;

  /** Cleanup after the tree has been built. */
  boolean m_noCleanup = false;

  /**
   * Generates the classifier.
   *
   * @exception Exception if classifier can't be built successfully
   */
  public void buildClassifier(Instances instances)
       throws Exception{

    ModelSelection modSelection;

    if (m_binarySplits)
      modSelection = new BinC45ModelSelection(m_minNumObj, instances);
    else
      modSelection = new C45ModelSelection(m_minNumObj, instances);
    if (!m_reducedErrorPruning)
      m_root = new C45PruneableClassifierTree(modSelection, !m_unpruned, m_CF,
					    m_subtreeRaising, !m_noCleanup);
    else
      m_root = new PruneableClassifierTree0(modSelection, !m_unpruned, m_numFolds,
					   !m_noCleanup);
    m_root.buildClassifier(instances);
    if (m_binarySplits) {
      ((BinC45ModelSelection)modSelection).cleanup();
    } else {
      ((C45ModelSelection)modSelection).cleanup();
    }
  }

  /**
   * Classifies an instance.
   *
   * @exception Exception if instance can't be classified successfully
   */
  public double classifyInstance(Instance instance) throws Exception {

    return m_root.classifyInstance(instance);
  }

  /**
   * Returns class probabilities for an instance.
   *
   * @exception Exception if distribution can't be computed successfully
   */
  public final double [] distributionForInstance(Instance instance)
       throws Exception {

    return m_root.distributionForInstance(instance, m_useLaplace);
  }

  /**
   * Returns graph describing the tree.
   *
   * @exception Exception if graph can't be computed
   */
  public String graph() throws Exception {

    return m_root.graph();
  }

  /**
   * Returns tree in prefix order.
   *
   * @exception Exception if something goes wrong
   */
  public String prefix() throws Exception {

    return m_root.prefix();
  }


  /**
   * Returns tree as an if-then statement.
   *
   * @return the tree as a Java if-then type statement
   * @exception Exception if something goes wrong
   */
  public String toSource(String className) throws Exception {

    StringBuffer [] source = m_root.toSource(className);
    return
    "class " + className + " {\n\n"
    +"  public static double classify(Object [] i)\n"
    +"    throws Exception {\n\n"
    +"    double p = Double.NaN;\n"
    + source[0]  // Assignment code
    +"    return p;\n"
    +"  }\n"
    + source[1]  // Support code
    +"}\n";
  }

  /**
   * Returns an enumeration describing the available options.
   *
   * Valid options are: <p>
   *
   * -U <br>
   * Use unpruned tree.<p>
   *
   * -C confidence <br>
   * Set confidence threshold for pruning. (Default: 0.25) <p>
   *
   * -M number <br>
   * Set minimum number of instances per leaf. (Default: 2) <p>
   *
   * -B <br>
   * Use binary splits for nominal attributes. <p>
   *
   * -S <br>
   * Don't perform subtree raising. <p>
   *
   * -L <br>
   * Do not clean up after the tree has been built.
   *
   * -A <br>
   * If set, Laplace smoothing is used for predicted probabilites. <p>
   *
   * @return an enumeration of all the available options.
   */
  public Enumeration listOptions() {

    Vector newVector = new Vector(9);

    newVector.
	addElement(new Option("\tUse unpruned tree.",
			      "U", 0, "-U"));
    newVector.
	addElement(new Option("\tSet confidence threshold for pruning.\n" +
			      "\t(default 0.25)",
			      "C", 1, "-C <pruning confidence>"));
    newVector.
	addElement(new Option("\tSet minimum number of instances per leaf.\n" +
			      "\t(default 2)",
			      "M", 1, "-M <minimum number of instances>"));
    newVector.
	addElement(new Option("\tUse binary splits only.",
			      "B", 0, "-B"));
    newVector.
        addElement(new Option("\tDon't perform subtree raising.",
			      "S", 0, "-S"));
    newVector.
        addElement(new Option("\tDo not clean up after the tree has been built.",
			      "L", 0, "-L"));
   newVector.
        addElement(new Option("\tLaplace smoothing for predicted probabilities.",
			      "A", 0, "-A"));

    return newVector.elements();
  }

  /**
   * Parses a given list of options.
   *
   * @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{

    // Other options
    String minNumString = Utils.getOption('M', options);
    if (minNumString.length() != 0) {
      m_minNumObj = Integer.parseInt(minNumString);
    } else {
      m_minNumObj = 2;
    }
    m_binarySplits = Utils.getFlag('B', options);
    m_useLaplace = Utils.getFlag('A', options);

    // Pruning options
    m_unpruned = Utils.getFlag('U', options);
    m_subtreeRaising = !Utils.getFlag('S', options);
    m_noCleanup = Utils.getFlag('L', options);
    if ((m_unpruned) && (!m_subtreeRaising)) {
      throw new Exception("Subtree raising doesn't need to be unset for unpruned tree!");
    }
    m_reducedErrorPruning = Utils.getFlag('R', options);
    if ((m_unpruned) && (m_reducedErrorPruning)) {
      throw new Exception("Unpruned tree and reduced error pruning can't be selected " +
			  "simultaneously!");
    }
    String confidenceString = Utils.getOption('C', options);
    if (confidenceString.length() != 0) {
      if (m_reducedErrorPruning) {
	throw new Exception("Setting the confidence doesn't make sense " +
			    "for reduced error pruning.");
      } else if (m_unpruned) {
	throw new Exception("Doesn't make sense to change confidence for unpruned "
			    +"tree!");
      } else {
	m_CF = (new Float(confidenceString)).floatValue();
	if ((m_CF <= 0) || (m_CF >= 1)) {
	  throw new Exception("Confidence has to be greater than zero and smaller " +
			      "than one!");
	}
      }
    } else {
      m_CF = 0.25f;
    }
    String numFoldsString = Utils.getOption('N', options);
    if (numFoldsString.length() != 0) {
      if (!m_reducedErrorPruning) {
	throw new Exception("Setting the number of folds" +
			    " doesn't make sense if" +
			    " reduced error pruning is not selected.");
      } else {
	m_numFolds = Integer.parseInt(numFoldsString);
      }
    } else {
      m_numFolds = 3;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品理论在线观看| 欧美一区二区啪啪| 中文字幕一区不卡| 99re成人精品视频| 一区二区三区日本| 欧美视频自拍偷拍| 秋霞午夜av一区二区三区| 日韩一级高清毛片| 风间由美一区二区三区在线观看 | 蜜桃久久久久久| 欧美xxxxx牲另类人与| 国产综合成人久久大片91| 久久久蜜桃精品| 99久久综合国产精品| 伊人色综合久久天天人手人婷| 欧美日韩黄视频| 国产一区二区三区四区五区美女| 国产精品美女久久久久aⅴ国产馆| 99久久亚洲一区二区三区青草| 亚洲精品久久久蜜桃| 日韩一区二区三区四区五区六区 | 久久久精品免费免费| av综合在线播放| 亚洲国产中文字幕在线视频综合| 91麻豆精品国产自产在线| 麻豆精品久久久| 中文一区在线播放| 欧美体内she精高潮| 激情伊人五月天久久综合| 综合电影一区二区三区 | 色狠狠色狠狠综合| 另类的小说在线视频另类成人小视频在线| 久久久噜噜噜久久人人看 | 日本欧美肥老太交大片| 久久人人超碰精品| 欧美四级电影网| 国产jizzjizz一区二区| 偷窥少妇高潮呻吟av久久免费| 久久人人97超碰com| 欧美性大战久久| 成人精品小蝌蚪| 免费xxxx性欧美18vr| 亚洲欧美国产高清| 久久精品欧美日韩| 在线观看91精品国产麻豆| 国产成人av电影在线观看| 性做久久久久久久免费看| 国产精品久久久久婷婷| 精品国产乱码久久久久久图片| 欧美唯美清纯偷拍| 色综合视频一区二区三区高清| 精品一二三四在线| 亚洲国产wwwccc36天堂| 日韩一区日韩二区| 精品国产一区久久| 欧美日韩一区二区三区不卡| 99这里只有精品| 国产精品1024| 精品无码三级在线观看视频| 日韩在线观看一区二区| 亚洲免费在线看| 亚洲欧洲性图库| 国产三级久久久| 久久久久久久综合日本| 日韩一区二区三区免费观看| 欧美三级一区二区| 欧美做爰猛烈大尺度电影无法无天| 国产91露脸合集magnet| 国产呦萝稀缺另类资源| 久久国产夜色精品鲁鲁99| 日韩**一区毛片| 日韩精品色哟哟| 日韩成人av影视| 日韩经典中文字幕一区| 婷婷夜色潮精品综合在线| 亚洲福利一区二区三区| 亚洲一区二区在线观看视频| 亚洲免费高清视频在线| 玉米视频成人免费看| 一区二区三区中文字幕电影| 亚洲激情在线播放| 亚洲在线中文字幕| 午夜精品福利视频网站| 日韩av高清在线观看| 精品一二三四在线| 国产精品1区二区.| 成人精品在线视频观看| 91亚洲精品久久久蜜桃| 在线视频观看一区| 3d成人h动漫网站入口| 日韩精品一区二区在线观看| 久久综合狠狠综合| 中文字幕免费不卡| 亚洲精品美国一| 天天综合日日夜夜精品| 久久aⅴ国产欧美74aaa| 国产成人午夜片在线观看高清观看| 丁香亚洲综合激情啪啪综合| 97精品电影院| 欧美猛男超大videosgay| 欧美一区二区三区视频在线| 2023国产精品| 亚洲色图视频免费播放| 亚洲成人综合视频| 美女一区二区视频| 成人性生交大片免费| 日本韩国一区二区| 日韩视频一区二区在线观看| 国产欧美综合色| 亚洲欧美成人一区二区三区| 五月婷婷色综合| 国产精品影视在线| 在线观看区一区二| 精品久久五月天| 自拍偷拍国产精品| 日韩av不卡一区二区| 福利电影一区二区| 7777精品伊人久久久大香线蕉经典版下载 | 国产精品午夜在线观看| 亚洲午夜久久久久久久久久久| 蜜桃视频一区二区| 99久久综合99久久综合网站| 欧美一级黄色片| 亚洲美女免费视频| 国产一区二区三区在线观看免费 | 久久久久久久av麻豆果冻| 亚洲色图20p| 久久99久久久欧美国产| 99国产精品久| 精品99一区二区三区| 亚洲最大成人综合| 国产成人av电影在线| 欧美一激情一区二区三区| 亚洲欧美一区二区久久| 国产乱码精品1区2区3区| 在线一区二区观看| 国产精品污污网站在线观看| 日韩av成人高清| 91福利资源站| 欧美高清在线精品一区| 麻豆免费看一区二区三区| 91一区二区三区在线播放| 久久免费美女视频| 日韩vs国产vs欧美| 欧美性生活大片视频| 中文字幕在线一区免费| 国产乱码精品一品二品| 91精品国产91热久久久做人人 | 亚洲愉拍自拍另类高清精品| 国产91精品精华液一区二区三区| 欧美浪妇xxxx高跟鞋交| 亚洲综合免费观看高清完整版| 国产v日产∨综合v精品视频| 久久一区二区三区四区| 日本不卡的三区四区五区| 欧洲精品中文字幕| 亚洲欧美成人一区二区三区| 国产·精品毛片| 久久九九国产精品| 国产精品原创巨作av| 欧美一级二级三级乱码| 蜜臀av一区二区三区| 日韩午夜在线影院| 免费成人结看片| 精品国产免费久久 | 亚洲午夜精品久久久久久久久| 色综合久久综合网97色综合| 亚洲国产精品黑人久久久| 国产成人综合在线| 国产精品色一区二区三区| 国产精品主播直播| 国产精品情趣视频| 99精品国产91久久久久久| 亚洲欧洲一区二区三区| 色婷婷av一区二区三区大白胸| 最新国产の精品合集bt伙计| 91极品视觉盛宴| 亚洲h精品动漫在线观看| 国产三区在线成人av| 成人午夜激情视频| 国产精品成人一区二区艾草| 99久久精品免费观看| 亚洲欧美国产高清| 欧美日高清视频| 久久精品久久精品| 久久久精品tv| 91日韩一区二区三区| 亚洲午夜三级在线| 日韩欧美一区二区在线视频| 国产一区在线视频| 综合中文字幕亚洲| 91精品在线麻豆| 国产成人一区在线| 一区二区不卡在线播放| 制服丝袜亚洲色图| 国产成人免费在线视频| 中文字幕一区av| 欧美久久久久免费| 国产传媒欧美日韩成人| 亚洲精品日产精品乱码不卡|