Learn R Programming

kernelFactory (version 0.1.1)

kernelFactory: Binary classification with Kernel Factory

Description

kernelFactory implements an ensemble method for kernel machines (Ballings and Van den Poel, 2013).

Usage

kernelFactory(x = NULL, 
              y = NULL, 
              cp = 1, 
              rp = round(log(ncol(x)+1,4)), 
              method = burn)

Arguments

x
A data frame of predictors. Categorical variables need to be factors.
y
A factor containing the response vector.
cp
The number of column partitions.
rp
The number of row partitions. Setting this number too high may create partitions with only one class.
method
Can be one of the following: POLynomial kernel function (pol), LINear kernel function (lin), Radial Basis kernel Function rbf), random choice (random={pol, lin, rbf}) (random), burn- in choice of best f

Value

  • An object of class kernelFactory, which is a list with the following elements:
  • trnTraining data set.
  • trnlstList of training partitions.
  • rbfstreList of used kernel functions.
  • rbfmtrXList of augmented kernel matrices.
  • rsltsKFList of models.
  • cprNumber of column partitions.
  • rprNumber of row partitions.
  • cntrNumber of partitions.
  • wghtsWeights of the ensemble members.
  • nmDtrnVector indicating the numeric features.
  • rngsRanges of numeric predictors.

References

Ballings, M. and Van den Poel, D. (2013), Kernel Factory: An Ensemble of Kernel Machines. Expert Systems With Applications. Forthcoming.

See Also

predict.kernelFactory

Examples

Run this code
#Credit Approval data available at UCI Machine Learning Repository
data(Credit)

#Create training set (take a small subset for demonstration purposes)
Credit <- data.frame(Credit[order(runif(nrow(Credit ))),])[1:100,]
trainingset <- Credit[1:1:floor(0.50*nrow(Credit)),]
#Create test set
testset <- Credit[(floor(0.50*nrow(Credit))+1 ):nrow(Credit),]

#Train Kernel Factory on training data
kFmodel <- kernelFactory(x=trainingset[,names(trainingset)!= "Response"], 
           y=trainingset$Response, method=random)

#Deploy Kernel Factory to predict response for test data
#predictedresponse <- predict(kFmodel, newdata=testset[,names(testset)!= "Response"])

Run the code above in your browser using DataLab