# cs4378vcs5369l homework 2 cs4378vcs5369l homework 2 assigned tuesday october 9 2012 due tues

CS4378V_CS5369L: Homework #2 CS4378V_CS5369L: Homework #2 Assigned: Tuesday, October 9, 2012 Due: Tuesday, October 23, 2012 (100 points)CS4378V_CS5369L: Homework #2 1. (40 pts) Implement the linear regression algorithm (gradient descent) and run the linear regression algorithm on the training samples (linear_regression_data.txt). You can find the dataset on Tracs under “Resources: Data”. Get the learned linear function and the predicted results of the testing samples (linear_regression_data.txt). 2. (40 pts.) Learn the probabilities for Naive Bayes for the following training examples. Use Laplace’s smoothing to estimate conditional probabilities. How well does your Naive Bayes hypothesis perform on the following test examples? Show your work. Attributes Class x1 x2 x3 x4 y 0 0 1 0 1 0 1 0 1 1 1 0 0 0 -1 1 0 1 1 -1 3. (20 pts) Design an n-input perceptron that implements the function: if k or more of the inputs are true, the output is true. (Suppose the input value can only be “1” (true) or “0” (false))