public final class AdvMath
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static double |
computeErr(double total,
double a,
double b)
|
static boolean |
contain(double[] row,
double[] contain)
|
static long |
count(double[][] tables,
double[] set)
|
static long |
count(double[] row,
double value)
|
static double |
entropy(double total,
double a,
double b)
|
static int |
getLength(double num)
return the length of that number
|
static int |
getLength(long num)
return the length of that number
|
static double |
gini(double total,
double a,
double b)
|
static double |
log2(double n)
|
static double |
round(int f,
double num)
when over 0.5, round up, else round down
|
static double |
roundCil(int f,
double num)
round up
|
static double |
roundFlr(int f,
double num)
round down
|
static java.util.List<java.lang.Double> |
toDoubleList(double[] arr)
|
static double[] |
toHashDoubleArray(java.lang.Object[] arr)
|
public static int getLength(long num)
num - numpublic static int getLength(double num)
num - numpublic static double round(int f,
double num)
f - round lengthnum - valuepublic static double roundCil(int f,
double num)
f - round numbernum - valuepublic static double roundFlr(int f,
double num)
f - round numbernum - valuepublic static boolean contain(double[] row,
double[] contain)
row - Setcontain - SubSetpublic static long count(double[] row,
double value)
row - Setvalue - valuepublic static long count(double[][] tables,
double[] set)
tables - Tablesset - SubSetpublic static java.util.List<java.lang.Double> toDoubleList(double[] arr)
arr - double arraypublic static double[] toHashDoubleArray(java.lang.Object[] arr)
arr - object arraypublic static double gini(double total,
double a,
double b)
total - totala - first item valueb - second item valuepublic static double entropy(double total,
double a,
double b)
total - total valuea - first item valueb - second item valuepublic static double computeErr(double total,
double a,
double b)
total - total valuea - first item valueb - second item valuepublic static double log2(double n)