📄 algvector.html
字号:
public <B>AlgVector</B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> instance) throws java.lang.Exception</PRE><DL><DD>Constructs a vector using an instance. The vector has an element for each numerical attribute. The other attributes (nominal, string) are ignored.<P><DL><DT><B>Parameters:</B><DD><CODE>instance</CODE> - with numeric attributes, that AlgVector gets build from<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if instance doesn't have access to the data format</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="clone()"><!-- --></A><H3>clone</H3><PRE>public java.lang.Object <B>clone</B>() throws java.lang.CloneNotSupportedException</PRE><DL><DD>Creates and returns a clone of this object.<P><DD><DL><DT><B>Overrides:</B><DD><CODE>clone</CODE> in class <CODE>java.lang.Object</CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a clone of this instance.<DT><B>Throws:</B><DD><CODE>java.lang.CloneNotSupportedException</CODE> - if an error occurs</DL></DD></DL><HR><A NAME="getElement(int)"><!-- --></A><H3>getElement</H3><PRE>public final double <B>getElement</B>(int index)</PRE><DL><DD>Returns the value of a cell in the matrix.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the row's index<DT><B>Returns:</B><DD>the value of the cell of the vector</DL></DD></DL><HR><A NAME="numElements()"><!-- --></A><H3>numElements</H3><PRE>public final int <B>numElements</B>()</PRE><DL><DD>Returns the number of elements in the vector.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of rows</DL></DD></DL><HR><A NAME="setElement(int, double)"><!-- --></A><H3>setElement</H3><PRE>public final void <B>setElement</B>(int index, double value)</PRE><DL><DD>Sets an element of the matrix to the given value.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the elements index<DD><CODE>value</CODE> - the new value</DL></DD></DL><HR><A NAME="setElements(double[])"><!-- --></A><H3>setElements</H3><PRE>public final void <B>setElements</B>(double[] elements)</PRE><DL><DD>Sets the elements of the vector to values of the given array. Performs a deep copy.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>elements</CODE> - an array of doubles</DL></DD></DL><HR><A NAME="getElements(int)"><!-- --></A><H3>getElements</H3><PRE>public double[] <B>getElements</B>(int index)</PRE><DL><DD>Gets the elements of the vector and returns them as double array.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>an array of doubles</DL></DD></DL><HR><A NAME="getAsInstance(weka.core.Instances, java.util.Random)"><!-- --></A><H3>getAsInstance</H3><PRE>public <A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> <B>getAsInstance</B>(<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> model, java.util.Random random) throws java.lang.Exception</PRE><DL><DD>Gets the elements of the vector as an instance. !! NON-numeric data is ignored sofar<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>an array of doubles<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if length of vector is not number of numerical attributes</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public java.lang.String <B>toString</B>()</PRE><DL><DD>Converts a vector to a string<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>the converted string</DL></DD></DL><HR><A NAME="add(weka.core.AlgVector)"><!-- --></A><H3>add</H3><PRE>public final <A HREF="../../weka/core/AlgVector.html" title="class in weka.core">AlgVector</A> <B>add</B>(<A HREF="../../weka/core/AlgVector.html" title="class in weka.core">AlgVector</A> other)</PRE><DL><DD>Returns the sum of this vector with another.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a vector containing the sum.</DL></DD></DL><HR><A NAME="substract(weka.core.AlgVector)"><!-- --></A><H3>substract</H3><PRE>public final <A HREF="../../weka/core/AlgVector.html" title="class in weka.core">AlgVector</A> <B>substract</B>(<A HREF="../../weka/core/AlgVector.html" title="class in weka.core">AlgVector</A> other)</PRE><DL><DD>Returns the difference of this vector minus another.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a vector containing the difference vector.</DL></DD></DL><HR><A NAME="dotMultiply(weka.core.AlgVector)"><!-- --></A><H3>dotMultiply</H3><PRE>public final double <B>dotMultiply</B>(<A HREF="../../weka/core/AlgVector.html" title="class in weka.core">AlgVector</A> b)</PRE><DL><DD>Returns the inner (or dot) product of two vectors<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>b</CODE> - the multiplication matrix<DT><B>Returns:</B><DD>the double representing the dot product</DL></DD></DL><HR><A NAME="scalarMultiply(double)"><!-- --></A><H3>scalarMultiply</H3><PRE>public final void <B>scalarMultiply</B>(double s)</PRE><DL><DD>Computes the scalar product of this vector with a scalar<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>s</CODE> - the scalar</DL></DD></DL><HR><A NAME="changeLength(double)"><!-- --></A><H3>changeLength</H3><PRE>public void <B>changeLength</B>(double len)</PRE><DL><DD>Changes the length of a vector.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>len</CODE> - the new length of the vector</DL></DD></DL><HR><A NAME="norm()"><!-- --></A><H3>norm</H3><PRE>public double <B>norm</B>()</PRE><DL><DD>Returns the norm of the vector<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the norm of the vector</DL></DD></DL><HR><A NAME="normVector()"><!-- --></A><H3>normVector</H3><PRE>public final void <B>normVector</B>()</PRE><DL><DD>Norms this vector to length 1.0<P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="main(java.lang.String[])"><!-- --></A><H3>main</H3><PRE>public static void <B>main</B>(java.lang.String[] ops)</PRE><DL><DD>Main method for testing this class.<P><DD><DL></DL></DD><DD><DL></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" 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_bottom_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/AdditionalMeasureProducer.html" title="interface in weka.core"><B>PREV CLASS</B></A> <A HREF="../../weka/core/AllJavadoc.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/AlgVector.html" target="_top"><B>FRAMES</B></A> <A HREF="AlgVector.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 | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -