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

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

?? kkconditionalestimator.java

?? 數據挖掘estimators算法
?? JAVA
字號:
/* *    This program is free software; you can redistribute it and/or modify *    it under the terms of the GNU General Public License as published by *    the Free Software Foundation; either version 2 of the License, or *    (at your option) any later version. * *    This program 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 General Public License *    along with this program; if not, write to the Free Software *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *//* *    KKConditionalEstimator.java *    Copyright (C) 1999 Len Trigg * */package weka.estimators;import java.util.*;import weka.core.*;/**  * Conditional probability estimator for a numeric domain conditional upon * a numeric domain. * * @author Len Trigg (trigg@cs.waikato.ac.nz) * @version $Revision: 1.4 $ */public class KKConditionalEstimator implements ConditionalEstimator {  /** Vector containing all of the values seen */  private double [] m_Values;  /** Vector containing all of the conditioning values seen */  private double [] m_CondValues;  /** Vector containing the associated weights */  private double [] m_Weights;  /**   * Number of values stored in m_Weights, m_CondValues, and m_Values so far   */  private int m_NumValues;  /** The sum of the weights so far */  private double m_SumOfWeights;  /** Current standard dev */  private double m_StandardDev;  /** Whether we can optimise the kernel summation */  private boolean m_AllWeightsOne;  /** The numeric precision */  private double m_Precision;  /**   * Execute a binary search to locate the nearest data value   *   * @param key the data value to locate   * @param secondaryKey the data value to locate   * @return the index of the nearest data value   */  private int findNearestPair(double key, double secondaryKey) {    int low = 0;     int high = m_NumValues;    int middle = 0;    while (low < high) {      middle = (low + high) / 2;      double current = m_CondValues[middle];      if (current == key) {	double secondary = m_Values[middle];	if (secondary == secondaryKey) {	  return middle;	}	if (secondary > secondaryKey) {	  high = middle;	} else if (secondary < secondaryKey) {	  low = middle+1;	}      }      if (current > key) {	high = middle;      } else if (current < key) {	low = middle+1;      }    }    return low;  }  /**   * Round a data value using the defined precision for this estimator   *   * @param data the value to round   * @return the rounded data value   */  private double round(double data) {    return Math.rint(data / m_Precision) * m_Precision;  }    /**   * Constructor   *   * @param precision the  precision to which numeric values are given. For   * example, if the precision is stated to be 0.1, the values in the   * interval (0.25,0.35] are all treated as 0.3.    */  public KKConditionalEstimator(double precision) {    m_CondValues = new double [50];    m_Values = new double [50];    m_Weights = new double [50];    m_NumValues = 0;    m_SumOfWeights = 0;    m_StandardDev = 0;    m_AllWeightsOne = true;    m_Precision = precision;  }  /**   * Add a new data value to the current estimator.   *   * @param data the new data value    * @param given the new value that data is conditional upon    * @param weight the weight assigned to the data value    */  public void addValue(double data, double given, double weight) {    data = round(data);    given = round(given);    int insertIndex = findNearestPair(given, data);    if ((m_NumValues <= insertIndex)	|| (m_CondValues[insertIndex] != given)	|| (m_Values[insertIndex] != data)) {      if (m_NumValues < m_Values.length) {	int left = m_NumValues - insertIndex; 	System.arraycopy(m_Values, insertIndex, 			 m_Values, insertIndex + 1, left);	System.arraycopy(m_CondValues, insertIndex, 			 m_CondValues, insertIndex + 1, left);	System.arraycopy(m_Weights, insertIndex, 			 m_Weights, insertIndex + 1, left);	m_Values[insertIndex] = data;	m_CondValues[insertIndex] = given;	m_Weights[insertIndex] = weight;	m_NumValues++;      } else {	double [] newValues = new double [m_Values.length*2];	double [] newCondValues = new double [m_Values.length*2];	double [] newWeights = new double [m_Values.length*2];	int left = m_NumValues - insertIndex; 	System.arraycopy(m_Values, 0, newValues, 0, insertIndex);	System.arraycopy(m_CondValues, 0, newCondValues, 0, insertIndex);	System.arraycopy(m_Weights, 0, newWeights, 0, insertIndex);	newValues[insertIndex] = data;	newCondValues[insertIndex] = given;	newWeights[insertIndex] = weight;	System.arraycopy(m_Values, insertIndex, 			 newValues, insertIndex+1, left);	System.arraycopy(m_CondValues, insertIndex, 			 newCondValues, insertIndex+1, left);	System.arraycopy(m_Weights, insertIndex, 			 newWeights, insertIndex+1, left);	m_NumValues++;	m_Values = newValues;	m_CondValues = newCondValues;	m_Weights = newWeights;      }      if (weight != 1) {	m_AllWeightsOne = false;      }    } else {      m_Weights[insertIndex] += weight;      m_AllWeightsOne = false;          }    m_SumOfWeights += weight;    double range = m_CondValues[m_NumValues-1] - m_CondValues[0];    m_StandardDev = Math.max(range / Math.sqrt(m_SumOfWeights), 			     // allow at most 3 sds within one interval			     m_Precision / (2 * 3));  }  /**   * Get a probability estimator for a value   *   * @param data the value to estimate the probability of   * @param given the new value that data is conditional upon    * @return the estimator for the supplied value given the condition   */  public Estimator getEstimator(double given) {    Estimator result = new KernelEstimator(m_Precision);    if (m_NumValues == 0) {      return result;    }    double delta = 0, currentProb = 0;    double zLower, zUpper;    for(int i = 0; i < m_NumValues; i++) {      delta = m_CondValues[i] - given;      zLower = (delta - (m_Precision / 2)) / m_StandardDev;      zUpper = (delta + (m_Precision / 2)) / m_StandardDev;      currentProb = (Statistics.normalProbability(zUpper)		     - Statistics.normalProbability(zLower));      result.addValue(m_Values[i], currentProb * m_Weights[i]);    }    return result;  }  /**   * Get a probability estimate for a value   *   * @param data the value to estimate the probability of   * @param given the new value that data is conditional upon    * @return the estimated probability of the supplied value   */  public double getProbability(double data, double given) {    return getEstimator(given).getProbability(data);  }  /**   * Display a representation of this estimator   */  public String toString() {    String result = "KK Conditional Estimator. "       + m_NumValues + " Normal Kernels:\n"      + "StandardDev = " + Utils.doubleToString(m_StandardDev,4,2)       + "  \nMeans =";    for(int i = 0; i < m_NumValues; i++) {      result += " (" + m_Values[i] + ", " + m_CondValues[i] + ")";      if (!m_AllWeightsOne) {	  result += "w=" + m_Weights[i];      }    }    return result;  }  /**   * Main method for testing this class. Creates some random points   * in the range 0 - 100,    * and prints out a distribution conditional on some value   *   * @param argv should contain: seed conditional_value numpoints   */  public static void main(String [] argv) {    try {      int seed = 42;      if (argv.length > 0) {	seed = Integer.parseInt(argv[0]);      }      KKConditionalEstimator newEst = new KKConditionalEstimator(0.1);      // Create 100 random points and add them      Random r = new Random(seed);            int numPoints = 50;      if (argv.length > 2) {	numPoints = Integer.parseInt(argv[2]);      }      for(int i = 0; i < numPoints; i++) {	int x = Math.abs(r.nextInt()%100);	int y = Math.abs(r.nextInt()%100);	System.out.println("# " + x + "  " + y);	newEst.addValue(x, y, 1);      }      //    System.out.println(newEst);      int cond;      if (argv.length > 1) {	cond = Integer.parseInt(argv[1]);      } else {	cond = Math.abs(r.nextInt()%100);      }      System.out.println("## Conditional = " + cond);      Estimator result = newEst.getEstimator(cond);      for(int i = 0; i <= 100; i+= 5) {	System.out.println(" " + i + "  " + result.getProbability(i));      }    } catch (Exception e) {      System.out.println(e.getMessage());    }  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线免费视频一区二区| www.色精品| 天堂蜜桃一区二区三区| 亚洲精品国产视频| 一卡二卡欧美日韩| 日韩高清国产一区在线| 欧美a一区二区| 国内外成人在线| 国产成人精品三级| 成人av在线资源网| 欧美日韩免费在线视频| 欧美一级一区二区| 国产婷婷色一区二区三区四区| 成人黄色国产精品网站大全在线免费观看| 午夜免费久久看| 另类小说一区二区三区| 国产精品一区2区| 91麻豆自制传媒国产之光| 欧美自拍丝袜亚洲| 日韩三级视频在线观看| 国产日韩精品一区二区三区在线| 欧美刺激脚交jootjob| 日本一区二区视频在线| 亚洲激情综合网| 九九精品视频在线看| 成人国产电影网| 欧美日韩视频不卡| 国产欧美日韩另类一区| 亚洲sss视频在线视频| 国产精品911| 日韩欧美激情在线| 国产精品盗摄一区二区三区| 五月婷婷欧美视频| 成人av高清在线| 欧美一区二区三区系列电影| 国产精品毛片高清在线完整版 | 亚洲一区二区三区爽爽爽爽爽| 一片黄亚洲嫩模| 国内精品久久久久影院一蜜桃| 国产美女av一区二区三区| 波多野结衣91| 日韩一区二区在线观看视频| 国产精品国产三级国产aⅴ原创| 亚洲精品国产第一综合99久久| 日韩av中文在线观看| 色综合久久中文综合久久97 | 欧美午夜理伦三级在线观看| 久久免费电影网| 午夜激情一区二区三区| 91在线观看污| 一级女性全黄久久生活片免费| 美女一区二区视频| 日本高清不卡视频| 国产精品第一页第二页第三页| 视频一区二区三区在线| 在线观看成人免费视频| 日韩理论在线观看| 成人在线视频首页| 久久人人爽爽爽人久久久| 日本亚洲一区二区| 欧美日本在线播放| 亚洲一级不卡视频| 欧美日本一区二区在线观看| 一区二区三区在线视频免费| 91蜜桃在线观看| 亚洲另类春色校园小说| 成人激情免费电影网址| 国产精品萝li| 成人av在线播放网址| ㊣最新国产の精品bt伙计久久| 国产呦精品一区二区三区网站| 欧美艳星brazzers| 三级精品在线观看| 日韩精品在线一区二区| 91在线小视频| 日韩理论片一区二区| 北条麻妃国产九九精品视频| 国产精品久久夜| 91在线国内视频| 一区二区三区日韩精品视频| 在线日韩一区二区| 丝袜美腿一区二区三区| 欧美一区二区三区在线看| 美女mm1313爽爽久久久蜜臀| wwwwww.欧美系列| 成人激情开心网| 亚洲高清一区二区三区| 欧美巨大另类极品videosbest | 韩国理伦片一区二区三区在线播放| 欧美日韩国产成人在线91| 日韩vs国产vs欧美| 久久久影视传媒| av在线一区二区| 亚洲一区二区三区中文字幕| 日韩欧美精品三级| 丁香网亚洲国际| 亚洲综合丝袜美腿| 精品久久五月天| 91网址在线看| 美女脱光内衣内裤视频久久网站 | 国产精品乱人伦| 91亚洲国产成人精品一区二三| 国产精品美女久久久久aⅴ| 91国产免费观看| 极品少妇xxxx精品少妇偷拍| 亚洲欧美综合网| 欧美老女人第四色| 成人国产亚洲欧美成人综合网| 亚洲天天做日日做天天谢日日欢| 欧美色综合网站| 狠狠色丁香久久婷婷综合丁香| 丝袜亚洲另类欧美综合| 久久久一区二区三区捆绑**| 欧洲亚洲国产日韩| 国产成人免费网站| 免费视频最近日韩| 亚洲另类中文字| 久久久精品欧美丰满| 欧美日韩一级二级三级| 成人av在线电影| 伦理电影国产精品| 亚洲成av人**亚洲成av**| 国产精品网站导航| 精品久久久网站| 欧美天天综合网| 99国产精品久久久久久久久久久| 视频精品一区二区| 亚洲精品美腿丝袜| 国产精品久久夜| 久久久久国产精品麻豆| 日韩三级中文字幕| 欧美日韩一区二区电影| 91麻豆免费观看| 成人黄页在线观看| 粉嫩高潮美女一区二区三区| 麻豆国产精品官网| 丝袜美腿亚洲一区| 婷婷国产在线综合| 亚洲成人tv网| 亚洲大片免费看| 亚洲综合区在线| 亚洲欧美日韩小说| 亚洲精品国产高清久久伦理二区| 久久久久久免费| 欧美xxxxx牲另类人与| 欧美一区二区三区小说| 91精品国产入口| 日韩一区二区免费电影| 日韩写真欧美这视频| 欧美一个色资源| 欧美一二三在线| 久久亚洲精品小早川怜子| 久久奇米777| 国产精品乱码妇女bbbb| 国产精品久久久久久妇女6080| 婷婷国产v国产偷v亚洲高清| 午夜视频在线观看一区二区三区| 一区二区三区精品视频| 亚洲制服丝袜在线| 亚洲大尺度视频在线观看| 日韩精品国产欧美| 裸体一区二区三区| 国产一区在线精品| 99麻豆久久久国产精品免费优播| 国产99久久久国产精品| gogo大胆日本视频一区| 色综合天天综合| 在线精品视频一区二区三四| 91麻豆精品91久久久久同性| 欧美一级高清大全免费观看| 337p粉嫩大胆噜噜噜噜噜91av | 国产精品国产三级国产a| 亚洲日本中文字幕区| 亚洲一级不卡视频| 琪琪一区二区三区| 国产高清不卡二三区| 欧洲中文字幕精品| 日韩一卡二卡三卡国产欧美| 国产午夜精品美女毛片视频| 中文字幕中文乱码欧美一区二区| 一区在线播放视频| 日韩电影在线看| 丰满少妇在线播放bd日韩电影| 成人精品国产福利| 国产精品电影一区二区| 午夜精品一区在线观看| 国产在线国偷精品产拍免费yy| 高清日韩电视剧大全免费| 91国偷自产一区二区开放时间| 欧美精品一级二级| 中文字幕av一区二区三区| 亚洲va在线va天堂| 成人精品高清在线| 日韩欧美国产一区二区三区| 亚洲色图欧美偷拍| 国产在线日韩欧美| 欧美卡1卡2卡| 一区二区三区四区高清精品免费观看 | 日韩视频在线观看一区二区| 久久久国产精品不卡|