use matlab
use matlab
2) Consider a binary classification problem. Let the input data be described by the data matrix X below with the ith column representing the ith input x(i). The corresponding output is given by the output vector D with the ith component representing output di). 2 2 -22 0 -3 0 3 X=1 3 -2 3 1 0 2 0 -1 -2 0 -1 -2 -5 -2 -1 -2 -3 -1 -1 and D = [111-1-11-1-1-11]" a) Use the Perceptron Learning Algorithm (PLA) to separate the above training data. Implement the PLA with nonzero threshold. Discuss how many updates are needed until all patterns are separated correctly. Also find the minimum margin for this solution. b) Implement the logistic regression algorithm (using LMS) showing the optimal weight vector. What is the minimum margin for this solution and compare to part a). c) Find the linear SVM solution. Give the optimal weight vector, support vectors, and values of Lagrange multipliers. Also find the minimum margin and compare to part a) and b). 3) Go to the UC Irvine machine learning website and download the iris data set. It is a pattern classification problem with three classes of data. a) Use the Perceptron learning algorithm to attempt to separate the first 50 data from the last 100 data. Discuss your observations. b) Repeat a), but now attempt to separate the second 50 data from the other 100 data. c) Repeat a), but now attempt to separate the third 50 data from the other 100 data. 4) Repeat problem 3), but now use the logistic regression algorithm (using LMS). Show the optimal weight vector and discuss convergence times and evaluate the cost function. 5) Repeat problem 3), but now use a linear support vector machine. Show the optimal weight vector, support vectors, values of Lagrange multipliers, and minimum margin. 2) Consider a binary classification problem. Let the input data be described by the data matrix X below with the ith column representing the ith input x(i). The corresponding output is given by the output vector D with the ith component representing output di). 2 2 -22 0 -3 0 3 X=1 3 -2 3 1 0 2 0 -1 -2 0 -1 -2 -5 -2 -1 -2 -3 -1 -1 and D = [111-1-11-1-1-11]" a) Use the Perceptron Learning Algorithm (PLA) to separate the above training data. Implement the PLA with nonzero threshold. Discuss how many updates are needed until all patterns are separated correctly. Also find the minimum margin for this solution. b) Implement the logistic regression algorithm (using LMS) showing the optimal weight vector. What is the minimum margin for this solution and compare to part a). c) Find the linear SVM solution. Give the optimal weight vector, support vectors, and values of Lagrange multipliers. Also find the minimum margin and compare to part a) and b). 3) Go to the UC Irvine machine learning website and download the iris data set. It is a pattern classification problem with three classes of data. a) Use the Perceptron learning algorithm to attempt to separate the first 50 data from the last 100 data. Discuss your observations. b) Repeat a), but now attempt to separate the second 50 data from the other 100 data. c) Repeat a), but now attempt to separate the third 50 data from the other 100 data. 4) Repeat problem 3), but now use the logistic regression algorithm (using LMS). Show the optimal weight vector and discuss convergence times and evaluate the cost function. 5) Repeat problem 3), but now use a linear support vector machine. Show the optimal weight vector, support vectors, values of Lagrange multipliers, and minimum margin