MyNixOS website logo
Description

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) <doi:10.59176/kjcs.v1i1.1259>; 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"
Metadata

Version

1.0.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows