--- title: "Introduction to the rgnoisefilt package" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{rgnoisefilt} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) getInfo <- function(what = "Suggests") { text <- packageDescription("rgnoisefilt")[what][[1]] text <- gsub("\n", ", ", text, fixed = TRUE) text <- gsub(">=", "$\\\\ge$", text, fixed = TRUE) eachPkg <- strsplit(text, ", ", fixed = TRUE)[[1]] eachPkg <- gsub(",", "", eachPkg, fixed = TRUE) #out <- paste("\\\**", eachPkg[order(tolower(eachPkg))], "}", sep = "") #paste(out, collapse = ", ") length(eachPkg) } ```
The **rgnoisefilt** package contains filtering techniques to remove noisy samples in regression datasets. It adapts classic and recent filtering techniques for use in regression problems, and it also incorporates methods specifically designed for regression data. In order to do this, it uses approaches proposed in the specialized literature, such as Martín et al. (2021) and Arnaiz-González et al. (2016).
## InstalationThe **rgnoisefilt** package can be installed in R from **CRAN** servers using the command:
```{r install1} #install.packages("rgnoisefilt") ```This command installs all the dependencies of the package as well as all the regression algorithms necessary for the operation of the noise filters. In order to access all the functions of the package, it is necessary to use the R command:
```{r install2} library(rgnoisefilt) ``` ## DocumentationAll the information corresponding to each noise filter can be consulted from the **CRAN** website. Additionally, the help() command can be used. For example, in order to check the documentation of the regIPF noise filter, we can use:
```{r document1} help(regIPF) ``` ## Usage of regression noise filtersFor processing noisy regression data, each noise filter in the **rgnoisefilt** package provides two standard ways of use:
An example on how to use these two methods for filtering out the rock dataset with the regCNN noise filter is shown below:
```{r example 1} data(rock) head(rock) # Using the default method: set.seed(9) out.def <- regCNN(x = rock[,-ncol(rock)], y = rock[,ncol(rock)]) # Using the formula method: set.seed(9) out.frm <- regCNN(formula = perm ~ ., data = rock) # Check the match of noisy indices: all(out.def$idnoise == out.frm$idnoise) ```Note that, the $\$$ operator is used to access the elements returned by the filter in the objects $out.def$ and $out.frm$.
## Output valuesAll regression noise filters return an object of rfdata class. It is designed to unify the output value of the methods included in the **rgnoisefilt** package. The rfdata class is a list of elements with the most relevant information of the noise filtering process:
In order to display the results of the rfdata class in a friendly way in the R console, two specific print and summary functions are implemented. The print function presents the basic information of the noise filtering process:
```{r example 3} print(out.def) ```The information offered by print is as follows:
On the other hand, the summary function displays the information of the dataset processed with the noise filter along with other additional details. This function can be called by typing the following R command:
```{r example 4} summary(out.frm, showid = TRUE) ```The information offered by this function is as follows: