Question: With the given code below, how can I output the RMSE(Root Meaned Squared Error) outcome for each model? This is a snipit of the code
With the given code below, how can I output the RMSE(Root Meaned Squared Error) outcome for each model? This is a snipit of the code but if more is required let me know so i can repost this question thanks. (Python 3.6 using Jupyter Notebook)
#Popularity Recommender Model m = tc.recommender.popularity_recommender.create(dataSF, user_id='user_id', item_id='item_id', target = "rating") recs = m.recommend()
#Collaborative Filtering Model finds rankings of those around them o = tc.recommender.ranking_factorization_recommender.create(dataSF, user_id='user_id', item_id='item_id', target = "rating") recs1 = o.recommend()
#Item Similarity Filtering Model n = tc.recommender.item_similarity_recommender.create(dataSF, target = 'rating') recs2 = n.recommend()
#Top 20 Popularity Recommender Model recs.print_rows(num_rows=20, num_columns=4)
#Top 20 ollaborative Filtering Model recs1.print_rows(num_rows=20, num_columns=4)
#Top 20 Similarity Filtering Model recs2.print_rows(num_rows=20, num_columns=4)
+---------+---------+-------+------+ | user_id | item_id | score | rank | +---------+---------+-------+------+ | 196 | 1653 | 5.0 | 1 | | 196 | 1293 | 5.0 | 2 | | 196 | 1599 | 5.0 | 3 | | 196 | 1467 | 5.0 | 4 | | 196 | 1536 | 5.0 | 5 | | 196 | 1201 | 5.0 | 6 | | 196 | 1122 | 5.0 | 7 | | 196 | 814 | 5.0 | 8 | | 196 | 1500 | 5.0 | 9 | | 196 | 1189 | 5.0 | 10 | | 186 | 1653 | 5.0 | 1 | | 186 | 1293 | 5.0 | 2 | | 186 | 1599 | 5.0 | 3 | | 186 | 1467 | 5.0 | 4 | | 186 | 1536 | 5.0 | 5 | | 186 | 1201 | 5.0 | 6 | | 186 | 1122 | 5.0 | 7 | | 186 | 814 | 5.0 | 8 | | 186 | 1500 | 5.0 | 9 | | 186 | 1189 | 5.0 | 10 | +---------+---------+-------+------+ [9430 rows x 4 columns] +---------+---------+--------------------+------+ | user_id | item_id | score | rank | +---------+---------+--------------------+------+ | 196 | 100 | 4.425980950579648 | 1 | | 196 | 302 | 4.26202344416142 | 2 | | 196 | 127 | 4.209750781641011 | 3 | | 196 | 515 | 4.145441229329114 | 4 | | 196 | 275 | 4.130286062941556 | 5 | | 196 | 14 | 4.106402869210248 | 6 | | 196 | 50 | 4.104414994702344 | 7 | | 196 | 318 | 4.100748072252278 | 8 | | 196 | 98 | 4.052573810205464 | 9 | | 196 | 197 | 4.0499869835233735 | 10 | | 186 | 313 | 4.144980470523839 | 1 | | 186 | 328 | 4.095188955650334 | 2 | | 186 | 282 | 4.083514223680501 | 3 | | 186 | 15 | 4.074397067413335 | 4 | | 186 | 318 | 4.047945122108464 | 5 | | 186 | 22 | 3.9676402610397385 | 6 | | 186 | 125 | 3.9538573127841996 | 7 | | 186 | 69 | 3.9462193053817796 | 8 | | 186 | 64 | 3.9022599261856126 | 9 | | 186 | 496 | 3.8108663958168076 | 10 | +---------+---------+--------------------+------+ [9430 rows x 4 columns] +---------+---------+---------------------+------+ | user_id | item_id | score | rank | +---------+---------+---------------------+------+ | 196 | 204 | 0.19415161548516688 | 1 | | 196 | 88 | 0.17671631085566986 | 2 | | 196 | 69 | 0.17165782971259874 | 3 | | 196 | 216 | 0.1635885253930703 | 4 | | 196 | 168 | 0.1620190067168994 | 5 | | 196 | 367 | 0.15905779294478586 | 6 | | 196 | 732 | 0.1582780312269162 | 7 | | 196 | 423 | 0.15524382010484353 | 8 | | 196 | 196 | 0.15482702316381994 | 9 | | 196 | 210 | 0.1519081882941417 | 10 | | 186 | 96 | 0.14121237526769223 | 1 | | 186 | 82 | 0.13828284714532935 | 2 | | 186 | 161 | 0.1364405271799668 | 3 | | 186 | 22 | 0.13404794750006302 | 4 | | 186 | 210 | 0.13086030275925345 | 5 | | 186 | 204 | 0.12985943063445712 | 6 | | 186 | 176 | 0.12702747337196185 | 7 | | 186 | 172 | 0.1257764360179072 | 8 | | 186 | 195 | 0.12491307699162027 | 9 | | 186 | 11 | 0.1238507136054661 | 10 | +---------+---------+---------------------+------+ [9430 rows x 4 columns]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
