[Solved] CS1009 Homework 2-Linear and k-NN Regression

$25

File Name: CS1009_Homework_2_Linear_and_k_NN_Regression.zip
File Size: 414.48 KB

SKU: [Solved] CS1009 Homework 2-Linear and k-NN Regression Category: Tag:
5/5 - (1 vote)

Main Theme: Predicting Taxi Pickups in NYCIn this homework, we will explore k-nearest neighbor and linear regression methods for predicting a quantitative variable. Specifically, we will build regression models that can predict the number of taxi pickups in New York city at any given time of the day. These prediction models will be useful, for example, in monitoring traffic in the city.The data set for this problem is given in the file dataset_1.csv. You will need to separate it into training and test sets. The first column contains the time of a day in minutes, and the second column contains the number of pickups observed at that time. The data set covers taxi pickups recorded in NYC during Jan 2015.We will fit regression models that use the time of the day (in minutes) as a predictor and predict the average number of taxi pickups at that time. The models will be fitted to the training set and evaluated on the test set. The performance of the models will be evaluated using the R2 metric.Question 11.1. Use pandas to load the dataset from the csv file dataset_1.csv into a pandas data frame. Use the train_test_split method from sklearn with a random_state of 42 and a test_size of 0.2 to split the dataset into training and test sets. Store your train set dataframe in the variable train_data. Store your test set dataframe in the variable test_data.1.2. Generate a scatter plot of the training data points with well-chosen labels on the x and y axes. The time of the day should be on the x-axis and the number of taxi pickups on the y-axis. Make sure to title your plot.1.3. Does the pattern of taxi pickups make intuitive sense to you?1

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CS1009 Homework 2-Linear and k-NN Regression[Solved] CS1009 Homework 2-Linear and k-NN Regression
$25