SVD
Evaluating RMSE, MAE of algorithm SVD on 3 split(s).
Fold 1 Fold 2 Fold 3 Mean Std
RMSE (testset) 0.2289 0.2759 0.2260 0.2436 0.0229
MAE (testset) 0.1130 0.1091 0.1083 0.1102 0.0021
Fit time 6.20 6.00 5.95 6.05 0.11
Test time 0.50 0.47 0.49 0.49 0.01
{'test_rmse': array([0.22891096, 0.2759472 , 0.22598352]), 'test_mae': array([0.11304235, 0.10914811, 0.10827262]), 'fit_time': (6.203150033950806, 5.996194839477539, 5.954233169555664), 'test_time': (0.49585604667663574, 0.47057509422302246, 0.4896547794342041)}
SVDpp
Evaluating RMSE, MAE of algorithm SVDpp on 3 split(s).
Fold 1 Fold 2 Fold 3 Mean Std
RMSE (testset) 0.2503 0.2606 0.3129 0.2746 0.0274
MAE (testset) 0.1541 0.1676 0.1684 0.1634 0.0066
Fit time 134.15 133.91 133.54 133.86 0.25
Test time 6.18 6.39 6.36 6.31 0.09
{'test_rmse': array([0.25026616, 0.26060685, 0.31291403]), 'test_mae': array([0.15407927, 0.16755922, 0.16842247]), 'fit_time': (134.14813780784607, 133.90549397468567, 133.53579807281494), 'test_time': (6.184978723526001, 6.390493869781494, 6.357921123504639)}
SlopeOne
Evaluating RMSE, MAE of algorithm SlopeOne on 3 split(s).
Fold 1 Fold 2 Fold 3 Mean Std
RMSE (testset) 0.9088 0.8928 0.8996 0.9004 0.0066
MAE (testset) 0.6598 0.6610 0.6626 0.6612 0.0011
Fit time 0.45 0.41 0.43 0.43 0.02
Test time 5.02 4.96 5.01 5.00 0.03
{'test_rmse': array([0.90875587, 0.89276161, 0.89959105]), 'test_mae': array([0.65984765, 0.66103708, 0.66262992]), 'fit_time': (0.4522852897644043, 0.4134690761566162, 0.43015003204345703), 'test_time': (5.022490978240967, 4.957015752792358, 5.010500907897949)}
NMF
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
<ipython-input-114-fae06b225fb7> in <module>
10 for algo in algo_dict:
11 print(algo)
---> 12 print(cross_validate(algo_dict[algo], data, measures=['RMSE', 'MAE'], cv=3, verbose=True))
//anaconda3/lib/python3.7/site-packages/surprise/model_selection/validation.py in cross_validate(algo, data, measures, cv, return_train_measures, n_jobs, pre_dispatch, verbose)
99 return_train_measures)
100 for (trainset, testset) in cv.split(data))
--> 101 out = Parallel(n_jobs=n_jobs, pre_dispatch=pre_dispatch)(delayed_list)
102
103 (test_measures_dicts,
//anaconda3/lib/python3.7/site-packages/joblib/parallel.py in __call__(self, iterable)
919 # remaining jobs.
920 self._iterating = False
--> 921 if self.dispatch_one_batch(iterator):
922 self._iterating = self._original_iterator is not None
923
//anaconda3/lib/python3.7/site-packages/joblib/parallel.py in dispatch_one_batch(self, iterator)
757 return False
758 else:
--> 759 self._dispatch(tasks)
760 return True
761
//anaconda3/lib/python3.7/site-packages/joblib/parallel.py in _dispatch(self, batch)
714 with self._lock:
715 job_idx = len(self._jobs)
--> 716 job = self._backend.apply_async(batch, callback=cb)
717 # A job can complete so quickly than its callback is
718 # called before we get here, causing self._jobs to
//anaconda3/lib/python3.7/site-packages/joblib/_parallel_backends.py in apply_async(self, func, callback)
180 def apply_async(self, func, callback=None):
181 """Schedule a func to be run"""
--> 182 result = ImmediateResult(func)
183 if callback:
184 callback(result)
//anaconda3/lib/python3.7/site-packages/joblib/_parallel_backends.py in __init__(self, batch)
547 # Don't delay the application, to avoid keeping the input
548 # arguments in memory
--> 549 self.results = batch()
550
551 def get(self):
//anaconda3/lib/python3.7/site-packages/joblib/parallel.py in __call__(self)
223 with parallel_backend(self._backend, n_jobs=self._n_jobs):
224 return [func(*args, **kwargs)
--> 225 for func, args, kwargs in self.items]
226
227 def __len__(self):
//anaconda3/lib/python3.7/site-packages/joblib/parallel.py in <listcomp>(.0)
223 with parallel_backend(self._backend, n_jobs=self._n_jobs):
224 return [func(*args, **kwargs)
--> 225 for func, args, kwargs in self.items]
226
227 def __len__(self):
//anaconda3/lib/python3.7/site-packages/surprise/model_selection/validation.py in fit_and_score(algo, trainset, testset, measures, return_train_measures)
162
163 start_fit = time.time()
--> 164 algo.fit(trainset)
165 fit_time = time.time() - start_fit
166 start_test = time.time()
//anaconda3/lib/python3.7/site-packages/surprise/prediction_algorithms/matrix_factorization.pyx in surprise.prediction_algorithms.matrix_factorization.NMF.fit()
//anaconda3/lib/python3.7/site-packages/surprise/prediction_algorithms/matrix_factorization.pyx in surprise.prediction_algorithms.matrix_factorization.NMF.sgd()
ZeroDivisionError: float division