Learn R Programming

freestats (version 0.0.3)

decisionStump: Decision Stump Algorithm

Description

Do classification with tree method in one step

Usage

decisionStump(X, w, y)

Arguments

X
Data matrix / Data frame
w
Weight that given to each observation. Used in calculate cost function.
y
Class label for data points in X, must be -1 or 1

Value

j
The best dimention to cut the tree
theta
Value that seperate tree in the best dimention
m
the routine label value (for now only 1)

Examples

Run this code
set.seed(1024)
z <- runif(n=5)
mydata <- fakedata(w=z,n=100)
X<- mydata$S[,1:4]
y <- mydata$y
w <- rep(1/100,100)
pars <- decisionStump(X=X,w=w,y=y)

Run the code above in your browser using DataLab