Learn Supervised Classification Methods Through Examples and Code

Supervised classification methods, which (if asked) can provide step-by-step explanations of the algorithms used, as described in PK Josephine et. al., (2021) ; and datasets to test them on, which highlight the strengths and weaknesses of each technique.


LearnSL

The goal of LearnSL is to provide a set of functions to perform supervised classification along with comprehensive explanations of the algorithms, their pros and cons, and their applications.

Installation

You can install the released version of LearnSL from CRAN with:

install.packages("LearnSL")

You can install the development version of LearnSL from GitHub with:

# install.packages("devtools")
devtools::install_github("ComiSeng/LearnSL")

Example

This is a basic example which shows you how to classify a dataset:

library(LearnSL)
multivariate_linear_regression(db1rl)

This is yet another example of an implemented classification algorithm, showing the step by step process:

library(LearnSL)
knn(db_flowers,"ClassLabel", c(6.7, 1.5, 5.3, 2.1), "Euclidean", 2, details = TRUE, waiting = FALSE)
## 

## EXPLANATION

## ________________________________________________________________________________
## ________________________________________________________________________________

## 

## Step 1:

##     - Calculate the chosen d_method from the value we want to classify to every

##     other one.

## Step 2:

##     - Select the k closest neighbors and get their classes.

## Step 3:

##     - Create a scatterplot matrix with the provided values for visualization pur

##     pose

## Step 4:

##     - Select the most repeated class among the k closest neighbors classes.

## ________________________________________________________________________________
## ________________________________________________________________________________

## 

## Step 1:

## 

## Distance from p1 to every other p.

##  [1] 5.666469 5.394510 5.586155 5.812633 5.471676 2.978727 2.588349 1.907590
##  [9] 2.518859 2.884434 1.368425 1.480560 1.977996 1.869735 1.741970 3.633439
## [17] 4.079999 4.965582 4.571177 5.201494

## ________________________________________________________________________________

## 

## Step 2:

## 

## These are the first k values classes:

## [1] "virginica" "virginica"

## ________________________________________________________________________________

## 

## Step 3:

## 

## Plot values.

## ________________________________________________________________________________

## 

## Step 4:

## 

## The most represented class among the k closes neighbors is virginica

## therefore, that is the new value's predicted class.

## [1] "virginica"

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("LearnSL")

1.0.0 by Víctor Amador Padilla, 3 years ago


https://github.com/ComiSeng/LearnSL


Report a bug at https://github.com/ComiSeng/LearnSL/issues


Browse source code at https://github.com/cran/LearnSL


Authors: Víctor Amador Padilla [aut, cre] , Juan Jose Cuadrado Gallego [ctb] , Universidad de Alcala [cph]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports cli


See at CRAN