Skip to content
/ LDA.jl Public

*Deprecated* - Linear Discriminant Analysis and Kernel Fisher Analysis

License

Notifications You must be signed in to change notification settings

remusao/LDA.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LDA

Overview

This package implements Linear Discriminant Analysis with Fisher's dicriminant and Kernel Linear Discriminant Analysis with the following kernels:

  • Linear
  • Polynomial
  • Laplacian RBF
  • RBF

Installation

Pkg.clone("https://github.com/remusao/LDA.jl.git")
Pkg.update()

Usage

using Vega
using LDA
using RDatasets

# Try with Iris
iris = data("datasets", "iris")

# Create data matrix
data = matrix(iris[:, 2:5])'

# Create labels vector
labels = Array(Int, size(data, 2))
for i = 1:size(data, 2)
    x = iris[:, 6][i]
    if x == "setosa"
        labels[i] = 1
    elseif x == "virginica"
        labels[i] = 2
    else
        labels[i] = 3
    end
end

# lineaire
rbf_res = lda(data, labels, 3, linear)
println("Printing results")
print_2Ddecision(rbf_res, data, labels)


# RBF 0.4
rbf_res = lda(data, labels, 3, rbf, 0.4)
println("Printing results")
print_2Ddecision(rbf_res, data, labels)

linear

linear

About

*Deprecated* - Linear Discriminant Analysis and Kernel Fisher Analysis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages