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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? naivebayesind.java

?? Naive Bayes算法java代碼
?? JAVA
字號:
package nb;import shared.*;import shared.Error;import java.lang.*;
import java.io.*;
public class NaiveBayesInd extends Inducer {
  public String endl = new String("/n");
public final String LAPLACE_HELP =
  "Use the L'aplace correction for frequency counts " +
  "in probability estimates.";
public final String M_FACTOR_HELP =
  "Used in laplace correction only; denotes the amount of noise " +
  "expected in the conditional probability correction.";
public final String UNKNOWN_IS_VALUE_HELP =
  "When this option is true, unknowns will be treated as full-fledged " +
  "values.  When this option is false, unknowns will be treated as missing " +
  "information.  When this option is auto, the algorithm will attempt to " +
  "automatically determine how to treat unknowns.";
public final String KL_THREHSOLD_HELP =
  "This option determines the threshold value of kl-distance for " +
  "an unknown to be treated as a full value in auto mode.";
public final String USE_EVIDENCE_PROJECTION_HELP =
  "This option allows selection of the evidence projection algorithm " +
  "to correct probabilities during categorization.";
public final String EVIDENCE_FACTOR_HELP =
  "This option allows scaling of the total weight of input instances " +
  "for the purposes of computing total evidence available during " +
  "evidence projection.";
   // Member data   /** Stores the categorizer this Inducer will train. */   private NaiveBayesCat categorizer;
  /** set whether to use laplace correction.     */   private boolean useLaplace;  /** noise in laplace correction.    */  private double mEstimateFactor;  private double klThreshold;
  private double noMatchesFactor;
  private boolean useEvidenceProjection;
  private double evidenceFactor;   

  //How to handle the Enums
  //private UnknownIsValueEnum unknownIsValue;  /* the value for unknownNo in the enum. */  public static final int unknownNo = 1;
  /* the value for unknownYes in the enum. */  public static final int unknownYes = 2;
  /* the value for unknownAuto in the enum. */  public static final int unknownAuto = 3;
  /** used to produce the effect of enums in C++. */  private int unknownIsValue; // 1, 2, 3.
  /** returns the Id of this inducer    */  public int class_id() {return NAIVE_BAYES_INDUCER;}  /** Constructor with description String.    * @param description - the description of this inducer.    */  public NaiveBayesInd(String description) {
    super(description);
    categorizer = null;
    useLaplace = NaiveBayesCat.defaultLaplaceCorrection;
    mEstimateFactor = NaiveBayesCat.defaultMEstimateFactor;
    unknownIsValue = NaiveBayesCat.defaultUnknownIsValue;
    klThreshold = NaiveBayesCat.defaultKLThreshold;
    noMatchesFactor = NaiveBayesCat.defaultNoMatchesFactor;
    useEvidenceProjection = NaiveBayesCat.defaultUseEvidenceProjection;
    evidenceFactor = NaiveBayesCat.defaultEvidenceFactor;
  }  /** Copy constructor    * @param source - the Inducer to copy.    */  public NaiveBayesInd(NaiveBayesInd source) {    super(source);    categorizer = null;    useLaplace = source.useLaplace;    mEstimateFactor = source.mEstimateFactor;    klThreshold = source.klThreshold;    noMatchesFactor = source.noMatchesFactor;    unknownIsValue = source.unknownIsValue;    useEvidenceProjection = source.useEvidenceProjection;    evidenceFactor = source.evidenceFactor;  }  /** Tests to see if this inducer was properly trained by    * checking for a categorizer. Return TRUE iff the class    * has a valid categorizer.    * @param fatal_on_false - a value which tells the system a    *         fatal error has occurred if this method should return    *         false.    */  public boolean was_trained(boolean fatal_on_false) {   if( fatal_on_false && categorizer == null ) {      Error.err("NaiveBayesInd.was_trained(): No categorizer, " +	 "Call train() to create categorizer");   }   return ( categorizer != null );  }  /** Returns the categorizer that the inducer has generated.    * @return the categorizer trained by this inducer.    */  public Categorizer get_categorizer() {    if (was_trained(true)) {      return categorizer;    }    else {      return null;    }  }  /** Gives ownership of the generated categorizer to the    * caller, reverting the Inducer to untrained state.    * @return the categorizer trained by this inducer.    */  public Categorizer release_categorizer() {    if (was_trained(true)) {      Categorizer retCat = categorizer;      categorizer = null;      return retCat;    }    else {      return null;    }  }  /** Method no available at this time.    * Sets the options from environment variables.    * @param preFix - a String prefix to be added to all the options.    */  public void set_user_options(String preFix) {
/*    boolean laplaceOption = get_option_bool(preFix + "LAPLACE_CORRECTION",
				useLaplace,
				LAPLACE_HELP, true);
    set_use_laplace(laplaceOption);
    if (laplaceOption) {
      set_m_estimate_factor(get_option_real(preFix + "M_ESTIMATE_FACTOR",
					    mEstimateFactor,
					    M_FACTOR_HELP, true));
    }

    // set noMatchesFactor option
    noMatchesFactor = 
      get_option_real(preFix + "NO_MATCHES_FACTOR", noMatchesFactor,
		     "", true);

    // set unknown is value option
    unknownIsValue =
      get_option_enum(preFix + "UNKNOWN_IS_VALUE", unknownIsValueMEnum,
		     unknownIsValue, UNKNOWN_IS_VALUE_HELP, true);
    if(unknownIsValue == unknownAuto)
      klThreshold = get_option_real(preFix + "KL_THRESHOLD",
				    klThreshold, KL_THREHSOLD_HELP, true);

    // set evidence projection option.  Always suppress Laplace and
    // no matches factor if this is activated
    boolean projOption = get_option_bool(preFix + "EVIDENCE_PROJECTION",
				     useEvidenceProjection,
				     USE_EVIDENCE_PROJECTION_HELP, true);
    if(projOption) {
      evidenceFactor = get_option_real(preFix + "EVIDENCE_FACTOR",
				       evidenceFactor,
				       EVIDENCE_FACTOR_HELP, true);
    }    useEvidenceProjection = projOption;
*/
  }  /** Trains Naive Bayes Categorizer.  Descrete attributes can    * be handled by simply passing occurance counts in the    * BagCounter.  Continuous attributes are fed into    * StatDatas to get mean, variance, and standard deviation.    *    * It is possible that some label is not in the training set, or    * it has unknown for a continous attribute.  In this case,    * statData::size() = 0, and the loop below will not write    * any data into the NBNorm structure.  Since the NBNorm    * structure is initialized to HasData = FALSE, doing nothing    * will correctly indicate that there is no data.    */  public void train() {
//?    has_data();
//?    DBG(OK());
    categorizer = new NaiveBayesCat( this.description(), TS);
    categorizer.set_log_level(get_log_level());
    categorizer.set_use_laplace(useLaplace);
    categorizer.set_m_estimate_factor(mEstimateFactor);
    categorizer.set_unknown_is_value(unknownIsValue);
    categorizer.set_kl_threshold(klThreshold);
    categorizer.set_no_matches_factor(noMatchesFactor);
    categorizer.set_use_evidence_projection(useEvidenceProjection);
    categorizer.set_evidence_factor(evidenceFactor);
  }  /** Prints a readable representation of the Cat to the    * given stream.    * @param stream - the stream to print to.    * @param dp - the display preferences.    */  public void display(BufferedWriter stream, DisplayPref dp) throws IOException {    display_struct(stream, dp);    if (dp.preference_type() != DisplayPref.ASCIIDisplay) {      Error.fatalErr("NaiveBayesInd.display_struct: Only ASCIIDisplay is " +                    "valid for this display_struct");    }    stream.write("NaiveBayes Inducer " + description() + endl);    if ( was_trained(false) ) {      stream.write("Current Categorizer " + endl);      get_categorizer().display_struct(stream, dp);    }    }  /* Returns the pointer to the copy of this.   */  public Inducer copy() {    Inducer ind = new NaiveBayesInd(this);    return ind;  }  /** set whether to use L'aplace correction.    * @param laplace - if true use laplace correction.    *                  if false don't use laplace.    */  public void set_use_laplace(boolean laplace) {    useLaplace = laplace;  }  /** set m value for L'aplace correction.    * @param m - the value to set the m estimate factor.    */  public void set_m_estimate_factor(double m) {    if (m < 0) {      Error.fatalErr("NaiveBayesInd.set_m_estimate_factor() : illegal m_estimate_" +	  "factor value : " + m);    }    else {      mEstimateFactor = m;    }  }  /** gets the value for the use laplace option.    * @return true if laplace is on; false if off.    */  public boolean get_use_laplace() {    return categorizer.get_use_laplace();  }  /** gets the value for the m estimate factor used in the    * categorizer.    * @return the value for the factor.    */  public double get_m_estimate_factor() {    return categorizer.get_m_estimate_factor();  }  /** get the value for the use evidence projection used in the    * categorizer.    * @return true if use evidence projection is on; false otherwise.    */  public boolean get_use_evidence_projection() {    return categorizer.get_use_evidence_projection();  }  /** sets the value for use evidence projection. The effect is not    * perpetuated to the categorizer until train is called.    * @param projection - true turns the evidence projection on; false    *                     turns if off.    */  public void set_use_evidence_projection(boolean projection) {    useEvidenceProjection = projection;  }   /** This method returns 0 because NaiveBayes is not a tree inducer.    * There is no tree for which to count nodes.    * @return 0;    */  public int num_nontrivial_nodes() {    return 0;  }  /** This method returns 0 because NaiveBayes is not a tree inducer.    * There is not tree for which to count leaves    * @return 0    */  public int num_nontrivial_leaves() {    return 0;  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕精品—区二区四季| 91麻豆精品国产91久久久久| 久久中文字幕电影| 久久99国产精品麻豆| 亚洲精品在线观看网站| 九九视频精品免费| 久久午夜电影网| www.亚洲国产| 一级女性全黄久久生活片免费| 欧美艳星brazzers| 日韩国产欧美在线观看| 日韩一区二区三区四区五区六区| 精品一区二区av| 国产精品不卡视频| 欧美性猛交一区二区三区精品| 亚洲成人福利片| 337p日本欧洲亚洲大胆精品| 成人国产亚洲欧美成人综合网 | 国产成人免费视| 亚洲国产成人在线| 国产精品久久久久久久浪潮网站| 91浏览器在线视频| 男男成人高潮片免费网站| 久久精品这里都是精品| 91猫先生在线| 久久精品99国产国产精| 亚洲国产精品精华液ab| 欧美影视一区在线| 国产一区欧美日韩| 亚洲永久免费视频| 久久久久久电影| 欧美在线一区二区| 国产激情一区二区三区| 亚洲乱码中文字幕| 亚洲精品一区二区精华| 欧洲一区二区三区在线| 国产曰批免费观看久久久| 亚洲乱码国产乱码精品精可以看| 91精品国产综合久久久久久久 | 日日摸夜夜添夜夜添精品视频| 欧美成人video| 91麻豆免费看片| 免费成人深夜小野草| 亚洲精品视频在线观看网站| 日韩三级在线免费观看| 91久久精品一区二区三| 国产a级毛片一区| 首页国产欧美久久| 亚洲美女视频在线| 国产精品网友自拍| 精品国产乱码久久久久久免费| 在线看不卡av| www.欧美精品一二区| 精品制服美女久久| 三级精品在线观看| 亚洲最新视频在线播放| 国产精品色一区二区三区| 亚洲一区二区精品3399| 国产精品久线在线观看| 久久久久久麻豆| 欧美成人vr18sexvr| 51午夜精品国产| 欧美色偷偷大香| 在线免费观看日本一区| av一区二区三区黑人| 国产成人小视频| 韩国成人精品a∨在线观看| 视频一区国产视频| 亚洲成人动漫在线免费观看| 亚洲三级电影网站| 中文字幕一区二区5566日韩| 久久久亚洲高清| 337p粉嫩大胆噜噜噜噜噜91av| 欧美一级搡bbbb搡bbbb| 欧美一区二区啪啪| 欧美日韩夫妻久久| 欧美二区三区的天堂| 欧美另类z0zxhd电影| 欧美亚洲禁片免费| 欧美人与z0zoxxxx视频| 欧美三级欧美一级| 777久久久精品| 欧美一区二区三区在| 欧美一区二区三级| 日韩免费看的电影| 精品99一区二区三区| 精品国产一区二区三区av性色| 日韩一区二区免费在线电影| 欧美一区二区三区系列电影| 日韩三级在线免费观看| 久久在线免费观看| 欧美国产乱子伦| 亚洲欧美日韩系列| 亚洲图片自拍偷拍| 蜜臀国产一区二区三区在线播放| 六月丁香综合在线视频| 国产成人综合自拍| 99精品欧美一区二区三区小说 | 麻豆一区二区三| 狠狠久久亚洲欧美| www.欧美精品一二区| 91精彩视频在线| 日韩欧美视频一区| 国产日韩av一区| 一区二区三区久久久| 天天色图综合网| 国产麻豆视频一区| 色噜噜狠狠成人中文综合| 91.com视频| 中文字幕不卡在线观看| 亚洲精品成人精品456| 丝袜美腿亚洲一区| 粉嫩在线一区二区三区视频| 在线视频你懂得一区二区三区| 欧美久久一区二区| 国产无人区一区二区三区| 亚洲精品中文字幕在线观看| 日本欧美韩国一区三区| 波多野结衣中文字幕一区| 欧美精品粉嫩高潮一区二区| 国产欧美综合色| 亚洲成人动漫精品| 成人性生交大片免费| 欧美乱妇一区二区三区不卡视频| 久久久久久影视| 亚洲a一区二区| 成人综合婷婷国产精品久久免费| 欧美天堂一区二区三区| 国产亚洲欧洲一区高清在线观看| 亚洲综合小说图片| 国产99久久久国产精品潘金网站| 欧美日韩高清在线播放| 亚洲国产成人一区二区三区| 日本不卡视频在线观看| 色综合天天综合色综合av| 精品噜噜噜噜久久久久久久久试看| 国产精品美女久久久久aⅴ国产馆| 日本在线观看不卡视频| 中文字幕免费一区| 蜜臀久久久久久久| 在线亚洲+欧美+日本专区| 国产欧美一区二区三区在线老狼| 石原莉奈在线亚洲二区| 色一情一伦一子一伦一区| 久久久久久久久久久久电影 | 欧美日韩国产一级片| 国产精品久久一级| 国内成人自拍视频| 欧美乱妇15p| 亚洲电影视频在线| 日本精品视频一区二区| 中文字幕亚洲区| 国产福利一区二区| 久久日一线二线三线suv| 丝瓜av网站精品一区二区| 色婷婷综合久久久中文一区二区| 日本一区二区高清| 国产suv精品一区二区6| 精品久久一区二区三区| 日韩va欧美va亚洲va久久| 欧美色综合天天久久综合精品| 亚洲欧洲综合另类在线| a级精品国产片在线观看| 中文字幕va一区二区三区| 国产精华液一区二区三区| 国产亚洲欧美在线| 国产成人精品三级| 欧美国产视频在线| 成熟亚洲日本毛茸茸凸凹| 国产日韩欧美不卡在线| 国产盗摄视频一区二区三区| 久久久精品免费观看| 国产精品一线二线三线精华| 久久久久综合网| 夫妻av一区二区| 亚洲欧洲精品天堂一级| 色妹子一区二区| 亚洲一区二区视频在线观看| 欧美日韩久久久久久| 日韩影院在线观看| 欧美videos中文字幕| 国产乱码一区二区三区| 国产精品欧美久久久久一区二区| av网站一区二区三区| 一区二区久久久久久| 欧美猛男男办公室激情| 精品午夜一区二区三区在线观看| 久久网这里都是精品| aaa国产一区| 亚洲高清在线精品| 精品国产制服丝袜高跟| 国产成人亚洲综合色影视| 中文字幕在线观看不卡| 欧美丝袜丝nylons| 毛片一区二区三区| 中文欧美字幕免费| 一本久久a久久免费精品不卡| 五月天亚洲精品| 久久久久99精品国产片| 色悠悠久久综合|