📄 testinstances.html
字号:
<!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:49 NZDT 2007 --><TITLE>TestInstances</TITLE><META NAME="keywords" CONTENT="weka.core.TestInstances class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="TestInstances";}</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> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </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> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../weka/core/Tee.html" title="class in weka.core"><B>PREV CLASS</B></A> <A HREF="../../weka/core/UnassignedClassException.html" title="class in weka.core"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?weka/core/TestInstances.html" target="_top"><B>FRAMES</B></A> <A HREF="TestInstances.html" target="_top"><B>NO FRAMES</B></A> <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: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <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.core</FONT><BR>Class TestInstances</H2><PRE>java.lang.Object <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>weka.core.TestInstances</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable, java.lang.Cloneable, <A HREF="../../weka/core/OptionHandler.html" title="interface in weka.core">OptionHandler</A></DD></DL><HR><DL><DT><PRE>public class <B>TestInstances</B><DT>extends java.lang.Object<DT>implements java.lang.Cloneable, java.io.Serializable, <A HREF="../../weka/core/OptionHandler.html" title="interface in weka.core">OptionHandler</A></DL></PRE><P>Generates artificial datasets for testing. In case of Multi-Instance data the settings for the number of attributes applies to the data inside the bag. Originally based on code from the CheckClassifier.<p/> <!-- options-start --> Valid options are: <p/> <pre> -relation <name> The name of the data set.</pre> <pre> -seed <num> The seed value.</pre> <pre> -num-instances <num> The number of instances in the datasets (default 20).</pre> <pre> -class-type <num> The class type, see constants in weka.core.Attribute (default 1=nominal).</pre> <pre> -classes-values <num> The number of classes to generate (for nominal classes only) (default 2).</pre> <pre> -class-index <num> The class index, with -1=last, (default -1).</pre> <pre> -no-class Doesn't include a class attribute in the output.</pre> <pre> -nominal <num> The number of nominal attributes (default 1).</pre> <pre> -nominal-values <num> The number of values for nominal attributes (default 2).</pre> <pre> -numeric <num> The number of numeric attributes (default 0).</pre> <pre> -string <num> The number of string attributes (default 0).</pre> <pre> -words <comma-separated-list> The words to use in string attributes.</pre> <pre> -word-separators <chars> The word separators to use in string attributes.</pre> <pre> -date <num> The number of date attributes (default 0).</pre> <pre> -relational <num> The number of relational attributes (default 0).</pre> <pre> -num-instances-relational <num> The number of instances in relational/bag attributes (default 10).</pre> <pre> -multi-instance Generates multi-instance data.</pre> <pre> -W <classname> The Capabilities handler to base the dataset on. The other parameters can be used to override the ones determined from the handler. Additional parameters for handler can be passed on after the '--'.</pre> <!-- options-end --><P><P><DL><DT><B>Version:</B></DT> <DD>$Revision: 1.6 $</DD><DT><B>Author:</B></DT> <DD>FracPete (fracpete at waikato dot ac dot nz)</DD><DT><B>See Also:</B><DD><A HREF="../../weka/classifiers/CheckClassifier.html" title="class in weka.classifiers"><CODE>CheckClassifier</CODE></A>, <A HREF="../../serialized-form.html#weka.core.TestInstances">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 int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#CLASS_IS_LAST">CLASS_IS_LAST</A></B></CODE><BR> can be used for settting the class attribute index to last</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#DEFAULT_SEPARATORS">DEFAULT_SEPARATORS</A></B></CODE><BR> the default word separators used in strings</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#DEFAULT_WORDS">DEFAULT_WORDS</A></B></CODE><BR> the default list of words used in strings</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#NO_CLASS">NO_CLASS</A></B></CODE><BR> can be used to avoid generating a class attribute</TD></TR></TABLE> <!-- ======== 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/core/TestInstances.html#TestInstances()">TestInstances</A></B>()</CODE><BR> the default constructor</TD></TR></TABLE> <!-- ========== 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> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#assign(weka.core.TestInstances)">assign</A></B>(<A HREF="../../weka/core/TestInstances.html" title="class in weka.core">TestInstances</A> t)</CODE><BR> updates itself with all the settings from the given TestInstances object</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.Object</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#clone()">clone</A></B>()</CODE><BR> creates a clone of the current object</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../weka/core/TestInstances.html" title="class in weka.core">TestInstances</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#forCapabilities(weka.core.Capabilities)">forCapabilities</A></B>(<A HREF="../../weka/core/Capabilities.html" title="class in weka.core">Capabilities</A> c)</CODE><BR> returns a TestInstances instance setup already for the the given capabilities.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#generate()">generate</A></B>()</CODE><BR> generates a new dataset.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getClassIndex()">getClassIndex</A></B>()</CODE><BR> returns the current class index (0-based), -1 is last attribute</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getClassType()">getClassType</A></B>()</CODE><BR> returns the current class type</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getData()">getData</A></B>()</CODE><BR> returns the current dataset, can be null</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../weka/core/CapabilitiesHandler.html" title="interface in weka.core">CapabilitiesHandler</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getHandler()">getHandler</A></B>()</CODE><BR> returns the current set CapabilitiesHandler to generate the dataset for, can be null</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getMultiInstance()">getMultiInstance</A></B>()</CODE><BR> Gets whether multi-instance data (with a fixed structure) is generated</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getNoClass()">getNoClass</A></B>()</CODE><BR> whether no class attribute is generated</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getNumAttributes()">getNumAttributes</A></B>()</CODE><BR> returns the overall number of attributes (incl.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getNumClasses()">getNumClasses</A></B>()</CODE><BR> returns the current number of classes</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getNumDate()">getNumDate</A></B>()</CODE><BR> returns the current number of date attributes</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getNumInstances()">getNumInstances</A></B>()</CODE><BR> returns the current number of instances to produce</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getNumInstancesRelational()">getNumInstancesRelational</A></B>()</CODE><BR> returns the current number of instances in relational/bag attributes to produce</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getNumNominal()">getNumNominal</A></B>()</CODE><BR> returns the current number of nominal attributes</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getNumNominalValues()">getNumNominalValues</A></B>()</CODE><BR> returns the current number of values for nominal attributes</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getNumNumeric()">getNumNumeric</A></B>()</CODE><BR> returns the current number of numeric attributes</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getNumRelational()">getNumRelational</A></B>()</CODE><BR> returns the current number of relational attributes</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getNumString()">getNumString</A></B>()</CODE><BR> returns the current number of string attributes</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getOptions()">getOptions</A></B>()</CODE><BR> Gets the current settings of this object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getRelation()">getRelation</A></B>()</CODE><BR> returns the current name of the relation</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getRelationalClassFormat()">getRelationalClassFormat</A></B>()</CODE><BR> returns the current strcuture of the relational class attribute, can be null</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/TestInstances.html#getRelationalFormat(int)">getRelationalFormat</A></B>(int index)</CODE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -