RegressionTree

scalation.modeling.RegressionTree
See theRegressionTree companion class

The RegressionTree companion object is used to count the number of leaves and provide factory methods for creating regression trees.

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply(xy: MatrixD, fname: Array[String], hparam: HyperParameter)(col: Int): RegressionTree

Create a RegressionTree object from a combined data-response matrix.

Create a RegressionTree object from a combined data-response matrix.

Value parameters

col

the designated response column (defaults to the last column)

fname

the names for all features/variables (defaults to null)

hparam

the hyper-parameters (defaults to hp)

xy

the combined data-response matrix

Attributes

def check(d: Int, j: Int, xj: VectorD, y: VectorD, thr: Double, ssy: Double, sse_t: Double): Boolean

Check to make sure that the threshold and score are feasible. For example, there must be at least two distinct values in xj for a split to work.

Check to make sure that the threshold and score are feasible. For example, there must be at least two distinct values in xj for a split to work.

Value parameters

d

the current depth

j

the column index in data matrix

sse_t

the sum of squared errors total (left + right)

ssy

the sum of squared y-values

thr

the selected threshhold

xj

the j-th column vector in the data matrix

y

the response vector

Attributes

def fastThreshold(xj: VectorD, y: VectorD, ssy: Double): (Double, Double)

Given column j, use fast threshold selection to find an optimal threshold/ split point in O(NlogN) time. Return the threshold and the sse total.

Given column j, use fast threshold selection to find an optimal threshold/ split point in O(NlogN) time. Return the threshold and the sse total.

Value parameters

ssy

the sum of squares for y

xj

the the j-th column in data matrix (used for splitting)

y

the response vector

Attributes

See also

people.cs.umass.edu/~domke/courses/sml/12trees.pdf

def rescale(x: MatrixD, y: VectorD, fname: Array[String], hparam: HyperParameter): RegressionTree

Create a RegressionTree object from a data matrix and response vector.

Create a RegressionTree object from a data matrix and response vector.

Value parameters

fname

the names for all features/variables (defaults to null)

hparam

the hyper-parameters (defaults to hp)

x

the data/input matrix

y

the response/output vector

Attributes

def split(xj: VectorD, thr: Double): Array[IndexedSeq[Int]]

Split gives row indices of left and right children when splitting using thr.

Split gives row indices of left and right children when splitting using thr.

Value parameters

thr

the threshold for splitting (below => left, above => right)

xj

the column/feature to use

Attributes

def sse_LR(xj: VectorD, y: VectorD, thr: Double, ssy: Double): Double

Given threshold thr, compute the sum of the left and right sse (sse total). Used for checking results.

Given threshold thr, compute the sum of the left and right sse (sse total). Used for checking results.

Value parameters

ssy

the sum of squares for y

thr

the given threshold

xj

the the j-th column in data matrix (used for splitting)

y

the response vector

Attributes

Concrete fields