Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please. i need a code for two quesrions please i need a code for these two quetions CMP2003 Data Structures and Algorithms (C++) Project Due

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
please. i need a code for two quesrions
please i need a code for these two quetions
CMP2003 Data Structures and Algorithms (C++) Project Due Date: Jan 06,2023 1 The Problem Reccummender systems help people find itens of anterest by making personalised recomanendations accurding to their preferences. For example, a recomanender system can male perronalized recotamendations of itetas ruch as movies, books, botels or musie to prople. In ofder to model users' pecferencer their past interactions such as product views, ratings, and purchases ate tased. In the recomaxender shotetas atest of research (which is a subbield of machine learaing and information retrieval) ditferent algorithms have becn developod which are currently beiag ascd by many large companion, In this project you will implement neighhorhood basod collaborative Gileering (NBCF) algotithms in oxder to maloe predictions foe moxje ratings of people. There are two main types of NBCF algorithms user-basod (UBCF) and item-based (IBCF). Let us describe each with an example dataset. 2 UBCF and IBCF One of the fundaraental problems in recommender systems is to pecdict the rating of a user for a particular can predict this rating then. If it is a high valoe like 4 or 5 , we can docike to rocomimeid Movie 3 to User 2. Table 1+ An evausuhe datave In its simplost form, UBCF works as follows: in otder to predict the rating of user u to itein i, we: first find the poot sirailar k asers to x (who rated i) and perelict the rating ros the average ratings of these most simblar k asry on liens i, For finding the ximalarity betwera two nscrs differeat methods can be usevt. In collaborative filtering we look at the ratings of other users and fiod users which have similar ratings. One popular method to find such a similarity is calbed cosine simblarity which is given helow; rosin(A,B)=ABAB=i=1nA12i=1nBn2i=1nA,B Foc example, given two wectars A={2,4,5 aad B={$,2,4], their coeine similarity is given log". cosinc(A,B)=22+42+5222+22+4223+42+64 IBCF, on the other hand, wogks as follows: in order to prediket the rating of asy u to them i, we fint find the most sinalar k iteme to (which are rated by ueer u ) and predict the ratiag as the average rating of aser w for tbese abos similar k items. For similarity calkulation, again casine kimilarity can be used. 3 Evaluation The dataset that will be given to you will be a text file and will have the following format (each line contains a rating of a gerticular user to a particular movic): UscrID, MevieID, Raties 10, 100,5 10, 101,4 10,102,5 11,100,5 11,201,4 For testing your performance you will be given a test set similar to the following: UseriD, MovielD 10,200 10, 201 10, 202 11, 300 11, 301 As can be sern, the ratings are hiddia, your task is to poedict these ratiags and make a subenisoion to Kaggle webi site (more detaibs about thas subusiosioa will be given later). Your ain is to maloe the loest predictboes, that is, prodict the actiaal ratinge as clowe as pooshble. Tbe crror metric for calculating your scores will be root mean squased erot (RMSE). which is given helkert RMSF=ni=1n(viyi)2 Whete y is the actual rating and g, is the predicted rating. For exatnple if y=[2,4,5,3] and y^={3,4,2,2] then R,MSE=4(23)2+(44)2+(52)2+(32)2 4 Model Building and Experiments The above description of UBCF and IBCF is a simple and general obe. You are free to use different variations of these mothods, expredally you can try different similarity moetries (other than cosine). You can find soore information on NBCF on masy seb resuerces. Yod are froe to noe any method you like (other than UBCF and IBCF) but you should insplenent at loant UBCF ot IBCF and aho that it is working. Since the ratings file that will he poovided will he a large file, try to find the best (efficicut) data structures andi algorithms for applying UBCF and IBCF. Before subenitting yoar predietions, you might wait to do ottine experiments. Is its simplest form you cas split your data into training and test sets. The test wet thight be coestracted by randotaly sotheting a solset of the rous ( 1000 rows for example) of the dataset provided and patting all the rest of the ratings to the trajaing set. Then you can try to prodict the ratings in the test set using the training set and calculate the MAE without raaking a submissios. Note that you can malo at most 5 subanissions to Kaggle web site every day. 5 Requirements and What to Submit - You can form teams of at moos 3 stadents. You can work alone but we encourage everyone to be part of a team. Team members can be from different sections. - Codes should be written in C++. You are allowed to use C++ standard library. No other library can be used. - In the project report you should dearly explain the data structures and algorithms you used. Also, you should clearly write which parts of the project you completed. Also, prowide the time it taluss to sake all the predictions (otnit the time for reading the ratings file). Designing efficient data structures and algorithens will lead to higher grades, so describe them in detail. - You shouhd subanit a vidho recocding in which every team member should explain bis/her part. Recordings should be about 10-15 minutes long. You should submit (to itslearning) the following as three separate files in the given formats, Submissions in other formats will not be evaluated. Every team should make a single submission so write tesam menber names clearly at the top of your reports. There will be a penalty of 10 podats for excy late day after the due date. - All hesaber (.ht) and source (.cpp) files. (2ip format) - Project repott (PDF format) - Video recording (mp-t fotmat) 6 Grading - 40 points Fteading the input file and conrectly printing the top 10 users and top 10 movies in decreasing order of number of ratings that they have. An example output is given in the Talhles 2 and 3 below: Table 2: Top users who have the most ratings. Table 3: Top movies which have the noet ratings. - 40 points Stacessafully applying the UBCF or IBCF, making a subaission to Kapsle web site, and getting R.MSE

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions