Skip to content

chhu0830/NCTU_106-2_machine-learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NCTU_106-2_machine-learning

Assignments for machine-learning in NCTU

Lab1 - rLSE & Newton's method

  • Usage: cd lab1 && python3 main.py <data file> <bases number> <lambda>

Lab2 - Naive Bayes & Beta-Binomial Online Learning

Naive Bayes

  • Usage: cd lab2 && python3 main.py [option [training images [training labels [testing images [testing labels]]]]]
    • option 0: Discrete - 256 in 32 bins
    • option 1: Continuous - Standard Normal Distribution

Binomial

  • Usage: cd lab2 && python3 binomial.py [data [a [b]]]
  • Online learning with Beta Distribution as prior

Lab3 - Data Generator & Online Learning

Data Generator

  • Usage: cd lab3 && python3 generator.py <mode> <mean var | a w>
    • mode 0: Gaussian Distribution data generator y~N(mean, var)
    • mode 1: Polynomial Basis Linear Model data generator y = Phi(x)*w + e, e~N(0, a), -10<x<10
    • mode 2: Plot for mode 0 with 10000 data
    • mode 3: Plot for mode 1 with 10000 data

Gaussian Estimator

  • Usage: cd lab3 && python3 estimator.py <number of data> <mean> <var>

Bayesian Linear Regression

  • Usage: cd lab3 && python bayesian.py <precision> <a> <w>
    • a and w is for polynomial basis linear model data generator
  • Assume we have known the data variance

Lab4 - Logistic Classifier & EM clustering

Logistic Classifier

  • Usage: cd lab4 && python3 logistic.py <n> <mx1> <vx1> <my1> <vy1> <mx2> <vx2> <my2> <vy2>
  • Distinguish two normal-distribution data set

EM clustering

  • Usage: cd lab4 && python3 em.py
  • Cluster MNIST

Lab5 - Kmean/Kernel Kmean & LIBSVM

Kmean/Kernel Kmean

  • Usage: use kmean/dot_table.py to generate dot_tables for two datasets, then use python3 kmean/kmean.py <dataset> <cluster number> <kernel> [gamma]
    • dataset: circle | moon
    • cluster num: 0-4
    • kernel: linear | rbf

LIBSVM

  • Usage: python3 svm/mnist.py
  • svm/precompute-kernel.py and svm/libsvm-format.py are used to format the data
  • LIBSVM source
  • put mnist.py under libsvm/python/

Lab6 - PCA/LDA & RatioCut/NormalizeCut & Show support vectors

  • Project MNIST data in 2D space
  • Cluster MNIST with RatioCut and NormalizeCut
  • Show support vectors of SVM with different kernels in 2D space

About

Assignments for machine-learning in NCTU

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages