All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.classifiers.m5.Function

java.lang.Object
   |
   +----weka.classifiers.m5.Function

public final class Function
extends Object
implements Serializable
Class for handling a linear function.

Version:
$Revision: 1.2 $
Author:
Yong Wang (yongwang@cs.waikato.ac.nz)

Constructor Index

 o Function()
Constructs a function of constant value
 o Function(Instances)
Constucts a function with all attributes except the class in the inst
 o Function(int)
Constructs a function with one attribute

Method Index

 o combine(Function, Function)
Constructs a new function of which the variable list is a combination of those of two functions
 o copy()
Makes a copy of a function
 o errors(Instances)
Evaluates a function
 o insignificant(double, Instances)
Detects the most insignificant variable in the funcion
 o predict(Instance)
Returns the predicted value of instance i by a function
 o remove(int)
Removes a term from the function
 o toString(Instances, int)
Converts a function to a string

Constructors

 o Function
 public Function()
Constructs a function of constant value

 o Function
 public Function(Instances inst)
Constucts a function with all attributes except the class in the inst

Parameters:
inst - instances
 o Function
 public Function(int attr)
Constructs a function with one attribute

Parameters:
attr - an attribute

Methods

 o copy
 public final Function copy()
Makes a copy of a function

Returns:
the copy of the function
 o toString
 public final String toString(Instances inst,
                              int startPoint) throws Exception
Converts a function to a string

Parameters:
inst - instances
startPoint - the starting point on the screen; used to feed line before reaching beyond 80 characters
Returns:
the converted string
Throws: Exception
if something goes wrong
 o combine
 public static final Function combine(Function f1,
                                      Function f2)
Constructs a new function of which the variable list is a combination of those of two functions

Parameters:
f1 - function 1
f2 - function 2
Returns:
the newly constructed function
 o errors
 public final Errors errors(Instances inst) throws Exception
Evaluates a function

Parameters:
inst - instances
Returns:
the evaluation results
Throws: Exception
if something goes wrong
 o predict
 public final double predict(Instance instance)
Returns the predicted value of instance i by a function

Parameters:
i - instance i
inst - instances
Returns:
the predicted value
 o insignificant
 public final int insignificant(double sdy,
                                Instances inst)
Detects the most insignificant variable in the funcion

Parameters:
sdy - the standard deviation of the class variable
inst - instances
Returns:
the index of the most insignificant variable in the function
 o remove
 public final Function remove(int j)
Removes a term from the function

Parameters:
j - the j-th index in the variable list in the function
Returns:
the new function with the term removed

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home