Example #1
0
def model_all_users(all_user_matrix, alpha):
    mae_list = []
    for user_matrix in all_user_matrix:
        #results = mm.get_ridge_cv_results(user_matrix, alpha)
        results = mm.get_lasso_cv_results(user_matrix, alpha)
        mae = results[0]
        mae_list.append(mae)
    mae_table = pd.DataFrame(np.column_stack((range(1,944), mae_list)), columns = ["User ID", "MAE"])
    mae_table = mae_table.sort("MAE", ascending = 1)
    return mae_table
Example #2
0
def model_user(user_matrix, movie_id):
    results = mm.get_lasso_cv_results(user_matrix, [.1])
    #results = mm.get_ridge_cv_results(user_matrix, [15])
    return results