R/predict.logregmodel.R

Defines functions predict.logregmodel

Documented in predict.logregmodel

predict.logregmodel<-function(object,newbin,type,...){
	if(!type%in%c(1:3,9))
		stop("Currently only available for classification and linear and\n",
			"(multinomial) logistic regression.")
	mat.model<-cbind(1,eval.logreg(object,newbin))
	pred<-mat.model%*%object$coef
	if(type==1)
		pred[pred!=0]<-1
	if(type==3)
		pred<-exp(pred)/(1+exp(pred))
	pred
}

Try the logicFS package in your browser

Any scripts or data that you put into this service are public.

logicFS documentation built on Nov. 8, 2020, 5:23 p.m.