perceptrain: An original perceptron algorithm

Description Usage Arguments Details Value Author(s) Examples

View source: R/perceptrain.R

Description

Train data with perceptron algorithm

Usage

1
perceptrain(S, y, alpha_k = 1, endcost = 0)

Arguments

S

Each row represents a data points with last column equal to 1; S=[X,1]

y

Class label for data points in S

alpha_k

The speed of converge

endcost

The termination condition of cost function

Details

S is especially designed for perceptron.

For more information fakedata

Value

z

Normal vector of a hyperplane

Z_history

Trajactory of normal vector of a hyperplane

NumofIteration

Number of iterations for algorithm

Author(s)

Xiaoyao Yang

Examples

1
2
3
4
5
set.seed(1024)
z <- runif(n=3)
mydata <- fakedata(w=z,n=100)
r <- perceptrain(S=mydata$S,y=mydata$y,alpha_k=1,endcost=0)
r

freestats documentation built on May 30, 2017, 4:27 a.m.