This codes belong to my pattern recognition Homeworks.
-
Question no2:
Generate 100000, n dimension uniform i.i.d. random variables and calculate the volume of the n dimension shape of it. Answer: 50, 100, 200 and 1000 dimension iid uniform random variables was created. The graphs were plotted. -
Question no3:
calculate the probability functions,,
using the joint probability function
. Also plot the density functions of thoes probability.
-
Question no4:
(a) Calculate the eignvalue and the eignvectors of The given covariance matrix.
(b) Generate 200 points using the distributionNormal(0,Cov_matrix). Plot the data into 2D graph, Also project the Covariance vectors on it.
- Question no5:
(a) Using the two i.i.d X1,X2 random variables with distribution of uniform(0,1) with feature sizes of 2, Given Y=X1+X2 Calculateand
and also plot the density functions of thoes.
(b) Re-calculate part a, using X1,X2 with the distribution Normal(0,1). - Question no8:
Plot the distributions of two function
and
, And also find the regions for w1 and w2 class in the plot.
- decision boundary example: Create a program that gets the covariance and mean of multiple distributions, Plot the contours of data and its decision boundary.
- Question no1:
Plot the probability of x given θ using the formula below.
P(X|\theta) = if (x >= 0 ) then \theta e ^(-thetax) else 0
Then Plot theversus
for
.
At last mark the maximum likelihood value in the plot.
- Question no1:
(a) Implement KNN algorithm for toy dataset, and report the results of cpu and memory usage. Also create the confusion matrix of the results.
(b) We want to find the suitable K for I dataset, So from each class seperate 100 data for validation and 900 for training. At last compare the results of each K. - Question no2:
(a) Using the bayes classifier find the optimal class for each one of the data. The parameters of each class is given in Q2.
(b) check if the covariance was isotropic, how the result would change.
(c) compare the results with knn results in question 1. - Question no3:
(a) Using the numbers dataset, classify classes with KNN algorithm.
(b) Again Apply KNN algorithm and use 10 precent of each class for validation set and other for training. - Question no4:
Apply the bayes classifier for each number image like question 2. The main difference here is the parameters aren't given, So compute them using a method such as Maximum Likelihood.
In this homework use SVM and PCA models on MNIST dataset. More detailed problem is in the jupyter files.
- i.i.d stands for independece and identical distribution