📄 attribute.html
字号:
</DL><HR><A NAME="Attribute(java.lang.String, weka.core.FastVector)"><!-- --></A><H3>Attribute</H3><PRE>public <B>Attribute</B>(java.lang.String attributeName, <A HREF="../../weka/core/FastVector.html" title="class in weka.core">FastVector</A> attributeValues)</PRE><DL><DD>Constructor for nominal attributes and string attributes. If a null vector of attribute values is passed to the method, the attribute is assumed to be a string.<P><DL><DT><B>Parameters:</B><DD><CODE>attributeName</CODE> - the name for the attribute<DD><CODE>attributeValues</CODE> - a vector of strings denoting the attribute values. Null if the attribute is a string attribute.</DL></DL><HR><A NAME="Attribute(java.lang.String, weka.core.FastVector, weka.core.ProtectedProperties)"><!-- --></A><H3>Attribute</H3><PRE>public <B>Attribute</B>(java.lang.String attributeName, <A HREF="../../weka/core/FastVector.html" title="class in weka.core">FastVector</A> attributeValues, <A HREF="../../weka/core/ProtectedProperties.html" title="class in weka.core">ProtectedProperties</A> metadata)</PRE><DL><DD>Constructor for nominal attributes and string attributes, where metadata is supplied. If a null vector of attribute values is passed to the method, the attribute is assumed to be a string.<P><DL><DT><B>Parameters:</B><DD><CODE>attributeName</CODE> - the name for the attribute<DD><CODE>attributeValues</CODE> - a vector of strings denoting the attribute values. Null if the attribute is a string attribute.<DD><CODE>metadata</CODE> - the attribute's properties</DL></DL><HR><A NAME="Attribute(java.lang.String, weka.core.Instances)"><!-- --></A><H3>Attribute</H3><PRE>public <B>Attribute</B>(java.lang.String attributeName, <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> header)</PRE><DL><DD>Constructor for relation-valued attributes.<P><DL><DT><B>Parameters:</B><DD><CODE>attributeName</CODE> - the name for the attribute<DD><CODE>header</CODE> - an Instances object specifying the header of the relation.</DL></DL><HR><A NAME="Attribute(java.lang.String, weka.core.Instances, weka.core.ProtectedProperties)"><!-- --></A><H3>Attribute</H3><PRE>public <B>Attribute</B>(java.lang.String attributeName, <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> header, <A HREF="../../weka/core/ProtectedProperties.html" title="class in weka.core">ProtectedProperties</A> metadata)</PRE><DL><DD>Constructor for relation-valued attributes.<P><DL><DT><B>Parameters:</B><DD><CODE>attributeName</CODE> - the name for the attribute<DD><CODE>header</CODE> - an Instances object specifying the header of the relation.<DD><CODE>metadata</CODE> - the attribute's properties</DL></DL><HR><A NAME="Attribute(java.lang.String, weka.core.Instances, int)"><!-- --></A><H3>Attribute</H3><PRE>public <B>Attribute</B>(java.lang.String attributeName, <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> header, int index)</PRE><DL><DD>Constructor for a relation-valued attribute with a particular index.<P><DL><DT><B>Parameters:</B><DD><CODE>attributeName</CODE> - the name for the attribute<DD><CODE>header</CODE> - the header information for this attribute<DD><CODE>index</CODE> - the attribute's index</DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="copy()"><!-- --></A><H3>copy</H3><PRE>public java.lang.Object <B>copy</B>()</PRE><DL><DD>Produces a shallow copy of this attribute.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../weka/core/Copyable.html#copy()">copy</A></CODE> in interface <CODE><A HREF="../../weka/core/Copyable.html" title="interface in weka.core">Copyable</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a copy of this attribute with the same index</DL></DD></DL><HR><A NAME="enumerateValues()"><!-- --></A><H3>enumerateValues</H3><PRE>public final java.util.Enumeration <B>enumerateValues</B>()</PRE><DL><DD>Returns an enumeration of all the attribute's values if the attribute is nominal, string, or relation-valued, null otherwise.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>enumeration of all the attribute's values</DL></DD></DL><HR><A NAME="equals(java.lang.Object)"><!-- --></A><H3>equals</H3><PRE>public final boolean <B>equals</B>(java.lang.Object other)</PRE><DL><DD>Tests if given attribute is equal to this attribute.<P><DD><DL><DT><B>Overrides:</B><DD><CODE>equals</CODE> in class <CODE>java.lang.Object</CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>other</CODE> - the Object to be compared to this attribute<DT><B>Returns:</B><DD>true if the given attribute is equal to this attribute</DL></DD></DL><HR><A NAME="index()"><!-- --></A><H3>index</H3><PRE>public final int <B>index</B>()</PRE><DL><DD>Returns the index of this attribute.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the index of this attribute</DL></DD></DL><HR><A NAME="indexOfValue(java.lang.String)"><!-- --></A><H3>indexOfValue</H3><PRE>public final int <B>indexOfValue</B>(java.lang.String value)</PRE><DL><DD>Returns the index of a given attribute value. (The index of the first occurence of this value.)<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - the value for which the index is to be returned<DT><B>Returns:</B><DD>the index of the given attribute value if attribute is nominal or a string, -1 if it is not or the value can't be found</DL></DD></DL><HR><A NAME="isNominal()"><!-- --></A><H3>isNominal</H3><PRE>public final boolean <B>isNominal</B>()</PRE><DL><DD>Test if the attribute is nominal.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the attribute is nominal</DL></DD></DL><HR><A NAME="isNumeric()"><!-- --></A><H3>isNumeric</H3><PRE>public final boolean <B>isNumeric</B>()</PRE><DL><DD>Tests if the attribute is numeric.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the attribute is numeric</DL></DD></DL><HR><A NAME="isRelationValued()"><!-- --></A><H3>isRelationValued</H3><PRE>public final boolean <B>isRelationValued</B>()</PRE><DL><DD>Tests if the attribute is relation valued.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the attribute is relation valued</DL></DD></DL><HR><A NAME="isString()"><!-- --></A><H3>isString</H3><PRE>public final boolean <B>isString</B>()</PRE><DL><DD>Tests if the attribute is a string.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the attribute is a string</DL></DD></DL><HR><A NAME="isDate()"><!-- --></A><H3>isDate</H3><PRE>public final boolean <B>isDate</B>()</PRE><DL><DD>Tests if the attribute is a date type.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the attribute is a date type</DL></DD></DL><HR><A NAME="name()"><!-- --></A><H3>name</H3><PRE>public final java.lang.String <B>name</B>()</PRE><DL><DD>Returns the attribute's name.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the attribute's name as a string</DL></DD></DL><HR><A NAME="numValues()"><!-- --></A><H3>numValues</H3><PRE>public final int <B>numValues</B>()</PRE><DL><DD>Returns the number of attribute values. Returns 0 for attributes that are not either nominal, string, or relation-valued.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of attribute values</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public final java.lang.String <B>toString</B>()</PRE><DL><DD>Returns a description of this attribute in ARFF format. Quotes strings if they contain whitespace characters, or if they are a question mark.<P><DD><DL><DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a description of this attribute as a string</DL></DD></DL><HR><A NAME="type()"><!-- --></A><H3>type</H3><PRE>public final int <B>type</B>()</PRE><DL><DD>Returns the attribute's type as an integer.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the attribute's type.</DL></DD></DL><HR><A NAME="getDateFormat()"><!-- --></A><H3>getDateFormat</H3><PRE>public final java.lang.String <B>getDateFormat</B>()</PRE><DL><DD>Returns the Date format pattern in case this attribute is of type DATE, otherwise an empty string.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the date format pattern<DT><B>See Also:</B><DD><CODE>SimpleDateFormat</CODE></DL></DD></DL><HR><A NAME="value(int)"><!-- --></A><H3>value</H3><PRE>public final java.lang.String <B>value</B>(int valIndex)</PRE><DL><DD>Returns a value of a nominal or string attribute. Returns an empty string if the attribute is neither a string nor a nominal attribute.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>valIndex</CODE> - the value's index<DT><B>Returns:</B><DD>the attribute's value as a string</DL></DD></DL><HR><A NAME="relation()"><!-- --></A><H3>relation</H3><PRE>public final <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> <B>relation</B>()</PRE><DL><DD>Returns the header info for a relation-valued attribute, null if the attribute is not relation-valued.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the attribute's value as an Instances object</DL></DD></DL><HR><A NAME="relation(int)"><!-- --></A><H3>relation</H3><PRE>public final <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> <B>relation</B>(int valIndex)</PRE><DL><DD>Returns a value of a relation-valued attribute. Returns null if the attribute is not relation-valued.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>valIndex</CODE> - the value's index<DT><B>Returns:</B><DD>the attribute's value as an Instances object</DL></DD></DL><HR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -