## Not run:
# data(iris)
#
# irisClass <- iris[,5]
# irisData <- iris[,-5]
#
# # Construct a classification ensemble with 100 classifiers and 100 bootstrap
# # iterations during optimisation
#
# ens <- cfBuild(irisData, irisClass, bootNum = 100, ensNum = 100, parallel = TRUE,
# cpus = 4, type = "SOCK")
#
# # Randomly generate test data to find out their classes using the generated ensemble
# # 400 points are selected at random, which results in 100 samples (rows).
# # Predict the classes of the data using the classifiers in the constructed ensemble
#
# testMatr <- matrix(runif(400)*100, ncol=4)
# predRes <- cfPredict(ens, testMatr)
#
# # Get the attributes of the object predRes
# attributes(predRes)$names
#
# # Get the predicted classes as generated by a majority vote between the classifiers
# predRes$totalPred
#
# # Get the individual classes as predicted by each classifier in the ensemble
# predRes$indivPred
#
# ## End(Not run)
Run the code above in your browser using DataLab