mutlicol_terminator: Multicollinearity TerminatoR - Feature Selection to remove...

Description Usage Arguments Value Examples

View source: R/mutlicol_terminatoR.R

Description

This function looks at highly correlated features and allows for a correlation cutoff to be set. Outputs from this function allow for correlations and covariance matrices to be created, alongside visuals and the ability to remove highly correlated features from your statistic pipeline.

Usage

1
mutlicol_terminator(df, x_cols, y_cols, alter_df = TRUE, cor_sig = 0.9)

Arguments

df

The data frame to pass with the x and y variables

x_cols

The independent variables we want to analyse for multicollinearity

y_cols

The dependent variables(s) in your predictive model

alter_df

Default=TRUE - Determines whether the underlying features are removed from the data frame, with TRUE being the default.

cor_sig

Default=0.9 - A correlation significance for the cut-off in inter-feature correlation

Value

A list containing the outputs highlighted hereunder:

det

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(caret)
library(FeatureTerminatoR)
library(tibble)
library(dplyr)
df <- iris
mc_fit <- mutlicol_terminator(df, 1:4,5, cor_sig = 0.90, alter_df = TRUE)
#View the correlation matrix
mc_fit$corr_matrix
#View the reduced data
head(mc_fit$feature_removed_df,10)

FeatureTerminatoR documentation built on July 14, 2021, 9:06 a.m.