diff --git a/Schrick-Noah_Learning-Practice-3.ipynb b/Schrick-Noah_Learning-Practice-3.ipynb index 37c4bdf..44ef1ff 100644 --- a/Schrick-Noah_Learning-Practice-3.ipynb +++ b/Schrick-Noah_Learning-Practice-3.ipynb @@ -28,7 +28,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Problem 14.1" + "# Problem 14.1\n", + "This is a good approach for exploring associative relationships between customers. Since there is company data mixed with demographic data, the association rules can yield better results and demonstrate better associations since purchases can be examined with respect to age, location, number of dependents, and any other demographic data available." ] }, { @@ -71,9 +72,9 @@ "courses_df = pd.read_csv('Coursetopics.csv')\n", "\n", "reader = Reader(rating_scale=(0, 1))\n", - "data = Dataset.load_from_df(ratings[['customerID', 'movieID', 'rating']], reader)\n", + "data = Dataset.load_from_df(courses_df['customerID', 'movieID', 'rating']], reader)\n", "trainset = data.build_full_trainset()\n", - "sim_options = {'name': 'cosine', 'user_based': False} # compute cosine similarities between items\n", + "sim_options = {'name': 'cosine', 'user_based': True} # compute cosine similarities between items\n", "algo = KNNBasic(sim_options=sim_options)\n", "algo.fit(trainset)\n", "pred = algo.predict(str(823519), str(30), r_ui=4, verbose=True)"