From baa5d425bff780bc7b4e8943d18fc8990109fe7b Mon Sep 17 00:00:00 2001 From: noah Date: Sun, 12 Feb 2023 18:59:05 -0600 Subject: [PATCH] 14.1 of LP3 edits --- Schrick-Noah_Learning-Practice-3.ipynb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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)"