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

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

?? smoreg.java

?? Weka
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/* *    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. *//* *    SMOreg.java *    Copyright (C) 2002 Sylvain Roy * */package weka.classifiers.functions;import weka.classifiers.Classifier;import weka.classifiers.functions.supportVector.Kernel;import weka.classifiers.functions.supportVector.PolyKernel;import weka.classifiers.functions.supportVector.SMOset;import weka.core.Capabilities;import weka.core.Instance;import weka.core.Instances;import weka.core.Option;import weka.core.OptionHandler;import weka.core.SelectedTag;import weka.core.Tag;import weka.core.TechnicalInformation;import weka.core.TechnicalInformationHandler;import weka.core.Utils;import weka.core.WeightedInstancesHandler;import weka.core.Capabilities.Capability;import weka.core.TechnicalInformation.Field;import weka.core.TechnicalInformation.Type;import weka.filters.Filter;import weka.filters.unsupervised.attribute.NominalToBinary;import weka.filters.unsupervised.attribute.Normalize;import weka.filters.unsupervised.attribute.ReplaceMissingValues;import weka.filters.unsupervised.attribute.Standardize;import java.util.Enumeration;import java.util.Vector;/** <!-- globalinfo-start --> * Implements Alex Smola and Bernhard Scholkopf's sequential minimal optimization algorithm for training a support vector regression model. This implementation globally replaces all missing values and transforms nominal attributes into binary ones. It also normalizes all attributes by default. (Note that the coefficients in the output are based on the normalized/standardized data, not the original data.)<br/> * <br/> * For more information on the SMO algorithm, see<br/> * <br/> * Alex J. Smola, Bernhard Schoelkopf: A Tutorial on Support Vector Regression. In NeuroCOLT2 Technical Report Series, 1998.<br/> * <br/> * S.K. Shevade, S.S. Keerthi, C. Bhattacharyya, K.R.K. Murthy (1999). Improvements to SMO Algorithm for SVM Regression. Control Division Dept of Mechanical and Production Engineering, National University of Singapore. * <p/> <!-- globalinfo-end --> * <!-- technical-bibtex-start --> * BibTeX: * <pre> * &#64;incollection{Smola1998, *    author = {Alex J. Smola and Bernhard Schoelkopf}, *    booktitle = {NeuroCOLT2 Technical Report Series}, *    note = {NC2-TR-1998-030}, *    title = {A Tutorial on Support Vector Regression}, *    year = {1998} * } *  * &#64;techreport{Shevade1999, *    address = {Control Division Dept of Mechanical and Production Engineering, National University of Singapore}, *    author = {S.K. Shevade and S.S. Keerthi and C. Bhattacharyya and K.R.K. Murthy}, *    institution = {National University of Singapore}, *    note = {Technical Report CD-99-16}, *    title = {Improvements to SMO Algorithm for SVM Regression}, *    year = {1999} * } * </pre> * <p/> <!-- technical-bibtex-end --> * <!-- options-start --> * Valid options are: <p/> *  * <pre> -D *  If set, classifier is run in debug mode and *  may output additional info to the console</pre> *  * <pre> -no-checks *  Turns off all checks - use with caution! *  Turning them off assumes that data is purely numeric, doesn't *  contain any missing values, and has a nominal class. Turning them *  off also means that no header information will be stored if the *  machine is linear. Finally, it also assumes that no instance has *  a weight equal to 0. *  (default: checks on)</pre> *  * <pre> -S &lt;double&gt; *  The amount up to which deviations are *  tolerated (epsilon). (default 1e-3)</pre> *  * <pre> -C &lt;double&gt; *  The complexity constant C. (default 1)</pre> *  * <pre> -N *  Whether to 0=normalize/1=standardize/2=neither. (default 0=normalize)</pre> *  * <pre> -T &lt;double&gt; *  The tolerance parameter. (default 1.0e-3)</pre> *  * <pre> -P &lt;double&gt; *  The epsilon for round-off error. (default 1.0e-12)</pre> *  * <pre> -K &lt;classname and parameters&gt; *  The Kernel to use. *  (default: weka.classifiers.functions.supportVector.PolyKernel)</pre> *  * <pre>  * Options specific to kernel weka.classifiers.functions.supportVector.PolyKernel: * </pre> *  * <pre> -D *  Enables debugging output (if available) to be printed. *  (default: off)</pre> *  * <pre> -no-checks *  Turns off all checks - use with caution! *  (default: checks on)</pre> *  * <pre> -C &lt;num&gt; *  The size of the cache (a prime number), 0 for full cache and  *  -1 to turn it off. *  (default: 250007)</pre> *  * <pre> -E &lt;num&gt; *  The Exponent to use. *  (default: 1.0)</pre> *  * <pre> -L *  Use lower-order terms. *  (default: no)</pre> *  <!-- options-end --> * * @author Sylvain Roy (sro33@student.canterbury.ac.nz) * @version $Revision: 1.13 $ */public class SMOreg   extends Classifier   implements OptionHandler, WeightedInstancesHandler, TechnicalInformationHandler {  /** for serialization */  static final long serialVersionUID = 5783729368717679645L;      /** Kernel to use **/  protected Kernel m_kernel = new PolyKernel();  /** The class index from the training data */  protected int m_classIndex = -1;  /** The filter used to make attributes numeric. */  protected NominalToBinary m_NominalToBinary;  /** normalize data */  public static final int FILTER_NORMALIZE = 0;  /** standardize data */  public static final int FILTER_STANDARDIZE = 1;  /** no filtering */  public static final int FILTER_NONE = 2;  /** The filter to apply to the training data */  public static final Tag [] TAGS_FILTER = {    new Tag(FILTER_NORMALIZE, "Normalize training data"),    new Tag(FILTER_STANDARDIZE, "Standardize training data"),    new Tag(FILTER_NONE, "No normalization/standardization"),  };      /** The filter used to standardize/normalize all values. */  protected Filter m_Filter = null;      /** Whether to normalize/standardize/neither */  protected int m_filterType = FILTER_NORMALIZE;  /** The filter used to get rid of missing values. */  protected ReplaceMissingValues m_Missing;      /** Turn off all checks and conversions? Turning them off assumes      that data is purely numeric, doesn't contain any missing values,      and has a numeric class. Turning them off also means that      no header information will be stored if the machine is linear.       Finally, it also assumes that no instance has a weight equal to 0.*/  protected boolean m_checksTurnedOff = false;      /** The training data. */  protected Instances m_data;      /** The complexity parameter */  protected double m_C = 1.0;  /** The Lagrange multipliers */  protected double[] m_alpha;  protected double[] m_alpha_;  /** The thresholds. */  protected double m_b, m_bLow, m_bUp;  /** The indices for m_bLow and m_bUp */  protected int m_iLow, m_iUp;  /** Weight vector for linear machine. */  protected double[] m_weights;  /** The current set of errors for all non-bound examples. */  protected double[] m_fcache;  /* The four different sets used by the algorithm. */  /** {i: 0 < m_alpha[i] < C || 0 < m_alpha_[i] < C} */  protected SMOset m_I0;   /** {i: m_class[i] = 0, m_alpha_[i] = 0} */  protected SMOset m_I1;   /** {i: m_class[i] = 0, m_alpha_[i] = C} */  protected SMOset m_I2;   /** {i: m_class[i] = C, m_alpha_[i] = 0} */  protected SMOset m_I3;   /** The parameter epsilon */  protected double m_epsilon = 1e-3;  /** The parameter tol */  protected double m_tol = 1.0e-3;  /** The parameter eps */  protected double m_eps = 1.0e-12;  /** Precision constant for updating sets */  protected static double m_Del = 1e-10;      /** The parameters of the linear transforamtion realized    * by the filter on the class attribute */  protected double m_Alin;  protected double m_Blin;  /** Variables to hold weight vector in sparse form.      (To reduce storage requirements.) */  protected double[] m_sparseWeights;  protected int[] m_sparseIndices;    /** whether the kernel is a linear one */  protected boolean m_KernelIsLinear = false;  /**   * Returns a string describing classifier   * @return a description suitable for   * displaying in the explorer/experimenter gui   */  public String globalInfo() {    return  "Implements Alex Smola and Bernhard Scholkopf's sequential minimal "      + "optimization algorithm for training a support vector regression model. "      + "This implementation globally replaces all missing values and "      + "transforms nominal attributes into binary ones. It also "      + "normalizes all attributes by default. (Note that the coefficients "      + "in the output are based on the normalized/standardized data, not the "      + "original data.)\n\n"      + "For more information on the SMO algorithm, see\n\n"      + getTechnicalInformation().toString();  }  /**   * Returns an instance of a TechnicalInformation object, containing    * detailed information about the technical background of this class,   * e.g., paper reference or book this class is based on.   *    * @return the technical information about this class   */  public TechnicalInformation getTechnicalInformation() {    TechnicalInformation 	result;    TechnicalInformation 	additional;        result = new TechnicalInformation(Type.INCOLLECTION);    result.setValue(Field.AUTHOR, "Alex J. Smola and Bernhard Schoelkopf");    result.setValue(Field.YEAR, "1998");    result.setValue(Field.TITLE, "A Tutorial on Support Vector Regression");    result.setValue(Field.BOOKTITLE, "NeuroCOLT2 Technical Report Series");    result.setValue(Field.NOTE, "NC2-TR-1998-030");        additional = result.add(Type.TECHREPORT);    additional.setValue(Field.AUTHOR, "S.K. Shevade and S.S. Keerthi and C. Bhattacharyya and K.R.K. Murthy");    additional.setValue(Field.YEAR, "1999");    additional.setValue(Field.TITLE, "Improvements to SMO Algorithm for SVM Regression");    additional.setValue(Field.INSTITUTION, "National University of Singapore");    additional.setValue(Field.ADDRESS, "Control Division Dept of Mechanical and Production Engineering, National University of Singapore");    additional.setValue(Field.NOTE, "Technical Report CD-99-16");        return result;  }  /**   * Returns default capabilities of the classifier.   *   * @return      the capabilities of this classifier   */  public Capabilities getCapabilities() {    Capabilities result = getKernel().getCapabilities();    result.setOwner(this);    // attribute    result.enableAllAttributeDependencies();    // with NominalToBinary we can also handle nominal attributes, but only    // if the kernel can handle numeric attributes    if (result.handles(Capability.NUMERIC_ATTRIBUTES))      result.enable(Capability.NOMINAL_ATTRIBUTES);    result.enable(Capability.MISSING_VALUES);        // class    result.disableAllClasses();    result.disableAllClassDependencies();    result.enable(Capability.NUMERIC_CLASS);    result.enable(Capability.DATE_CLASS);    result.enable(Capability.MISSING_CLASS_VALUES);        return result;  }  /**   * Method for building the classifier.    *   * @param insts the set of training instances   * @throws Exception if the classifier can't be built successfully   */  public void buildClassifier(Instances insts) throws Exception {    /* check the set of training instances */    if (!m_checksTurnedOff) {      // can classifier handle the data?      getCapabilities().testWithFail(insts);      // remove instances with missing class      insts = new Instances(insts);      insts.deleteWithMissingClass();	      /* Removes all the instances with weight equal to 0.       MUST be done since condition (6) of Shevade's paper        is made with the assertion Ci > 0 (See equation (1a). */      Instances data = new Instances(insts, insts.numInstances());      for(int i = 0; i < insts.numInstances(); i++){        if(insts.instance(i).weight() > 0)          data.add(insts.instance(i));      }      if (data.numInstances() == 0) {        throw new Exception("No training instances left after removing " +         "instances with weight 0!");      }      insts = data;    }    if (!m_checksTurnedOff) {      m_Missing = new ReplaceMissingValues();      m_Missing.setInputFormat(insts);      insts = Filter.useFilter(insts, m_Missing);     } else {      m_Missing = null;    }    if (getCapabilities().handles(Capability.NUMERIC_ATTRIBUTES)) {      boolean onlyNumeric = true;      if (!m_checksTurnedOff) {	for (int i = 0; i < insts.numAttributes(); i++) {	  if (i != insts.classIndex()) {	    if (!insts.attribute(i).isNumeric()) {	      onlyNumeric = false;	      break;	    }	  }	}      }            if (!onlyNumeric) {	m_NominalToBinary = new NominalToBinary();	m_NominalToBinary.setInputFormat(insts);	insts = Filter.useFilter(insts, m_NominalToBinary);      }       else {	m_NominalToBinary = null;      }    }    else {      m_NominalToBinary = null;    }    m_classIndex = insts.classIndex();    if (m_filterType == FILTER_STANDARDIZE) {      m_Filter = new Standardize();      ((Standardize)m_Filter).setIgnoreClass(true);      m_Filter.setInputFormat(insts);      insts = Filter.useFilter(insts, m_Filter);     } else if (m_filterType == FILTER_NORMALIZE) {      m_Filter = new Normalize();      ((Normalize)m_Filter).setIgnoreClass(true);      m_Filter.setInputFormat(insts);      insts = Filter.useFilter(insts, m_Filter);     } else {      m_Filter = null;    }    m_data = insts;    // determine which linear transformation has been     // applied to the class by the filter    if (m_Filter != null) {      Instance witness = (Instance)insts.instance(0).copy();      witness.setValue(m_classIndex, 0);      m_Filter.input(witness);      m_Filter.batchFinished();      Instance res = m_Filter.output();      m_Blin = res.value(m_classIndex);      witness.setValue(m_classIndex, 1);      m_Filter.input(witness);      m_Filter.batchFinished();      res = m_Filter.output();      m_Alin = res.value(m_classIndex) - m_Blin;    } else {      m_Alin = 1.0;      m_Blin = 0.0;    }    // Initialize kernel    m_kernel.buildKernel(m_data);    m_KernelIsLinear = (m_kernel instanceof PolyKernel) && (((PolyKernel) m_kernel).getExponent() == 1.0);	    // If machine is linear, reserve space for weights    if (m_KernelIsLinear) {      m_weights = new double[m_data.numAttributes()];    } else {      m_weights = null;    }    // Initialize fcache    m_fcache = new double[m_data.numInstances()];    // Initialize sets    m_I0 = new SMOset(m_data.numInstances());    m_I1 = new SMOset(m_data.numInstances());    m_I2 = new SMOset(m_data.numInstances());    m_I3 = new SMOset(m_data.numInstances());    /* MAIN ROUTINE FOR MODIFICATION 1 */    // Follows the specification of the first modification of Shevade's paper 		    // Initialize alpha array to zero    m_alpha = new double[m_data.numInstances()];    m_alpha_ = new double[m_data.numInstances()];	    // set I1 to contain all the examples    for(int i = 0; i < m_data.numInstances(); i++){      m_I1.insert(i);    }	    // choose any example i from the training set : i = 0     m_bUp = m_data.instance(0).classValue() + m_epsilon;    m_bLow = m_data.instance(0).classValue() - m_epsilon;    m_iUp = m_iLow = 0;	    int numChanged = 0;    boolean examineAll = true;    while(numChanged > 0 || examineAll){      numChanged = 0;      if(examineAll){	// loop over all the example	for(int I = 0; I < m_alpha.length; I++){	  numChanged += examineExample(I);	}      } else {	// loop over I_0	for (int I = m_I0.getNext(-1); I != -1; I = m_I0.getNext(I)) {	  numChanged += examineExample(I);	  if(m_bUp > m_bLow - 2 * m_tol){	    numChanged = 0;	    break;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品视频| 亚洲一二三四久久| 国产成人免费视频| 国产三级欧美三级| 99在线视频精品| 日韩av中文字幕一区二区| 欧美日韩精品是欧美日韩精品| 亚洲国产wwwccc36天堂| 色婷婷综合五月| 视频在线观看一区二区三区| 欧美电影免费提供在线观看| 国产成人午夜视频| 亚洲人精品午夜| 777午夜精品免费视频| 久久精品国产澳门| 亚洲乱码国产乱码精品精小说| 欧美日韩大陆一区二区| 国产成人在线免费观看| 日韩欧美成人午夜| 国产呦精品一区二区三区网站| 国产亚洲va综合人人澡精品| 在线观看精品一区| av高清久久久| 国产精品白丝av| 精品无人区卡一卡二卡三乱码免费卡 | 成人综合婷婷国产精品久久| 亚洲福利一二三区| 中文字幕一区二区三区四区| 欧美va日韩va| 欧美日韩高清一区二区| 欧美日韩二区三区| 国产一区二区久久| 亚洲国产一区二区三区青草影视| 久久久精品国产免大香伊| 欧美精品久久一区| 欧美一区二区三区视频| 欧美一区二区三区的| 日韩欧美一区二区视频| 欧美肥大bbwbbw高潮| 精品视频资源站| 欧美日韩五月天| 欧美二区三区的天堂| 欧美一区二视频| 久久久不卡影院| 亚洲国产精品成人久久综合一区| 国产欧美一区二区精品仙草咪| 欧美成人伊人久久综合网| 欧美电影免费观看完整版| 日韩手机在线导航| 久久久久久日产精品| 久久精品人人做人人爽97 | 欧美电影免费观看高清完整版在线观看| 欧美三级一区二区| 精品久久久久久最新网址| 国产女人水真多18毛片18精品视频| 国产精品美女久久久久久久| 亚洲免费在线电影| 高清成人在线观看| 欧美中文字幕一二三区视频| 国产亚洲精品福利| 亚洲综合免费观看高清完整版 | 亚洲免费观看高清| 性做久久久久久久久| 国产麻豆日韩欧美久久| 91色视频在线| 成人手机电影网| 成人爱爱电影网址| 日韩亚洲欧美成人一区| 亚洲激情第一区| 99久久99久久免费精品蜜臀| 欧美一区二区三区四区视频 | 欧美激情一区在线| 亚洲欧美偷拍三级| 国内久久婷婷综合| 7777精品伊人久久久大香线蕉的 | 亚洲一区二区三区视频在线播放| 国产成人在线免费观看| 久久综合色之久久综合| 久久99九九99精品| 久久综合久久鬼色| 蜜臀av一区二区在线免费观看| 欧美电影在哪看比较好| 亚洲gay无套男同| 日韩欧美一区电影| 激情成人综合网| 国产欧美日韩不卡免费| 成人黄页在线观看| 亚洲一区二区三区影院| 欧美日韩高清一区二区| 九一久久久久久| 国产色一区二区| 在线欧美日韩国产| 免费xxxx性欧美18vr| 久久九九全国免费| 国产精品国产自产拍高清av| 日韩一区二区三区精品视频| av在线播放不卡| 日韩精品91亚洲二区在线观看| 色先锋资源久久综合| 久久网站最新地址| 国产精品资源网| 亚洲精品一区二区三区蜜桃下载 | 免费看欧美女人艹b| jvid福利写真一区二区三区| 国产精品蜜臀在线观看| 日本一区二区三区久久久久久久久不 | 国产精品久久久久三级| 精品免费国产一区二区三区四区| 欧美亚洲国产一区二区三区| 99国产精品国产精品久久| 国产成人av影院| 国产乱码精品一区二区三 | 亚洲成a人片在线不卡一二三区 | 91福利视频在线| 99精品一区二区| 色中色一区二区| 色婷婷综合久久久中文一区二区| 成人深夜在线观看| 成人久久视频在线观看| av毛片久久久久**hd| 99re6这里只有精品视频在线观看| 99视频在线精品| 色婷婷综合久久久中文一区二区| 91成人国产精品| 欧美日韩aaaaaa| 欧美一级免费大片| 精品久久久网站| 国产日韩高清在线| 自拍偷拍国产亚洲| 亚洲成人免费电影| 蜜乳av一区二区| 国产高清精品网站| 成人夜色视频网站在线观看| 色综合久久综合| 欧美人狂配大交3d怪物一区| 日韩西西人体444www| 精品国产乱码久久久久久久| 久久久精品黄色| 亚洲天堂免费看| 日韩在线一区二区| 韩国一区二区视频| 成+人+亚洲+综合天堂| 在线观看一区二区视频| 欧美一级欧美一级在线播放| 久久久久成人黄色影片| 亚洲欧美自拍偷拍色图| 日本最新不卡在线| 国产精品亚洲人在线观看| 91久久精品一区二区| 日韩一级视频免费观看在线| 国产亚洲婷婷免费| 亚洲一卡二卡三卡四卡无卡久久 | 一区二区高清在线| 秋霞电影网一区二区| 国产精品亚洲一区二区三区妖精 | 91原创在线视频| 7777精品伊人久久久大香线蕉最新版| 久久亚洲二区三区| 亚洲国产一区二区a毛片| 国产一区二区三区不卡在线观看| 99精品一区二区| 精品国产精品一区二区夜夜嗨| 亚洲精品老司机| 老汉av免费一区二区三区| 一本到一区二区三区| 精品久久久久久久久久久久久久久久久| 日韩欧美精品在线视频| 亚洲视频 欧洲视频| 国产伦精一区二区三区| 6080日韩午夜伦伦午夜伦| 日本一区二区三区视频视频| 麻豆精品久久精品色综合| 99精品视频一区| 国产无遮挡一区二区三区毛片日本| 日日欢夜夜爽一区| 色悠久久久久综合欧美99| 国产亚洲精品久| 紧缚捆绑精品一区二区| 欧美日韩在线免费视频| 日韩理论在线观看| 国产成人丝袜美腿| 精品久久久久久久久久久久久久久| 亚洲一区二区四区蜜桃| 色综合婷婷久久| 国产精品麻豆99久久久久久| 国产一区999| 欧美一二三区在线观看| 日韩精品一区第一页| 91国产免费看| 亚洲精选视频在线| a4yy欧美一区二区三区| 国产日韩av一区| 国产一区二区视频在线| 日韩免费高清av| 久久国产成人午夜av影院| 欧美一区二区三区四区在线观看| 亚洲成人综合视频| 欧美日韩成人综合| 日本va欧美va精品| 欧美一级日韩一级|