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

📄 ensembleselectionlibrarymodel.html

📁 weka是机器学习和数据挖掘领域最有影响力的开源项目之一
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!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:45 NZDT 2007 --><TITLE>EnsembleSelectionLibraryModel</TITLE><META NAME="keywords" CONTENT="weka.classifiers.meta.ensembleSelection.EnsembleSelectionLibraryModel class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="EnsembleSelectionLibraryModel";}</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/meta/ensembleSelection/EnsembleSelectionLibrary.html" title="class in weka.classifiers.meta.ensembleSelection"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../../weka/classifiers/meta/ensembleSelection/ModelBag.html" title="class in weka.classifiers.meta.ensembleSelection"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../index.html?weka/classifiers/meta/ensembleSelection/EnsembleSelectionLibraryModel.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="EnsembleSelectionLibraryModel.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.meta.ensembleSelection</FONT><BR>Class EnsembleSelectionLibraryModel</H2><PRE>java.lang.Object  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../weka/classifiers/EnsembleLibraryModel.html" title="class in weka.classifiers">weka.classifiers.EnsembleLibraryModel</A>      <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>weka.classifiers.meta.ensembleSelection.EnsembleSelectionLibraryModel</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable</DD></DL><HR><DL><DT><PRE>public class <B>EnsembleSelectionLibraryModel</B><DT>extends <A HREF="../../../../weka/classifiers/EnsembleLibraryModel.html" title="class in weka.classifiers">EnsembleLibraryModel</A><DT>implements java.io.Serializable</DL></PRE><P>This class represents a library model that is used for EnsembleSelection. At this level the concept of cross validation is abstracted away. This class keeps track of the performance statistics and bookkeeping information for its "model type" accross all the CV folds. By "model type", I mean the combination of both the Classifier type (e.g. J48), and its set of parameters (e.g. -C 0.5 -X 1 -Y 5). So for example, if you are using 5 fold cross validaiton, this model will keep an array of classifiers[] of length 5 and will keep track of their performances accordingly. This class also has methods to deal with serializing all of this information into the .elm file that will represent this model. <p/> Also it is worth mentioning that another important function of this class is to track all of the dataset information that was used to create this model. This is because we want to protect users from doing foreseeably bad things. e.g., trying to build an ensemble for a dataset with models that were trained on the wrong partitioning of the dataset. This could lead to artificially high performance due to the fact that instances used for the test set to gauge performance could have accidentally been used to train the base classifiers. So in a nutshell, we are preventing people from unintentionally "cheating" by enforcing that the seed, #folds, validation ration, and the checksum of the  Instances.toString() method ALL match exactly.  Otherwise we throw an  exception.<P><P><DL><DT><B>Version:</B></DT>  <DD>$Revision: 1.1 $</DD><DT><B>Author:</B></DT>  <DD>Robert Jung (mrbobjung@gmail.com)</DD><DT><B>See Also:</B><DD><A HREF="../../../../serialized-form.html#weka.classifiers.meta.ensembleSelection.EnsembleSelectionLibraryModel">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;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/classifiers/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#FILE_EXTENSION">FILE_EXTENSION</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The default file extension for ensemble library models</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/classifiers/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#m_Debug">m_Debug</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The debug flag as propagated from the main EnsembleSelection class.</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/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#EnsembleSelectionLibraryModel()">EnsembleSelectionLibraryModel</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default Constructor</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../weka/classifiers/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#EnsembleSelectionLibraryModel(weka.classifiers.Classifier)">EnsembleSelectionLibraryModel</A></B>(<A HREF="../../../../weka/classifiers/Classifier.html" title="class in weka.classifiers">Classifier</A>&nbsp;classifier)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Basic Constructor</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../weka/classifiers/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#EnsembleSelectionLibraryModel(weka.classifiers.Classifier, int, java.lang.String, double, int)">EnsembleSelectionLibraryModel</A></B>(<A HREF="../../../../weka/classifiers/Classifier.html" title="class in weka.classifiers">Classifier</A>&nbsp;classifier,                              int&nbsp;seed,                              java.lang.String&nbsp;checksum,                              double&nbsp;validationRatio,                              int&nbsp;folds)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor for LibaryModel</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/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#createModel(weka.core.Instances[], weka.core.Instances[], java.lang.String, int)">createModel</A></B>(<A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A>[]&nbsp;data,            <A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A>[]&nbsp;hillclimbData,            java.lang.String&nbsp;dataDirectoryName,            int&nbsp;algorithm)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates the model.</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/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#getAveragePrediction(weka.core.Instance)">getAveragePrediction</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;Returns the average of the prediction of the models across all folds.</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/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#getChecksum()">getChecksum</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get the checksum</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/classifiers/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#getFileName(java.lang.String)">getFileName</A></B>(java.lang.String&nbsp;stringRepresentation)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The purpose of this method is to get an appropriate file name for a model based on its string representation of a model.</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/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#getFoldPrediction(weka.core.Instance, int)">getFoldPrediction</A></B>(<A HREF="../../../../weka/core/Instance.html" title="class in weka.core">Instance</A>&nbsp;instance,                  int&nbsp;fold)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns prediction of the classifier for the specified fold.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/classifiers/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#getFolds()">getFolds</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get the number of folds</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../weka/classifiers/Classifier.html" title="class in weka.classifiers">Classifier</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/classifiers/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#getModels()">getModels</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returs the array of classifiers</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/classifiers/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#getSeed()">getSeed</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the seed</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/classifiers/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#getStringChecksum(java.lang.String)">getStringChecksum</A></B>(java.lang.String&nbsp;string)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets a checksum for the string defining this classifier.</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/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#getValidationPredictions()">getValidationPredictions</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getter for validation predictions</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/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#getValidationRatio()">getValidationRatio</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get validationRatio</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../../weka/classifiers/meta/ensembleSelection/EnsembleSelectionLibraryModel.html" title="class in weka.classifiers.meta.ensembleSelection">EnsembleSelectionLibraryModel</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/classifiers/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#loadModel(java.lang.String)">loadModel</A></B>(java.lang.String&nbsp;modelFilePath)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;loads the specified model</TD></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/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#rehydrateModel(java.lang.String)">rehydrateModel</A></B>(java.lang.String&nbsp;workingDirectory)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The purpose of this method is to "rehydrate" the classifier object fot this library model from the filesystem.</TD></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/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#releaseModel()">releaseModel</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Releases the model from memory.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../weka/classifiers/meta/ensembleSelection/EnsembleSelectionLibraryModel.html#saveModel(java.lang.String, weka.classifiers.meta.ensembleSelection.EnsembleSelectionLibraryModel)">saveModel</A></B>(java.lang.String&nbsp;directory,          <A HREF="../../../../weka/classifiers/meta/ensembleSelection/EnsembleSelectionLibraryModel.html" title="class in weka.classifiers.meta.ensembleSelection">EnsembleSelectionLibraryModel</A>&nbsp;model)</CODE>

⌨️ 快捷键说明

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