⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 libsvm.html

📁 weka是机器学习和数据挖掘领域最有影响力的开源项目之一
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.5.0_10) on Fri Jan 26 16:34:43 NZDT 2007 --><TITLE>LibSVM</TITLE><META NAME="keywords" CONTENT="weka.classifiers.functions.LibSVM class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="LibSVM";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="http://www.cs.waikato.ac.nz/ml/weka/" target="_blank"><FONT CLASS="NavBarFont1"><B>Weka's home</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../weka/classifiers/functions/LeastMedSq.html" title="class in weka.classifiers.functions"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../weka/classifiers/functions/LinearRegression.html" title="class in weka.classifiers.functions"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html?weka/classifiers/functions/LibSVM.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="LibSVM.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">weka.classifiers.functions</FONT><BR>Class LibSVM</H2><PRE>java.lang.Object  <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../weka/classifiers/Classifier.html" title="class in weka.classifiers">weka.classifiers.Classifier</A>      <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>weka.classifiers.functions.LibSVM</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable, java.lang.Cloneable, <A HREF="../../../weka/core/CapabilitiesHandler.html" title="interface in weka.core">CapabilitiesHandler</A>, <A HREF="../../../weka/core/OptionHandler.html" title="interface in weka.core">OptionHandler</A>, <A HREF="../../../weka/core/TechnicalInformationHandler.html" title="interface in weka.core">TechnicalInformationHandler</A></DD></DL><HR><DL><DT><PRE>public class <B>LibSVM</B><DT>extends <A HREF="../../../weka/classifiers/Classifier.html" title="class in weka.classifiers">Classifier</A><DT>implements <A HREF="../../../weka/core/TechnicalInformationHandler.html" title="interface in weka.core">TechnicalInformationHandler</A></DL></PRE><P><!-- globalinfo-start --> A wrapper class for the libsvm tools (the libsvm classes, typically the jar file, need to be in the classpath to use this classifier).<br/> LibSVM runs faster than SMO since it uses LibSVM to build the SVM classifier.<br/> LibSVM allows users to experiment with One-class SVM, Regressing SVM, and nu-SVM supported by LibSVM tool. LibSVM reports many useful statistics about LibSVM classifier (e.g., confusion matrix,precision, recall, ROC score, etc.).<br/> <br/> Yasser EL-Manzalawy (2005). WLSVM. URL http://www.cs.iastate.edu/~yasser/wlsvm/.<br/> <br/> Chih-Chung Chang, Chih-Jen Lin (2001). LIBSVM - A Library for Support Vector Machines. URL http://www.csie.ntu.edu.tw/~cjlin/libsvm/. <p/> <!-- globalinfo-end --> <!-- technical-bibtex-start --> BibTeX: <pre> &#64;misc{EL-Manzalawy2005,    author = {Yasser EL-Manzalawy},    note = {You don't need to include the WLSVM package in the CLASSPATH},    title = {WLSVM},    year = {2005},    URL = {http://www.cs.iastate.edu/~yasser/wlsvm/} }  &#64;misc{Chang2001,    author = {Chih-Chung Chang and Chih-Jen Lin},    note = {The Weka classifier works with version 2.82 of LIBSVM},    title = {LIBSVM - A Library for Support Vector Machines},    year = {2001},    URL = {http://www.csie.ntu.edu.tw/~cjlin/libsvm/} } </pre> <p/> <!-- technical-bibtex-end --> <!-- options-start --> Valid options are: <p/>  <pre> -S &lt;int&gt;  Set type of SVM (default: 0)    0 = C-SVC    1 = nu-SVC    2 = one-class SVM    3 = epsilon-SVR    4 = nu-SVR</pre>  <pre> -K &lt;int&gt;  Set type of kernel function (default: 2)    0 = linear: u'*v    1 = polynomial: (gamma*u'*v + coef0)^degree    2 = radial basis function: exp(-gamma*|u-v|^2)    3 = sigmoid: tanh(gamma*u'*v + coef0)</pre>  <pre> -D &lt;int&gt;  Set degree in kernel function (default: 3)</pre>  <pre> -G &lt;double&gt;  Set gamma in kernel function (default: 1/k)</pre>  <pre> -R &lt;double&gt;  Set coef0 in kernel function (default: 0)</pre>  <pre> -C &lt;double&gt;  Set the parameter C of C-SVC, epsilon-SVR, and nu-SVR   (default: 1)</pre>  <pre> -N &lt;double&gt;  Set the parameter nu of nu-SVC, one-class SVM, and nu-SVR   (default: 0.5)</pre>  <pre> -Z  Turns on normalization of input data (default: off)</pre>  <pre> -P &lt;double&gt;  Set the epsilon in loss function of epsilon-SVR (default: 0.1)</pre>  <pre> -M &lt;double&gt;  Set cache memory size in MB (default: 40)</pre>  <pre> -E &lt;double&gt;  Set tolerance of termination criterion (default: 0.001)</pre>  <pre> -H  Turns the shrinking heuristics off (default: on)</pre>  <pre> -W &lt;double&gt;  Set the parameters C of class i to weight[i]*C, for C-SVC   (default: 1)</pre>  <pre> -B  Trains a SVC model instead of a SVR one (default: SVR)</pre>  <pre> -D  If set, classifier is run in debug mode and  may output additional info to the console</pre>  <!-- options-end --><P><P><DL><DT><B>Version:</B></DT>  <DD>$Revision: 1.7 $</DD><DT><B>Author:</B></DT>  <DD>Yasser EL-Manzalawy, FracPete (fracpete at waikato dot ac dot nz)</DD><DT><B>See Also:</B><DD><A HREF="../../../weka/core/converters/LibSVMLoader.html" title="class in weka.core.converters"><CODE>LibSVMLoader</CODE></A>, <A HREF="../../../weka/core/converters/LibSVMSaver.html" title="class in weka.core.converters"><CODE>LibSVMSaver</CODE></A>, <A HREF="../../../serialized-form.html#weka.classifiers.functions.LibSVM">Serialized Form</A></DL><HR><P><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Field Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#KERNELTYPE_LINEAR">KERNELTYPE_LINEAR</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kernel type linear: u'*v</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#KERNELTYPE_POLYNOMIAL">KERNELTYPE_POLYNOMIAL</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kernel type polynomial: (gamma*u'*v + coef0)^degree</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#KERNELTYPE_RBF">KERNELTYPE_RBF</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kernel type radial basis function: exp(-gamma*|u-v|^2)</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#KERNELTYPE_SIGMOID">KERNELTYPE_SIGMOID</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kernel type sigmoid: tanh(gamma*u'*v + coef0)</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#SVMTYPE_C_SVC">SVMTYPE_C_SVC</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SVM type C-SVC (classification)</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#SVMTYPE_EPSILON_SVR">SVMTYPE_EPSILON_SVR</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SVM type epsilon-SVR (regression)</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#SVMTYPE_NU_SVC">SVMTYPE_NU_SVC</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SVM type nu-SVC (classification)</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#SVMTYPE_NU_SVR">SVMTYPE_NU_SVR</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SVM type nu-SVR (regression)</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#SVMTYPE_ONE_CLASS_SVM">SVMTYPE_ONE_CLASS_SVM</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SVM type one-class SVM (classification)</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../weka/core/Tag.html" title="class in weka.core">Tag</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#TAGS_KERNELTYPE">TAGS_KERNELTYPE</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the different kernel types</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../weka/core/Tag.html" title="class in weka.core">Tag</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#TAGS_SVMTYPE">TAGS_SVMTYPE</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SVM types</TD></TR></TABLE>&nbsp;<!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#LibSVM()">LibSVM</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR></TABLE>&nbsp;<!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Method Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#buildClassifier(weka.core.Instances)">buildClassifier</A></B>(<A HREF="../../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;insts)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;builds the classifier</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#cacheSizeTipText()">cacheSizeTipText</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the tip text for this property</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;double</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#classifyInstance(weka.core.Instance)">classifyInstance</A></B>(<A HREF="../../../weka/core/Instance.html" title="class in weka.core">Instance</A>&nbsp;instance)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;classifies the given instance</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#coef0TipText()">coef0TipText</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the tip text for this property</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#costTipText()">costTipText</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the tip text for this property</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#degreeTipText()">degreeTipText</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the tip text for this property</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;double[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#distributionForInstance(weka.core.Instance)">distributionForInstance</A></B>(<A HREF="../../../weka/core/Instance.html" title="class in weka.core">Instance</A>&nbsp;instance)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Computes the distribution for a given instance</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/functions/LibSVM.html#epsTipText()">epsTipText</A></B>()</CODE>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -