Learn R Programming

visualpred (version 0.1.2)

famdcontourlabel: Outliers in Contour plots and FAMD function for classification modeling

Description

This function adds outlier marks to famdcontour using ggrepel package.

Usage

famdcontourlabel(
  dataf = dataf,
  Idt = "",
  inf = 0.1,
  sup = 0.9,
  cutprob = 0.5,
  sizerepel = 3,
  ...
)

Value

A list with the following objects:

graph1_graph6

plots for dimension outliers

graph7_graph12

plots for fit outliers

Arguments

dataf

data frame.

Idt

Identification variable, default "", row number

inf, sup

Quantiles for x,y outliers

cutprob

cut point for outliers based on prob.estimation error

sizerepel

size for outliers label, default=3

...

options to be passed from famdcontour

Details

An identification variable can be set in Idt parameter. By default, number of row is used. There are two source of outliers: i) outliers in the two FAMD dimension space, where the cutpoints are set as quantiles given (inf=0.1 and sup=0.9 in both dimensions by default) and ii) outliers with respect to the fitted probability. The dependent variable is set to 1 for the minority class, and 0 for the majority class. Points considered outliers are those for which abs(vardep-fittedprob) excede parameter cutprob.

Troubleshooting

  • Check missings. Missing values are not allowed.

  • By default selec=0. Setting selec=1 may sometimes imply that no variables are selected; an error message is shown in this case.

  • Models with only two input variables could lead to plot generation problems.

  • Be sure that variables named in listconti are all numeric.

  • If some numeric variable is constant at one single value, process is stopped since numeric Min-max standarization is performed, and NaN values are generated.

  • Dependent variable can not be named x,y,z,x1,x2.

  • When there are only categorical variables as input use mcacontour instead

Examples

Run this code
data(breastwisconsin1)
dataf<-breastwisconsin1
listconti=c( "clump_thickness","uniformity_of_cell_shape","mitosis")
listclass=c("")
vardep="classes"
result<-famdcontourlabel(dataf=dataf,listconti=listconti,
listclass=listclass,vardep=vardep)

Run the code above in your browser using DataLab