⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 utils.html

📁 由java开发的软件包
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#normalize(double[])">normalize</A></B>(double[]&nbsp;doubles)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Normalizes the doubles in the array by their sum.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#normalize(double[], double)">normalize</A></B>(double[]&nbsp;doubles,          double&nbsp;sum)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Normalizes the doubles in the array using the given value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#padLeft(java.lang.String, int)">padLeft</A></B>(java.lang.String&nbsp;inString,        int&nbsp;length)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Pads a string to a specified length, inserting spaces on the left as required.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#padRight(java.lang.String, int)">padRight</A></B>(java.lang.String&nbsp;inString,         int&nbsp;length)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Pads a string to a specified length, inserting spaces on the right as required.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#partitionOptions(java.lang.String[])">partitionOptions</A></B>(java.lang.String[]&nbsp;options)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the secondary set of options (if any) contained in the supplied options array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#probRound(double, java.util.Random)">probRound</A></B>(double&nbsp;value,          java.util.Random&nbsp;rand)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rounds a double to the next nearest integer value in a probabilistic fashion (e.g.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#quote(java.lang.String)">quote</A></B>(java.lang.String&nbsp;string)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Quotes a string if it contains special characters.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.util.Properties</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#readProperties(java.lang.String)">readProperties</A></B>(java.lang.String&nbsp;resourceName)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads properties that inherit from three locations.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#removeSubstring(java.lang.String, java.lang.String)">removeSubstring</A></B>(java.lang.String&nbsp;inString,                java.lang.String&nbsp;substring)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes all occurrences of a string from another string.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#replaceSubstring(java.lang.String, java.lang.String, java.lang.String)">replaceSubstring</A></B>(java.lang.String&nbsp;inString,                 java.lang.String&nbsp;subString,                 java.lang.String&nbsp;replaceString)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Replaces with a new string, all occurrences of a string from  another string.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#round(double)">round</A></B>(double&nbsp;value)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rounds a double to the next nearest integer value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#roundDouble(double, int)">roundDouble</A></B>(double&nbsp;value,            int&nbsp;afterDecimalPoint)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rounds a double to the given number of decimal places.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#sm(double, double)">sm</A></B>(double&nbsp;a,   double&nbsp;b)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tests if a is smaller than b.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#smOrEq(double, double)">smOrEq</A></B>(double&nbsp;a,       double&nbsp;b)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tests if a is smaller or equal to b.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#sort(double[])">sort</A></B>(double[]&nbsp;array)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sorts a given array of doubles in ascending order and returns an array of integers with the positions of the elements of the original array in the sorted array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#sort(int[])">sort</A></B>(int[]&nbsp;array)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sorts a given array of integers in ascending order and returns an  array of integers with the positions of the elements of the original  array in the sorted array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#splitOptions(java.lang.String)">splitOptions</A></B>(java.lang.String&nbsp;quotedOptionString)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Split up a string containing options into an array of strings, one for each option.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#stableSort(double[])">stableSort</A></B>(double[]&nbsp;array)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sorts a given array of doubles in ascending order and returns an  array of integers with the positions of the elements of the original  array in the sorted array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#sum(double[])">sum</A></B>(double[]&nbsp;doubles)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Computes the sum of the elements of an array of doubles.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#sum(int[])">sum</A></B>(int[]&nbsp;ints)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Computes the sum of the elements of an array of integers.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#unbackQuoteChars(java.lang.String)">unbackQuoteChars</A></B>(java.lang.String&nbsp;string)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The inverse operation of backQuoteChars().</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#variance(double[])">variance</A></B>(double[]&nbsp;vector)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Computes the variance for an array of doubles.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Utils.html#xlogx(int)">xlogx</A></B>(int&nbsp;c)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns c*log2(c) for a given integer value c.</TD></TR></TABLE>&nbsp;<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"><TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="log2"><!-- --></A><H3>log2</H3><PRE>public static double <B>log2</B></PRE><DL><DD>The natural logarithm of 2.<P><DL></DL></DL><HR><A NAME="SMALL"><!-- --></A><H3>SMALL</H3><PRE>public static double <B>SMALL</B></PRE><DL><DD>The small deviation allowed in double comparisons<P><DL></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="Utils()"><!-- --></A><H3>Utils</H3><PRE>public <B>Utils</B>()</PRE><DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="readProperties(java.lang.String)"><!-- --></A><H3>readProperties</H3><PRE>public static java.util.Properties <B>readProperties</B>(java.lang.String&nbsp;resourceName)                                           throws java.lang.Exception</PRE><DL><DD>Reads properties that inherit from three locations. Properties are first defined in the system resource location (i.e. in the CLASSPATH).  These default properties must exist. Properties defined in the users home directory (optional) override default settings. Properties defined in the current directory (optional) override all these settings.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>resourceName</CODE> - the location of the resource that should be loaded.  e.g.: "weka/core/Utils.props". (The use of hardcoded forward slashes here is OK - see jdk1.1/docs/guide/misc/resources.html) This routine will also look for the file (in this case) "Utils.props" in the users home directory and the current directory.<DT><B>Returns:</B><DD>the Properties<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if no default properties are defined, or if an error occurs reading the properties files.</DL></DD></DL><HR><A NAME="correlation(double[], double[], int)"><!-- --></A><H3>correlation</H3><PRE>public static final double <B>correlation</B>(double[]&nbsp;y1,                                       double[]&nbsp;y2,                                       int&nbsp;n)</PRE><DL><DD>Returns the correlation coefficient of two double vectors.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>y1</CODE> - double vector 1<DD><CODE>y2</CODE> - double vector 2<DD><CODE>n</CODE> - the length of two double vectors<DT><B>Returns:</B><DD>the correlation coefficient</DL></DD></DL><HR><A NAME="removeSubstring(java.lang.String, java.lang.String)"><!-- --></A><H3>removeSubstring</H3><PRE>public static java.lang.String <B>removeSubstring</B>(java.lang.String&nbsp;inString,                                               java.lang.String&nbsp;substring)</PRE><DL><DD>Removes all occurrences of a string from another string.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>inString</CODE> - the string to remove substrings from.<DD><CODE>substring</CODE> - the substring to remove.<DT><B>Returns:</B><DD>the input string with occurrences of substring removed.</DL></DD></DL><HR><A NAME="replaceSubstring(java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>replaceSubstring</H3><PRE>public static java.lang.String <B>replaceSubstring</B>(java.lang.String&nbsp;inString,                                                java.lang.String&nbsp;subString,                                                java.lang.String&nbsp;replaceString)</PRE><DL><DD>Replaces with a new string, all occurrences of a string from  another string.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>inString</CODE> - the string to replace substrings in.<DD><CODE>replaceString</CODE> - the replacement substring<DT><B>Returns:</B><DD>the input string with occurrences of substring replaced.</DL></DD></DL><HR><A NAME="padLeft(java.lang.String, int)"><!-- --></A><H3>padLeft</H3><PRE>public static java.lang.String <B>padLeft</B>(java.lang.String&nbsp;inString,                                       int&nbsp;length)</PRE><DL><DD>Pads a string to a specified length, inserting spaces on the left as required. If the string is too long, characters are removed (from the right).<P><DD><DL><DT><B>Parameters:</B><DD><CODE>inString</CODE> - the input string<DD><CODE>length</CODE> - the desired length of the output string<DT><B>Returns:</B><DD>the output string</DL></DD></DL><HR><A NAME="padRight(java.lang.String, int)"><!-- --></A><H3>padRight</H3><PRE>public static java.lang.String <B>padRight</B>(java.lang.String&nbsp;inString,                                        int&nbsp;length)</PRE><DL>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -