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

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

?? chisqmixture.java

?? 一個(gè)小型的數(shù)據(jù)挖掘器應(yīng)用軟件,綜合數(shù)據(jù)挖掘的各種功能
?? JAVA
字號(hào):
/* *    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.  *//* *    ChisqMixture.java *    Copyright (C) 2002 Yong Wang * */package weka.classifiers.functions.pace;import weka.core.matrix.DoubleVector;import weka.core.matrix.Maths;import java.util.Random;/** * Class for manipulating chi-square mixture distributions. <p/> * * For more information see: <p/> *  <!-- technical-plaintext-start --> * Wang, Y (2000). A new approach to fitting linear models in high dimensional spaces. Hamilton, New Zealand.<br/> * <br/> * Wang, Y., Witten, I. H.: Modeling for optimal probability prediction. In: Proceedings of the Nineteenth International Conference in Machine Learning, Sydney, Australia, 650-657, 2002. <!-- technical-plaintext-end --> *  <!-- technical-bibtex-start --> * BibTeX: * <pre> * &#64;phdthesis{Wang2000, *    address = {Hamilton, New Zealand}, *    author = {Wang, Y}, *    school = {Department of Computer Science, University of Waikato}, *    title = {A new approach to fitting linear models in high dimensional spaces}, *    year = {2000} * } *  * &#64;inproceedings{Wang2002, *    address = {Sydney, Australia}, *    author = {Wang, Y. and Witten, I. H.}, *    booktitle = {Proceedings of the Nineteenth International Conference in Machine Learning}, *    pages = {650-657}, *    title = {Modeling for optimal probability prediction}, *    year = {2002} * } * </pre> * <p/> <!-- technical-bibtex-end --> * * @author Yong Wang (yongwang@cs.waikato.ac.nz) * @version $Revision: 1.3 $ */public class ChisqMixture   extends MixtureDistribution {    /** the separating threshold value */  protected double separatingThreshold = 0.05;   /** the triming thresholding */  protected double trimingThreshold = 0.5;  protected double supportThreshold = 0.5;  protected int maxNumSupportPoints = 200; // for computational reason  protected int fittingIntervalLength = 3;      protected double fittingIntervalThreshold = 0.5;  /** Contructs an empty ChisqMixture   */  public ChisqMixture() {}  /**    * Gets the separating threshold value. This value is used by the method   * separatable   *    * @return the separating threshold   */  public double getSeparatingThreshold() {    return separatingThreshold;  }    /**   * Sets the separating threshold value    *    * @param t the threshold value    */  public void setSeparatingThreshold( double t ) {    separatingThreshold = t;  }  /**    * Gets the triming thresholding value. This value is usef by the method trim.   *    * @return the triming threshold   */  public double getTrimingThreshold() {    return trimingThreshold;  }  /**    * Sets the triming thresholding value.   *    * @param t the triming threshold   */  public void setTrimingThreshold( double t ){    trimingThreshold = t;  }  /**    *  Return true if a value can be considered for mixture estimation   *  separately from the data indexed between i0 and i1    *     *  @param data the data supposedly generated from the mixture    *  @param i0 the index of the first element in the group   *  @param i1 the index of the last element in the group   *  @param x the value   *  @return true if the value can be considered   */  public boolean separable( DoubleVector data, int i0, int i1, double x ) {    DoubleVector dataSqrt = data.sqrt();    double xh = Math.sqrt( x );    NormalMixture m = new NormalMixture();    m.setSeparatingThreshold( separatingThreshold );    return m.separable( dataSqrt, i0, i1, xh );  }  /**    *  Contructs the set of support points for mixture estimation.   *     *  @param data the data supposedly generated from the mixture    *  @param ne the number of extra data that are suppposedly discarded   *  earlier and not passed into here   *  @return the set of support points   */  public DoubleVector  supportPoints( DoubleVector data, int ne ) {    DoubleVector sp = new DoubleVector();    sp.setCapacity( data.size() + 1 );    if( data.get(0) < supportThreshold || ne != 0 )       sp.addElement( 0 );    for( int i = 0; i < data.size(); i++ )       if( data.get( i ) > supportThreshold ) 	sp.addElement( data.get(i) );	    // The following will be fixed later???    if( sp.size() > maxNumSupportPoints )       throw new IllegalArgumentException( "Too many support points. " );    return sp;  }      /**    *  Contructs the set of fitting intervals for mixture estimation.   *     *  @param data the data supposedly generated from the mixture    *  @return the set of fitting intervals   */  public PaceMatrix  fittingIntervals( DoubleVector data ) {    PaceMatrix a = new PaceMatrix( data.size() * 2, 2 );    DoubleVector v = data.sqrt();    int count = 0;    double left, right;    for( int i = 0; i < data.size(); i++ ) {      left = v.get(i) - fittingIntervalLength;       if( left < fittingIntervalThreshold ) left = 0;      left = left * left;      right = data.get(i);      if( right < fittingIntervalThreshold ) 	right = fittingIntervalThreshold;      a.set( count, 0, left );      a.set( count, 1, right );      count++;    }    for( int i = 0; i < data.size(); i++ ) {      left = data.get(i);      if( left < fittingIntervalThreshold ) left = 0;      right = v.get(i) + fittingIntervalThreshold;      right = right * right;      a.set( count, 0, left );      a.set( count, 1, right );      count++;    }    a.setRowDimension( count );	    return a;  }      /**    *  Contructs the probability matrix for mixture estimation, given a set   *  of support points and a set of intervals.   *     *  @param s  the set of support points   *  @param intervals the intervals   *  @return the probability matrix   */  public PaceMatrix  probabilityMatrix(DoubleVector s, PaceMatrix intervals) {        int ns = s.size();    int nr = intervals.getRowDimension();    PaceMatrix p = new PaceMatrix(nr, ns);	    for( int i = 0; i < nr; i++ ) {      for( int j = 0; j < ns; j++ ) {	p.set( i, j,	       Maths.pchisq( intervals.get(i, 1), s.get(j) ) - 	       Maths.pchisq( intervals.get(i, 0), s.get(j) ) );      }    }	    return p;  }      /**    *  Returns the pace6 estimate of a single value.   *     *  @param x the value   *  @return the pace6 estimate   */  public double  pace6 ( double x ) {         if( x > 100 ) return x; // pratical consideration. will modify later    DoubleVector points = mixingDistribution.getPointValues();    DoubleVector values = mixingDistribution.getFunctionValues();     DoubleVector mean = points.sqrt();	    DoubleVector d = Maths.dchisqLog( x, points );    d.minusEquals( d.max() );    d = d.map("java.lang.Math", "exp").timesEquals( values );    double atilde = mean.innerProduct( d ) / d.sum();    return atilde * atilde;  }  /**    *  Returns the pace6 estimate of a vector.   *     *  @param x the vector   *  @return the pace6 estimate   */  public DoubleVector pace6( DoubleVector x ) {    DoubleVector pred = new DoubleVector( x.size() );    for(int i = 0; i < x.size(); i++ )       pred.set(i, pace6(x.get(i)) );    trim( pred );    return pred;  }  /**    *  Returns the pace2 estimate of a vector.   *     *  @param x the vector   *  @return the pace2 estimate   */  public DoubleVector  pace2( DoubleVector x ) {        DoubleVector chf = new DoubleVector( x.size() );    for(int i = 0; i < x.size(); i++ ) chf.set( i, hf( x.get(i) ) );    chf.cumulateInPlace();    int index = chf.indexOfMax();    DoubleVector copy = x.copy();    if( index < x.size()-1 ) copy.set( index + 1, x.size()-1, 0 );    trim( copy );    return copy;  }  /**    *  Returns the pace4 estimate of a vector.   *     *  @param x the vector   *  @return the pace4 estimate   */  public DoubleVector  pace4( DoubleVector x ) {        DoubleVector h = h( x );    DoubleVector copy = x.copy();    for( int i = 0; i < x.size(); i++ )      if( h.get(i) <= 0 ) copy.set(i, 0);    trim( copy );    return copy;  }  /**    * Trims the small values of the estaimte   *    * @param x the estimate vector   */  public void trim( DoubleVector x ) {        for(int i = 0; i < x.size(); i++ ) {      if( x.get(i) <= trimingThreshold ) x.set(i, 0);    }  }      /**   *  Computes the value of h(x) / f(x) given the mixture. The   *  implementation avoided overflow.   *     *  @param AHat the value   *  @return the value of h(x) / f(x)   */  public double hf( double AHat ) {        DoubleVector points = mixingDistribution.getPointValues();    DoubleVector values = mixingDistribution.getFunctionValues();     double x = Math.sqrt( AHat );    DoubleVector mean = points.sqrt();    DoubleVector d1 = Maths.dnormLog( x, mean, 1 );    double d1max = d1.max();    d1.minusEquals( d1max );    DoubleVector d2 = Maths.dnormLog( -x, mean, 1 );    d2.minusEquals( d1max );    d1 = d1.map("java.lang.Math", "exp");    d1.timesEquals( values );      d2 = d2.map("java.lang.Math", "exp");    d2.timesEquals( values );      return ( ( points.minus(x/2)).innerProduct( d1 ) - 	     ( points.plus(x/2)).innerProduct( d2 ) )     / (d1.sum() + d2.sum());  }      /**   *  Computes the value of h(x) given the mixture.   *     *  @param AHat the value   *  @return the value of h(x)   */  public double h( double AHat ) {        if( AHat == 0.0 ) return 0.0;    DoubleVector points = mixingDistribution.getPointValues();    DoubleVector values = mixingDistribution.getFunctionValues();	    double aHat = Math.sqrt( AHat );    DoubleVector aStar = points.sqrt();    DoubleVector d1 = Maths.dnorm( aHat, aStar, 1 ).timesEquals( values );    DoubleVector d2 = Maths.dnorm( -aHat, aStar, 1 ).timesEquals( values );    return points.minus(aHat/2).innerProduct( d1 ) -            points.plus(aHat/2).innerProduct( d2 );  }      /**   *  Computes the value of h(x) given the mixture, where x is a vector.   *     *  @param AHat the vector   *  @return the value of h(x)   */  public DoubleVector h( DoubleVector AHat ) {        DoubleVector h = new DoubleVector( AHat.size() );    for( int i = 0; i < AHat.size(); i++ )       h.set( i, h( AHat.get(i) ) );    return h;  }      /**   *  Computes the value of f(x) given the mixture.   *     *  @param x the value   *  @return the value of f(x)   */  public double f( double x ) {        DoubleVector points = mixingDistribution.getPointValues();    DoubleVector values = mixingDistribution.getFunctionValues();     return Maths.dchisq(x, points).timesEquals(values).sum();    }      /**   *  Computes the value of f(x) given the mixture, where x is a vector.   *     *  @param x the vector   *  @return the value of f(x)   */  public DoubleVector f( DoubleVector x ) {        DoubleVector f = new DoubleVector( x.size() );    for( int i = 0; i < x.size(); i++ )       f.set( i, h( f.get(i) ) );    return f;  }      /**    * Converts to a string   *    * @return a string representation   */  public String  toString() {    return mixingDistribution.toString();  }      /**    * Method to test this class    *    * @param args the commandline arguments   */  public static void  main(String args[]) {        int n1 = 50;    int n2 = 50;    double ncp1 = 0;    double ncp2 = 10;     double mu1 = Math.sqrt( ncp1 );    double mu2 = Math.sqrt( ncp2 );    DoubleVector a = Maths.rnorm( n1, mu1, 1, new Random() );    a = a.cat( Maths.rnorm(n2, mu2, 1, new Random()) );    DoubleVector aNormal = a;    a = a.square();    a.sort();	    DoubleVector means = (new DoubleVector( n1, mu1 )).cat(new DoubleVector(n2, mu2));	    System.out.println("==========================================================");    System.out.println("This is to test the estimation of the mixing\n" +		       "distribution of the mixture of non-central Chi-square\n" + 		       "distributions. The example mixture used is of the form: \n\n" + 		       "   0.5 * Chi^2_1(ncp1) + 0.5 * Chi^2_1(ncp2)\n" );    System.out.println("It also tests the PACE estimators. Quadratic losses of the\n" +		       "estimators are given, measuring their performance.");    System.out.println("==========================================================");    System.out.println( "ncp1 = " + ncp1 + " ncp2 = " + ncp2 +"\n" );    System.out.println( a.size() + " observations are: \n\n" + a );    System.out.println( "\nQuadratic loss of the raw data (i.e., the MLE) = " + 			aNormal.sum2( means ) );    System.out.println("==========================================================");	    // find the mixing distribution    ChisqMixture d = new ChisqMixture();    d.fit( a, NNMMethod );     System.out.println( "The estimated mixing distribution is\n" + d );  	    DoubleVector pred = d.pace2( a.rev() ).rev();    System.out.println( "\nThe PACE2 Estimate = \n" + pred );    System.out.println( "Quadratic loss = " + 			pred.sqrt().times(aNormal.sign()).sum2( means ) );        pred = d.pace4( a );    System.out.println( "\nThe PACE4 Estimate = \n" + pred );    System.out.println( "Quadratic loss = " + 			pred.sqrt().times(aNormal.sign()).sum2( means ) );    pred = d.pace6( a );    System.out.println( "\nThe PACE6 Estimate = \n" + pred );    System.out.println( "Quadratic loss = " + 			pred.sqrt().times(aNormal.sign()).sum2( means ) );  }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品黑人性xxxx| 老司机精品视频线观看86 | 蓝色福利精品导航| 精品一区二区三区免费观看 | 久久久午夜精品| 中文字幕一区二区三区视频| 亚洲美女精品一区| 视频精品一区二区| 国产乱淫av一区二区三区| av成人免费在线观看| 欧美综合亚洲图片综合区| 宅男噜噜噜66一区二区66| 久久综合久久综合久久| 亚洲视频香蕉人妖| 日本免费新一区视频| 国产成人在线影院| 91福利在线免费观看| 日韩亚洲欧美成人一区| 国产精品久久久久久久岛一牛影视| 亚洲第一久久影院| 国精产品一区一区三区mba视频| 99国产精品久久久久久久久久久 | 免费精品视频最新在线| 国产精品538一区二区在线| 色8久久精品久久久久久蜜| 精品日韩欧美一区二区| 亚洲乱码一区二区三区在线观看| 免费不卡在线观看| 色综合久久久久久久久久久| 欧美变态凌虐bdsm| 一级特黄大欧美久久久| 国内精品视频一区二区三区八戒| 色天使色偷偷av一区二区| www国产成人| 亚洲h动漫在线| 不卡av免费在线观看| 欧美一区二区三区免费视频 | 在线免费不卡电影| 久久女同互慰一区二区三区| 午夜精品免费在线| 成人av网站在线| 欧美成人官网二区| 亚洲电影一区二区| bt7086福利一区国产| 欧美精品一区二区三区在线播放| 亚洲一区影音先锋| 成人妖精视频yjsp地址| 日韩欧美亚洲国产另类| 亚洲国产精品久久久男人的天堂 | 亚洲精品日韩一| 国产不卡一区视频| 欧美成人三级电影在线| 亚洲成人免费视频| 色综合色综合色综合色综合色综合 | 亚洲精品一区二区三区影院| 午夜精品免费在线观看| 92精品国产成人观看免费 | www.66久久| 国产清纯美女被跳蛋高潮一区二区久久w | 极品少妇一区二区三区精品视频 | 色综合久久中文综合久久97| 国产日韩欧美精品在线| 久久se精品一区精品二区| 欧美日韩aaa| 亚洲国产精品精华液网站| 99精品欧美一区二区三区综合在线| 国产婷婷色一区二区三区在线| 国内国产精品久久| 日韩限制级电影在线观看| 日韩精品国产精品| 欧美日本一区二区| 亚洲国产日日夜夜| 欧美性猛交一区二区三区精品| 亚洲免费色视频| 色诱视频网站一区| 亚洲色图在线视频| 91影视在线播放| 国产精品电影院| 色综合天天综合在线视频| 综合av第一页| 色悠久久久久综合欧美99| 亚洲丝袜另类动漫二区| 色伊人久久综合中文字幕| 一区二区三区在线免费播放| 欧美亚洲日本国产| 亚洲成人资源在线| 欧美另类z0zxhd电影| 男女男精品网站| 精品三级av在线| 国产精品一区在线| 国产精品乱码人人做人人爱| 99精品视频免费在线观看| 一区二区三区在线免费观看| 欧美精品高清视频| 精品一区二区三区在线播放视频| 国产夜色精品一区二区av| 成人午夜免费电影| ●精品国产综合乱码久久久久| 欧美主播一区二区三区| 午夜a成v人精品| 日韩午夜激情av| 国产盗摄精品一区二区三区在线| 国产精品污www在线观看| 99久久精品情趣| 亚洲国产成人va在线观看天堂| 日韩一卡二卡三卡四卡| 国产精品99久久久久久有的能看| 亚洲欧洲国产日本综合| 精品视频1区2区| 经典三级视频一区| 国产精品日日摸夜夜摸av| 91福利视频久久久久| 久久精品av麻豆的观看方式| 欧美激情综合在线| 在线免费观看日本一区| 久久国产精品99久久久久久老狼 | 成人高清视频免费观看| 亚洲精品国产成人久久av盗摄| 欧美日韩一区精品| 国模一区二区三区白浆| 综合久久国产九一剧情麻豆| 欧美猛男gaygay网站| 狠狠色狠狠色综合系列| 综合久久综合久久| 欧美一区二区三区人| av一区二区三区四区| 午夜久久久久久| 亚洲国产电影在线观看| 欧美日韩精品一区二区| 国产精品一区二区久激情瑜伽 | 欧美日本国产视频| 国产精品系列在线播放| 亚洲图片欧美一区| 国产偷国产偷亚洲高清人白洁| 欧美日韩国产不卡| 国产成人免费视频网站| 亚洲第一在线综合网站| 欧美国产日韩亚洲一区| 欧美理论片在线| caoporn国产一区二区| 久久激情综合网| 一区二区欧美在线观看| 久久夜色精品国产欧美乱极品| 欧美性xxxxxx少妇| 成人性生交大片免费看视频在线 | 精品国产在天天线2019| 色94色欧美sute亚洲13| 国产不卡在线播放| 麻豆中文一区二区| 亚洲综合自拍偷拍| 国产欧美日韩麻豆91| 91精品欧美福利在线观看| 成人av先锋影音| 国产精品一区二区无线| 日本在线不卡一区| 亚洲卡通欧美制服中文| 欧美激情资源网| 精品少妇一区二区三区视频免付费 | 2014亚洲片线观看视频免费| 欧美人与性动xxxx| 91国内精品野花午夜精品| jvid福利写真一区二区三区| 国产精品自在欧美一区| 男女激情视频一区| 天天做天天摸天天爽国产一区| 亚洲欧美在线高清| 久久久影院官网| 日韩亚洲欧美高清| 欧美美女bb生活片| 日本乱人伦一区| 国产一二三精品| 久久超级碰视频| 青青草国产精品亚洲专区无| 亚洲午夜精品在线| 亚洲蜜臀av乱码久久精品| 国产精品传媒在线| 国产精品色哟哟网站| 久久久久久久网| 精品国产乱码久久| 日韩欧美的一区二区| 91精品国产综合久久福利软件 | 五月婷婷久久综合| 亚洲永久精品大片| 亚洲精品欧美在线| 一个色在线综合| 一区二区欧美在线观看| 亚洲综合在线免费观看| 一区二区三区不卡视频| 一区二区高清在线| 亚洲综合免费观看高清完整版| 亚洲精品久久7777| 亚洲在线成人精品| 天天综合色天天综合| 香蕉成人伊视频在线观看| 亚洲福利电影网| 三级欧美在线一区| 久久精品久久精品| 国产一区激情在线| 国产成人综合在线观看| 成人激情黄色小说|