📄 euclideandistance.html
字号:
<BR> Parses a given list of options.</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/EuclideanDistance.html#toString()">toString</A></B>()</CODE><BR> Documents the content of an EuclideanDistance object in a string.</TD></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/EuclideanDistance.html#update(weka.core.Instance)">update</A></B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> ins)</CODE><BR> Update the distance function (if necessary) for the newly added instance.</TD></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/EuclideanDistance.html#updateRanges(weka.core.Instance)">updateRanges</A></B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> instance)</CODE><BR> Update the ranges if a new instance comes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double[][]</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/EuclideanDistance.html#updateRanges(weka.core.Instance, double[][])">updateRanges</A></B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> instance, double[][] ranges)</CODE><BR> Updates the ranges given a new instance.</TD></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/EuclideanDistance.html#updateRangesFirst(weka.core.Instance, int, double[][])">updateRangesFirst</A></B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> instance, int numAtt, double[][] ranges)</CODE><BR> Used to initialize the ranges.</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/EuclideanDistance.html#valueIsSmallerEqual(weka.core.Instance, int, double)">valueIsSmallerEqual</A></B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> instance, int dim, double value)</CODE><BR> Returns true if the value of the given dimension is smaller or equal the value to be compared with.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_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>Field Detail</B></FONT></TH></TR></TABLE><A NAME="R_MIN"><!-- --></A><H3>R_MIN</H3><PRE>public static final int <B>R_MIN</B></PRE><DL><DD>Index in ranges for MIN and MAX and WIDTH<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#weka.core.EuclideanDistance.R_MIN">Constant Field Values</A></DL></DL><HR><A NAME="R_MAX"><!-- --></A><H3>R_MAX</H3><PRE>public static final int <B>R_MAX</B></PRE><DL><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#weka.core.EuclideanDistance.R_MAX">Constant Field Values</A></DL></DL><HR><A NAME="R_WIDTH"><!-- --></A><H3>R_WIDTH</H3><PRE>public static final int <B>R_WIDTH</B></PRE><DL><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#weka.core.EuclideanDistance.R_WIDTH">Constant Field Values</A></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_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>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="EuclideanDistance()"><!-- --></A><H3>EuclideanDistance</H3><PRE>public <B>EuclideanDistance</B>()</PRE><DL><DD>Constructs an Euclidean Distance object.<P></DL><HR><A NAME="EuclideanDistance(weka.core.Instances)"><!-- --></A><H3>EuclideanDistance</H3><PRE>public <B>EuclideanDistance</B>(<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> data)</PRE><DL><DD>Constructs an Euclidean Distance object.<P><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - the instances the distance function should work on</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="listOptions()"><!-- --></A><H3>listOptions</H3><PRE>public java.util.Enumeration <B>listOptions</B>()</PRE><DL><DD>Returns an enumeration describing the available options.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../weka/core/OptionHandler.html#listOptions()">listOptions</A></CODE> in interface <CODE><A HREF="../../weka/core/OptionHandler.html" title="interface in weka.core">OptionHandler</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>an enumeration of all the available options.</DL></DD></DL><HR><A NAME="setOptions(java.lang.String[])"><!-- --></A><H3>setOptions</H3><PRE>public void <B>setOptions</B>(java.lang.String[] options) throws java.lang.Exception</PRE><DL><DD>Parses a given list of options. Valid options are:<p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../weka/core/OptionHandler.html#setOptions(java.lang.String[])">setOptions</A></CODE> in interface <CODE><A HREF="../../weka/core/OptionHandler.html" title="interface in weka.core">OptionHandler</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>options</CODE> - the list of options as an array of strings<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if an option is not supported</DL></DD></DL><HR><A NAME="getOptions()"><!-- --></A><H3>getOptions</H3><PRE>public java.lang.String[] <B>getOptions</B>()</PRE><DL><DD>Gets the current settings of IBk.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../weka/core/OptionHandler.html#getOptions()">getOptions</A></CODE> in interface <CODE><A HREF="../../weka/core/OptionHandler.html" title="interface in weka.core">OptionHandler</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>an array of strings suitable for passing to setOptions()</DL></DD></DL><HR><A NAME="setInstances(weka.core.Instances)"><!-- --></A><H3>setInstances</H3><PRE>public void <B>setInstances</B>(<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> insts)</PRE><DL><DD>Sets the instances<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../weka/core/DistanceFunction.html#setInstances(weka.core.Instances)">setInstances</A></CODE> in interface <CODE><A HREF="../../weka/core/DistanceFunction.html" title="interface in weka.core">DistanceFunction</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="getInstances()"><!-- --></A><H3>getInstances</H3><PRE>public <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> <B>getInstances</B>()</PRE><DL><DD>returns the instances currently set<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../weka/core/DistanceFunction.html#getInstances()">getInstances</A></CODE> in interface <CODE><A HREF="../../weka/core/DistanceFunction.html" title="interface in weka.core">DistanceFunction</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="dontNormalizeTipText()"><!-- --></A><H3>dontNormalizeTipText</H3><PRE>public java.lang.String <B>dontNormalizeTipText</B>()</PRE><DL><DD>Tip text for the property<P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setDontNormalize(boolean)"><!-- --></A><H3>setDontNormalize</H3><PRE>public void <B>setDontNormalize</B>(boolean dontNormalize)</PRE><DL><DD>Sets whether if the attribute values are to be normalized in distance calculation.<P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="getDontNormalize()"><!-- --></A><H3>getDontNormalize</H3><PRE>public boolean <B>getDontNormalize</B>()</PRE><DL><DD>Gets whether if the attribute values are to be normazlied in distance calculation. (default false i.e. attribute values are normalized.)<P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="update(weka.core.Instance)"><!-- --></A><H3>update</H3><PRE>public void <B>update</B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> ins) throws java.lang.Exception</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../weka/core/DistanceFunction.html#update(weka.core.Instance)">DistanceFunction</A></CODE></B></DD><DD>Update the distance function (if necessary) for the newly added instance.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../weka/core/DistanceFunction.html#update(weka.core.Instance)">update</A></CODE> in interface <CODE><A HREF="../../weka/core/DistanceFunction.html" title="interface in weka.core">DistanceFunction</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE></DL></DD></DL><HR><A NAME="distance(weka.core.Instance, weka.core.Instance)"><!-- --></A><H3>distance</H3><PRE>public double <B>distance</B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> first, <A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> second) throws java.lang.Exception</PRE><DL><DD>Calculates the distance (or similarity) between two instances.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../weka/core/DistanceFunction.html#distance(weka.core.Instance, weka.core.Instance)">distance</A></CODE> in interface <CODE><A HREF="../../weka/core/DistanceFunction.html" title="interface in weka.core">DistanceFunction</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>first</CODE> - the first instance<DD><CODE>second</CODE> - the second instance<DT><B>Returns:</B><DD>the distance between the two given instances.<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE></DL></DD></DL><HR><A NAME="distance(weka.core.Instance, weka.core.Instance, double)"><!-- --></A><H3>distance</H3><PRE>public double <B>distance</B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> first, <A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> second, double cutOffValue)</PRE><DL><DD>Calculates the distance (or similarity) between two instances. Need to pass this returned distance later on to postprocess method to set it on correct scale. <br> P.S.: Please don't mix the use of this function with distance(Instance first, Instance second), as that already does post processing. Please consider passing Double.MAX_VALUE as the cutOffValue to this function and then later on do the post processing on all the distances.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../weka/core/DistanceFunction.html#distance(weka.core.Instance, weka.core.Instance, double)">distance</A></CODE> in interface <CODE><A HREF="../../weka/core/DistanceFunction.html" title="interface in weka.core">DistanceFunction</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>first</CODE> - the first instance<DD><CODE>second</CODE> - the second instance<DD><CODE>cutOffValue</CODE> - If the distance being calculated becomes larger than cutOffValue then the rest of the calculation is skipped and Double.MAX_VALUE is returned. Otherwise the correct disntance is returned.<DT><B>Returns:</B><DD>the distance between the two given instances or Double.MAX_VALUE.</DL></DD></DL><HR><A NAME="distance(weka.core.Instance, weka.core.Instance, double, boolean)"><!-- --></A><H3>distance</H3><PRE>public double <B>distance</B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> first, <A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> second, double cutOffValue, boolean print)</PRE><DL><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="postProcessDistances(double[])"><!-- --></A><H3>postProcessDistances</H3><PRE>public void <B>postProcessDistances</B>(double[] distances)</PRE><DL><DD>Does post processing of the distances (if necessary) returned by distance(distance(Instance first, Instance second, double cutOffValue). It is necessary to do so to get the correct distances if distance(distance(Instance first, Instance second, double cutOffValue) is used. This is because that function actually returns the squared distance to avoid inaccuracies arising from floating point comparison.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../weka/core/DistanceFunction.html#postProcessDistances(double[])">postProcessDistances</A></CODE> in interface <CODE><A HREF="../../weka/core/DistanceFunction.html" title="interface in weka.core">DistanceFunction</A></CODE></DL></DD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -