mcacontour {visualpred} | R Documentation |
Contour plots and MCA function for classification modeling
Description
This function presents visual graphics by means of Multiple correspondence Analysis projection. Interval variables are categorized to bins. Dependent classification variable is set as supplementary variable. Machine learning algorithm predictions are presented in a filled contour setting.
Usage
mcacontour(dataf=dataf,listconti,listclass,vardep,proba="",bins=8,
Dime1="Dim.1",Dime2="Dim.2",classvar=1,intergrid=0,selec=0,
title="",title2="",listacol="",depcol="",alpha1=0.8,alpha2=0.8,alpha3=0.7,modelo="glm",
nodos=3,maxit=200,decay=0.01,sampsize=400,mtry=2,nodesize=5,
ntree=400,ntreegbm=500,shrink=0.01,bag.fraction=1,n.minobsinnode=10,C=100,gamma=10)
Arguments
dataf |
data frame. |
listconti |
Interval variables to use, in format c("var1","var2",...). |
listclass |
Class variables to use, in format c("var1","var2",...). |
vardep |
Dependent binary classification variable. |
proba |
vector of probability predictions obtained externally (optional) |
bins |
Number of bins for categorize interval variables . |
Dime1 |
FAMD Dimensions to consider. Dim.1 and Dim.2 by default. |
Dime2 |
FAMD Dimensions to consider. Dim.1 and Dim.2 by default. |
classvar |
1 if dependent variable categories are plotted as supplementary |
intergrid |
scale of grid for contour:0 if automatic |
selec |
1 if stepwise logistic variable selection is required, 0 if not. |
title |
plot main title |
title2 |
plot subtitle |
listacol |
vector of colors for labels |
depcol |
vector of two colors for points |
alpha1 |
alpha transparency for majoritary class |
alpha2 |
alpha transparency for minoritary class |
alpha3 |
alpha transparency for fit probability plots |
modelo |
name of model: "glm","gbm","rf,","nnet","svm". |
nodos |
nnet: nodes |
maxit |
nnet: iterations |
decay |
nnet: decay |
sampsize |
rf: sampsize |
mtry |
rf: mtry |
nodesize |
rf: nodesize |
ntree |
rf: ntree |
ntreegbm |
gbm: ntree |
shrink |
gbm: shrink |
bag.fraction |
gbm: bag.fraction |
n.minobsinnode |
gbm:n.minobsinnode |
C |
svm Radial: C |
gamma |
svm Radial: gamma |
Details
This function applies MCA (Multiple Correspondence Analysis) in order to project points and categories of class variables in the same plot. In addition, interval variables listed in listconti are categorized to the number given in bins parameter (by default 8 bins). Further explanation about machine learning classification and contour curves, see the famdcontour function documentation.
Value
A list with the following objects:
- graph1
plot of points on MCA two dimensions
- graph2
plot of points and variables
- graph3
plot of points and contour curves
- graph4
plot of points, contour curves and variables
- graph5
plot of points colored by fitted probability
- graph6
plot of points colored by abs difference
- df1
dataset used for graph1
- df2
dataset used for graph2
- df3
dataset used for graph3
- df4
dataset used for graph4
- listconti
interval variables used
- listclass
class variables used
- ...
color schemes and other parameters
Examples
data(breastwisconsin1)
dataf<-breastwisconsin1
listconti=c( "clump_thickness","uniformity_of_cell_shape","mitosis")
listclass=c("")
vardep="classes"
result<-mcacontour(dataf=dataf,listconti,listclass,vardep)