Skip to content

Commit

Permalink
Updated sasrec tutorial.
Browse files Browse the repository at this point in the history
  • Loading branch information
Семенов Андрей Максимович committed Oct 1, 2024
1 parent b9526b2 commit aedf89d
Show file tree
Hide file tree
Showing 2 changed files with 374 additions and 195 deletions.
15 changes: 4 additions & 11 deletions examples/sasrec_metrics_comp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1280,17 +1280,17 @@
"RANDOM_STATE = 32\n",
"ITERATIONS = 10\n",
"\n",
"def make_base_model(factors: int, regularization: float, alpha: float, fit_features_together: bool=False):\n",
"def make_base_model(factors: int, regularization: float, alpha: float, fit_features_together: bool = False):\n",
" return ImplicitALSWrapperModel(\n",
" AlternatingLeastSquares(\n",
" factors=factors,\n",
" regularization=regularization,\n",
" alpha=alpha,\n",
" random_state=RANDOM_STATE,\n",
" use_gpu=False,\n",
" num_threads = NUM_THREADS,\n",
" num_threads=NUM_THREADS,\n",
" iterations=ITERATIONS),\n",
" fit_features_together = fit_features_together,\n",
" fit_features_together=fit_features_together,\n",
" )"
]
},
Expand Down Expand Up @@ -1335,7 +1335,7 @@
}
],
"source": [
"model = make_base_model(factors = n_factors, regularization=regularization, alpha=alpha, fit_features_together=True)\n",
"model = make_base_model(factors=n_factors, regularization=regularization, alpha=alpha, fit_features_together=True)\n",
"model.fit(dataset_full_features)\n",
"recos = model.recommend(\n",
" users=test_users.astype(int),\n",
Expand Down Expand Up @@ -1513,13 +1513,6 @@
"features_df"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
Loading

0 comments on commit aedf89d

Please sign in to comment.