Fill This Form To Receive Instant Help
Homework answers / question archive / Assignment 10 Homework 10: Naïve Bayesian Naïve Bayesian custom density Linear and Discriminant Classifier Implement a linear and quadratic discriminant classifier
Assignment 10
Homework 10:
Implement a linear and quadratic discriminant classifier. As before, for each classifier use year 1 labels as training set and predict year 2 labels. For each week, your feature set is (μ, σ) for that week. Use your labels (you will have 52 weekly labels per year) from year 1 to train your classifier and predict labels for year 2.
Questions:
In principle, any density can be used to implement Naive bayesian classifier. The default for continuous variables is to use nor- mal distribution. In this assignment, we consider implementing Naive Bayesian using Student-t distribution:
https://en.wikipedia.org/wiki/Student%27s t-dis tribution
Student-t distribution is charcterized by 3 parameters:
1. degrees of freedom - dfrac
2. location parameter μ
3. scale parameter s2 (similar to variance in normal)
We can estimate these parameters in Python as follows:
from scipy import stats
# assume data is in array x
df, location , scale = stats.t.fir(x)
To compute the density function for some value z we would use:
value = stats.t.pdf(z, location , scale)
When degrees of freedom is large, Student-t distribution ap- proaches normal. When df ?→ 0, we get a distribution sim- ilar to normal but with fatter tails. In this assignment, we will investigate whether we can improve our accuracy if we use Student-t distribution and consider fatter tails.
You task is to implement a Naive Bayesian classifier with Student- t with df = 0.5, 1, 5). For each week, your feature set is (μ, σ) for that week. Use your labels (you will have 52 labels per year for each week) from year 1 to train your classifier and predict labels for year 2. Use Student-t for the prediction.
Questions:
Implement a Naive Bayesian classifier. For each week, your feature set is (μ,σ) for that week. Use your labels (you will have 52 labels per year for each week) from year 1 to train your classifier and predict labels for year 2. Use Gaussian Naive Bayesian (this is the default).
Questions:
Please download the answer file using this link
https://drive.google.com/file/d/1wiO6Nj4UVUzb8BuoA1YfR1vUoDF0hNMV/view?usp=sharing