instancesutil.html
来自「weka是机器学习和数据挖掘领域最有影响力的开源项目之一」· HTML 代码 · 共 1,072 行 · 第 1/4 页
HTML
1,072 行
<DT><B>Parameters:</B><DD><CODE>i1</CODE> - the first instance<DD><CODE>i2</CODE> - the second instance<DT><B>Returns:</B><DD><code> true </code> if the first instance is strictly smaller than the second instance, <code> false </code> otherwise</DL></DD></DL><HR><A NAME="smallerOrEqual(weka.core.Instance, weka.core.Instance)"><!-- --></A><H3>smallerOrEqual</H3><PRE>public static boolean <B>smallerOrEqual</B>(<A HREF="../../../../weka/core/Instance.html" title="class in weka.core">Instance</A> i1, <A HREF="../../../../weka/core/Instance.html" title="class in weka.core">Instance</A> i2)</PRE><DL><DD>Compares two instances in the data space, this is, ignoring the class attribute. An instance is smaller or equal than another instance if the same holds for the <code> Coordinates </code> based on these instances.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>i1</CODE> - the first instance<DD><CODE>i2</CODE> - the second instance<DT><B>Returns:</B><DD><code> true </code> if the first instance is smaller or equal than the second instance, <code> false </code> otherwise</DL></DD></DL><HR><A NAME="comparable(weka.core.Instance, weka.core.Instance)"><!-- --></A><H3>comparable</H3><PRE>public static boolean <B>comparable</B>(<A HREF="../../../../weka/core/Instance.html" title="class in weka.core">Instance</A> i1, <A HREF="../../../../weka/core/Instance.html" title="class in weka.core">Instance</A> i2) throws java.lang.IllegalArgumentException</PRE><DL><DD>Checks if two instances are comparable in the data space, this is ignoring the class attribute. Two instances are comparable if the first is smaller or equal than the second, or the other way around.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>i1</CODE> - the first instance<DD><CODE>i2</CODE> - the second instance<DT><B>Returns:</B><DD><code> true </code> if the given instances are comparable, <code> false </code> otherwise<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the two instances don't have the same length</DL></DD></DL><HR><A NAME="doubt(weka.core.Instance, weka.core.Instance)"><!-- --></A><H3>doubt</H3><PRE>public static boolean <B>doubt</B>(<A HREF="../../../../weka/core/Instance.html" title="class in weka.core">Instance</A> i1, <A HREF="../../../../weka/core/Instance.html" title="class in weka.core">Instance</A> i2)</PRE><DL><DD>Checks it two instances give rise to doubt. There is doubt between two instances if their <code> Coordinates </code> are equal, but their class value is different.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>i1</CODE> - the first instance<DD><CODE>i2</CODE> - the second instance<DT><B>Returns:</B><DD><code> true </code> if there is doubt between the two given instances, <code> false </code> otherwise</DL></DD></DL><HR><A NAME="reversedPreference(weka.core.Instance, weka.core.Instance)"><!-- --></A><H3>reversedPreference</H3><PRE>public static boolean <B>reversedPreference</B>(<A HREF="../../../../weka/core/Instance.html" title="class in weka.core">Instance</A> i1, <A HREF="../../../../weka/core/Instance.html" title="class in weka.core">Instance</A> i2) throws java.lang.IllegalArgumentException</PRE><DL><DD>Checks if two instances give rise to reversed preference. Two instances give rise to reversed preference in the data space, if their <code> Coordinates </code> are comparable but different, and their class values are not related in the same way.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>i1</CODE> - the first instance<DD><CODE>i2</CODE> - the second instance<DT><B>Returns:</B><DD><code> true </code> if <code> i1 </code> and <code> i2 </code> give rise to reversed preference, <code> false </code> otherwise<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the two instances don't have the same length</DL></DD></DL><HR><A NAME="isMonotone(weka.core.Instances)"><!-- --></A><H3>isMonotone</H3><PRE>public static boolean <B>isMonotone</B>(<A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A> instances)</PRE><DL><DD>Checks if the given data set is monotone. We say that a data set is monotone if it contains doubt nor reversed preferences.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>instances</CODE> - the data set to be checked<DT><B>Returns:</B><DD><code> true </code> if the given data set if monotone, <code> false </code> otherwise</DL></DD></DL><HR><A NAME="isQuasiMonotone(weka.core.Instances, weka.core.Instances)"><!-- --></A><H3>isQuasiMonotone</H3><PRE>public static boolean <B>isQuasiMonotone</B>(<A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A> ground, <A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A> other)</PRE><DL><DD>Test if a set of instances is quasi monotone. We say that a set of instances <code> S </code> is quasi monotone with respect to a set of instances <code> D </code> iff <code> [x,y] \cap D \neq \emptyset \implies class(x) \leq class(y). </code> This implies that <code> D </code> itself is monotone.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>ground</CODE> - the instances playing the role of <code> D </code><DD><CODE>other</CODE> - the instances playing the role of <code> S </code><DT><B>Returns:</B><DD>true if the instances are quasi monotone, false otherwise</DL></DD></DL><HR><A NAME="nrOfReversedPreferences(weka.core.Instances)"><!-- --></A><H3>nrOfReversedPreferences</H3><PRE>public static int[] <B>nrOfReversedPreferences</B>(<A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A> instances)</PRE><DL><DD>Gather some statistics regarding reversed preferences.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>instances</CODE> - the instances to be examined<DT><B>Returns:</B><DD>array of length 3; position 0 indicates the number of couples that have reversed preference, position 1 the number of couples that are comparable, and position 2 the total number of couples<DT><B>See Also:</B><DD><A HREF="../../../../weka/classifiers/misc/monotone/InstancesUtil.html#reversedPreference(weka.core.Instance, weka.core.Instance)"><CODE>reversedPreference(Instance, Instance)</CODE></A></DL></DD></DL><HR><A NAME="nrStochasticReversedPreference(weka.core.Instances)"><!-- --></A><H3>nrStochasticReversedPreference</H3><PRE>public static int[] <B>nrStochasticReversedPreference</B>(<A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A> instances) throws java.lang.IllegalArgumentException</PRE><DL><DD>Find the number of stochastic reversed preferences in the dataset.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>instances</CODE> - the instances to be examined<DT><B>Returns:</B><DD>an array of integers containing at position <ul> <li> 0: number of different coordinates, this is the size of S_X </li> <li> 1: number of couples showing reversed preference:<br> <code> x < y </code> and <code> not (F_x leqstoch F_y) </code> </li> <li> 2: number of couples having<br> <code> x < y </code> and <code> F_y leqstoch F_x </code> and <code> F_x neq F_y </code> </li> <li> 3: number of couples that are comparable <br> <code> |\{ (x,y)\in S_X \times S_x | x < y\}| </code> </li> <li> 4: number of couples in S_X </li> </ul><DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if there are no instances with a non-missing class value, or if the class is not set</DL></DD></DL><HR><A NAME="nrOfRedundant(weka.core.Instances)"><!-- --></A><H3>nrOfRedundant</H3><PRE>public static int <B>nrOfRedundant</B>(<A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A> instances)</PRE><DL><DD>Counts the number of redundant pairs in the sense of OLM. Two instances are redundant if they are comparable and have the same class value.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>instances</CODE> - the instances to be checked<DT><B>Returns:</B><DD>the number of redundant pairs in the given set of instances</DL></DD></DL><HR><A NAME="totalLoss(weka.classifiers.Classifier, weka.core.Instances, weka.classifiers.misc.monotone.NominalLossFunction)"><!-- --></A><H3>totalLoss</H3><PRE>public static double <B>totalLoss</B>(<A HREF="../../../../weka/classifiers/Classifier.html" title="class in weka.classifiers">Classifier</A> classifier, <A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A> instances, <A HREF="../../../../weka/classifiers/misc/monotone/NominalLossFunction.html" title="interface in weka.classifiers.misc.monotone">NominalLossFunction</A> lossFunction)</PRE><DL><DD>Calulates the total loss over the <code> instances </code>, using the trained <code> classifier </code> and the specified <code> lossFunction. </code> The instances should not contain missing values in the class attribute.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>classifier</CODE> - the trained classifier to use<DD><CODE>instances</CODE> - the test instances<DD><CODE>lossFunction</CODE> - the loss function to use<DT><B>Returns:</B><DD>the total loss of all the instances using the given classifier and loss function</DL></DD></DL><HR><A NAME="classifyInstances(weka.core.Instances, weka.classifiers.Classifier)"><!-- --></A><H3>classifyInstances</H3><PRE>public static void <B>classifyInstances</B>(<A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A> instances, <A HREF="../../../../weka/classifiers/Classifier.html" title="class in weka.classifiers">Classifier</A> classifier) throws java.lang.Exception</PRE><DL><DD>Classify a set of instances using a given classifier. The class value of the instances are set.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>instances</CODE> - the instances to be classified<DD><CODE>classifier</CODE> - a built classifier<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if one of the instances could no be classified</DL></DD></DL><HR><A NAME="getBitMatrix(weka.core.Instances)"><!-- --></A><H3>getBitMatrix</H3><PRE>public static <A HREF="../../../../weka/classifiers/misc/monotone/BooleanBitMatrix.html" title="class in weka.classifiers.misc.monotone">BooleanBitMatrix</A> <B>getBitMatrix</B>(<A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A> instances)</PRE><DL><DD>Calculates the relation (poset) formed by the instances.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>instances</CODE> - the instances for which the poset is to be formed<DT><B>Returns:</B><DD>a <code> BooleanBitMatrix </code> for which position <code> bm.get(i,j) == true </code> iff <code> InstancesUtil.strictlySmaller(instances.instance(i), instances.instance(j)) == true </code></DL></DD></DL><HR><A NAME="numberInInterval(weka.core.Instance, weka.core.Instance)"><!-- --></A><H3>numberInInterval</H3><PRE>public static double <B>numberInInterval</B>(<A HREF="../../../../weka/core/Instance.html" title="class in weka.core">Instance</A> low, <A HREF="../../../../weka/core/Instance.html" title="class in weka.core">Instance</A> up) throws java.lang.IllegalArgumentException</PRE><DL><DD>Calculatus the number of elements in the closed interval <code> [low,up]. </code> If the class index is set, then the class attribute does not play part in the calculations, this is we work in the data space. The code also works with numeric attributes, but is primarily intended for ordinal attributes.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>low</CODE> - the lower bound of the interval<DD><CODE>up</CODE> - the upper bound of the interval<DT><B>Returns:</B><DD>the size of the interval (in floating point format)<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the given instances do not constitute an interval.</DL></DD></DL><HR><A NAME="numberOfSmallerVectors(weka.core.Instance)"><!-- --></A><H3>numberOfSmallerVectors</H3><PRE>public static double <B>numberOfSmallerVectors</B>(<A HREF="../../../../weka/core/Instance.html" title="class in weka.core">Instance</A> instance)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?