logisPred: Prediction function for a fitted logistic classifier

Description Usage Arguments Author(s) Examples

View source: R/logisClass.R

Description

Classifies from variables X

Classifies from variables X

Usage

1
2
3
logisPred(theta, X, thres = 0.5, type = "response")

decPlot(theta, dX, X, y, thres = 0.5)

Arguments

theta

numeric vector of parameters

X

design matrix: an array of numeric variables or features including intercepts

thres

decision boundry

type

type of predictions on logit scale ("logit") or "reponse" or as classification ("class")? Defaults to response

theta

numeric vector of parameters

dX

design matrix: an array of numeric variables or features

X

original variables or features

y

original classification including intercepts

thres

decision boundry

Author(s)

Marco D. Visser

Marco D. Visser

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
X<-array(runif(2000),dim=c(1000,2))
y<-sqrt(2*X[,2]^2+2.4*X[,1]^2)<.5
designX<-mapFeat(X)
designX<-cbind(rep(1,100),designX)
theta<-rep(0,ncol(designX))
lambda<-1
logisCost(theta,designX,y,lambda)
logisGrad(theta,designX,y,lambda)
par<-optim(theta,logisCost,logisGrad,X=designX,y=y,lambda=.01,method="BFGS")$par
decPlot(par,designX,X,y,thres=.5)

MarcoDVisser/rML documentation built on May 7, 2019, 2:49 p.m.