Skip to content

An R repository which integrates a wide set of solutions for imbalanced classification

License

Notifications You must be signed in to change notification settings

shuzhiquan/IRIC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IRIC: Integrated R Library for Imbalanced Classification

IRIC is an R library for imbalanced classification, which will bring convenience to users by integrating a wide set of solutions into one library.


Introduction

The current version of IRIC (v1.1) provides a set of 19 approaches for imbalanced classification, in which 8 approaches are new implementations in R. All these approaches can be classified into 3 strategies: data level, algorithm level and ensemble-based strategy. In addition, we provide parallel implementations of Bagging-based solution to improve the efficiency of model building. All approaches in IRIC are presented in the table below.

Strategy Submodule Method
Algorithm level Cost-sensitive learning CSC4.5
Data level Oversampling ADASYN, MWMOTE, Random Oversampling, SMOTE
Undersampling CLUS,Random Undersampling
Hybrid Sampling SmoteENN, SmoteTL, SPIDER
Ensemble-based learning BalanceBagging RBBagging, ROSBagging,RUSBagging,SMOTEBagging
BalanceBoost AdaC2, RUSBoost, SMOTEBoost
Hybrid Ensemble BalanceCascade, EasyEnsemble

Installation

Download the code from GitHub repository before and then apply the techniques. R version >= 3.1.

Examples

SMOTE(Data level), CSC4.5 (Algorithm level) and RBBagging (Ensemble-based level) are presented as examples of IRIC's usage.

SMOTE

#Example of SMOTE
#Load the package caret for data partitioning
library(caret)
#Load data set
load("Korean.RDa")
#Run the script file of SMOTE
source("SMOTE.R")
#data split
sub <- createDataPartition(Korean$Churn,p=0.75,list=FALSE)
trainset <- Korean[sub,]
testset <- Korean[-sub,]
x <- trainset[, -11]
y <- trainset[, 11]
#call the SMOTE
newData<- SMOTE(x, y)

CSC4.5

#Example of CSC4.5 
#load CSC4.5
source("CSC45.R")
library(caret)
#Load data set
load("Korean.RDa")
#Data split
sub <- createDataPartition(Korean$Churn,p=0.75,list=FALSE)
trainset <- Korean[sub,]
testset <- Korean[-sub,]
x <- trainset[, -11]
y <- trainset[, 11]
#training model
model <- CSC45(x, y, pruning = TRUE)
#Prediction
output <- predict (model, x) 

RBBagging

#Example of RBBagging 
#Load the package caret for data partitioning
library (caret) 
#Load data set 
load(”Korean.RDa”) 
#Run the script file of RBBagging 
source(”BalanceBagging.R”)
#Data split
sub <- createDataPartition(Korean$Churn, p=0.75,list=FALSE)
trainset <- Korean[sub,]
testset <- Korean[-sub,]
x <- trainset[, -11]
y <- trainset[, 11]
#call the RBBaging for model training train 
model <- bbagging(x, y, type=”RBBagging", allowParallel=TRUE)
#prediction
output <- predict (model, x)

About

An R repository which integrates a wide set of solutions for imbalanced classification

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages