#feedback_data = reader.read_file_with_minval(filename, 25, 300); feedback_data = reader.read_file_with_minval(filename, 35, 300); print feedback_data; print 'Maximum Genre.' print np.max(feedback_data.meta['pggr_gr']) + 1; print 'Normalizing data.' feedback_data.normalize_row(); # build model with 3 latent factors. r = 5; # the L_2 norm regularizer lamb = 0.001; # the stopping delta value delta = 0.01; # the maximum iteration number maxiter = 500; HierLat_model = HierLat(r,lamb,delta,maxiter, verbose = True); #HierLat_model.train(feedback_data, simplex_projection = False); HierLat_model.train(feedback_data, simplex_projection = True); ''' # test. loc_row = [200, 4, 105]; loc_col = [ 10, 22, 4]; print 'Prediction:' print HierLat_model.predict(loc_row, loc_col); '''