clean: Dataset's cleaning

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/clean.R

Description

A function to eliminate rows and columns that have a percentage of missing values greater than the allowed tolerance.

Usage

1
clean(w, tol.col = 0.5, tol.row = 0.3, name = "")

Arguments

w

the dataset to be examined and cleaned

tol.col

maximum ratio of missing values allowed in columns. The default value is 0.5. Columns with a larger ratio of missing will be eliminated unless they are known to be relevant attributes.

tol.row

maximum ratio of missing values allowed in rows. The default value is 0.3. Rows with a ratio of missing that is larger that the established tolerance will be eliminated.

name

name of the dataset to be used for the optional report

Details

This function can create an optional report on the cleaning process if the comment symbols are removed from the last lines of code. The report is returned to the workspace, where it can be reexamined as needed. The report object's name begins with: Clean.rep.

Value

w

the original dataset, with missing values that were in relevant variables imputed

Author(s)

Caroline Rodriguez

References

Acuna, E. and Rodriguez, C. (2004). The treatment of missing values and its effect in the classifier accuracy. In D. Banks, L. House, F.R. McMorris, P. Arabie, W. Gaul (Eds). Classification, Clustering and Data Mining Applications. Springer-Verlag Berlin-Heidelberg, 639-648.

See Also

ce.impute

Examples

1
2
3
#-----Dataset cleaning-----
data(hepatitis)
hepa.cl=clean(hepatitis,0.5,0.3,name="hepatitis-clean")

Example output

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 
   Variables Percent.of.missing
1         V4  0.645161290322581
2         V6  0.645161290322581
3         V7  0.645161290322581
4         V8  0.645161290322581
5         V9   6.45161290322581
6        V10   7.09677419354839
7        V11    3.2258064516129
8        V12    3.2258064516129
9        V13    3.2258064516129
10       V14    3.2258064516129
11       V15   3.87096774193548
12       V16   18.7096774193548
13       V17   2.58064516129032
14       V18   10.3225806451613
15       V19   43.2258064516129

Number of instances eliminated: 4 
Instance eliminated           : 42 57 73 119 

Maximum number of values to be imputed:  132 

dprep documentation built on May 29, 2017, 11:01 a.m.