Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

These exercises concern the description and standardization of data, and finishes by building a simple classifier for the data using the Mahalanobis distance. Download the

These exercises concern the description and standardization of data, and finishes by building a simple classifier for the data using the Mahalanobis distance. Download the tremor data tremor.mat from the study resources page. On loading it into Matlab youll find Xtr and Xte which are features, Xtr for training a classifier, and Xte for testing it. The corresponding targets are ttr and tte; each target is either 0 or 1 to denote which class the corresponding row of Xtr or Xte belongs to. Initially, we will just use Xtr and ttr. 1. Plotting (5 points). Make a scatter plot of the data using different colors for the two different classes. Rather than writing loops, you can use the power of Matlab to achieve this simply: % Find the indices of observations in class 0 >> I = find(ttr == 0); % Plot these points in blue; the third argument (10) controls the size >> scatter(Xtr(I,1), Xtr(I,2), 10, b); >> hold on; You are required to complete the above code by finding the indices of observations in class 1 and plotting these points in red. See help scatter for more plotting options. 2. Mean, standard deviation, and covariance (30 points). You are required to do the following: Find the mean and standard deviation of the features as a whole and also for each of the classes. Check that the mean and standard deviation make sense in terms of your scatter plot. Find the covariance matrix for the data by using the Matlab command cov. Find the correlation between variables x1 and x2 with all the samples together; Find the within group correlation; that is, find the correlations for variables x1 and x2 for each of the classes. Are they better correlated within the classes than together? 3. Standardization (30 points). Standardize the data by mean-centering it and dividing it by the standard deviation of the relevant variable. (You can use the commands mean and std to find the mean and variance.) Plot the standardized data and check your result by finding its mean and covariance matrix. Find the correlation between two variables x1 and x2 from the standardized covariance matrix. 4. Classifier using Mahalanobis distances (30 points). Use the Mahalanobis distance to construct a classifier that discriminates between the two classes. Make plots similar to those in lectures that show the minimum Mahalanobis distance from every point in a grid of (x, y) points. One way of doing this is along the following lines (put the code in a .m file rather than trying to do it all at the console):

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

LO 14-6 Describe the product life cycle.

Answered: 1 week ago