public final class Function
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Function()
Constructs a function of constant value
|
Function(int attr)
Constructs a function with one attribute
|
Function(M5Instances inst)
Constucts a function with all attributes except the class in the inst
|
Modifier and Type | Method and Description |
---|---|
static Function |
combine(Function f1,
Function f2)
Constructs a new function of which the variable list is a combination of those of two functions
|
Function |
copy()
Makes a copy of a function
|
static double[] |
dVectorCopy(double[] a,
int n)
Copy the first n elements of the array a.
|
Results |
errors(M5Instances inst)
Evaluates a function
|
int |
insignificant(double sdy,
M5Instances inst)
Detects the most insignificant variable in the funcion
|
static int[] |
iVectorCombine(int[] list1,
int[] list2)
Combine two vectors in one maintaining an ascending order.
|
static int[] |
iVectorCopy(int[] a,
int n)
Copy the first n elements of the array a.
|
double |
predict(M5Instance instance)
Returns the predicted value of instance i by a function
|
Function |
remove(int j)
Removes a term from the function
|
java.lang.String |
toString(M5Instances inst,
int startPoint)
Converts a function to a string
|
public Function()
public Function(M5Instances inst)
inst
- instancespublic Function(int attr)
attr
- an attributepublic final Function copy()
public static final double[] dVectorCopy(double[] a, int n)
a
- array to copy.n
- number of elements copied. Element at position n is not included.public static final int[] iVectorCopy(int[] a, int n)
a
- array to copy.n
- number of elements copied. Element at position n is not included.public final java.lang.String toString(M5Instances inst, int startPoint) throws java.lang.Exception
inst
- instancesstartPoint
- the starting point on the screen; used to feed line before reaching beyond 80 charactersjava.lang.Exception
- if something goes wrongpublic static final Function combine(Function f1, Function f2)
f1
- function 1f2
- function 2public static final int[] iVectorCombine(int[] list1, int[] list2)
list1
- first vector.list2
- second vector.public final Results errors(M5Instances inst) throws java.lang.Exception
inst
- instancesjava.lang.Exception
- if something goes wrongpublic final double predict(M5Instance instance)
instance
- instancespublic final int insignificant(double sdy, M5Instances inst)
sdy
- the standard deviation of the class variableinst
- instancespublic final Function remove(int j)
j
- the j-th index in the variable list in the function