Sale!

CSE 258: Homework 3

\$30.00

Category:

Description

Rate this product

CSE 258: Homework 3
Instructions
Please submit your solution by the beginning of the week 7 lecture (Feb 20). Submissions should be
These homework exercises are intended to help you get started on potential solutions to Assignment 1.
We’ll work directly with the Assignment 1 dataset to complete them, which is available here:
http://jmcauley.ucsd.edu/data/assignment1.tar.gz
Executing the code requires a working install of Python 2.7 or Python 3.
You’ll probably want to implement your solution by modifying the baseline code provided.
Note that you should be able to join the competitions using a UCSD e-mail. The competition pages can
be found here:
https://inclass.kaggle.com/c/cse158-categorization
https://inclass.kaggle.com/c/cse258-rating-prediction
First, since the data is quite large, when prototyping solutions it may be too time-consuming to work with all of
the training examples. Also, since we don’t have access to the test labels, we’ll need to simulate validation/test
sets of our own.
So, let’s split the training data (‘train.json.gz’) as follows:
(1) Reviews 1-100,000 for training
(2) Reviews 100,001-200,000 for validation
(3) Upload to Kaggle for testing only when you have a good model on the validation set. This will save you time
(since Kaggle can take several minutes to return results), and also will stop us from crashing their website…
1. Fitting the ‘nHelpful’ variable directly may not make sense, since its scale depends on the total number
outOf (which ranges between 0 and 1). Start by fitting a
simple model of the form
outOf
‘ α.
What is the value of α (1 mark)?
2. What is the performance of this trivial predictor on the validation set? Recall that this should be measured in terms of the mean absolute error (https://www.kaggle.com/wiki/AbsoluteError) (1 mark).
3. To fit the same quantity, train a predictor of the form
outOf
‘ α + β1(# words in review) + β2(review’s rating in stars).
Report the fitted parameters and the MAE on the validation set (1 mark).
4. To run our model on the test set, we’ll have to use the files ‘pairs Helpful.txt’ to find the userID/itemID
pairs about which we have to make predictions, and ‘helpful.json.gz’ to get the review data for those
pairs. Using that data, run the above model and upload your solution to Kaggle. Tell us your Kaggle
user name (1 mark). If you’ve already uploaded a better solution to Kaggle, that’s fine too!