Assignments for machine-learning in NCTU
- Usage: cd lab1 && python3 main.py <data file> <bases number> <lambda>
- 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
- Usage: cd lab2 && python3 binomial.py [data [a [b]]]
- Online learning with Beta Distribution as prior
- 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
- Usage: cd lab3 && python3 estimator.py <number of data> <mean> <var>
- 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
- Usage: cd lab4 && python3 logistic.py <n> <mx1> <vx1> <my1> <vy1> <mx2> <vx2> <my2> <vy2>
- Distinguish two normal-distribution data set
- Usage: cd lab4 && python3 em.py
- Cluster MNIST
- 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
- 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/
- Project MNIST data in 2D space
- Cluster MNIST with RatioCut and NormalizeCut
- Show support vectors of SVM with different kernels in 2D space