From f89fff0ee1bab03a75afd89eedb92045b86a6ac4 Mon Sep 17 00:00:00 2001 From: daslu Date: Thu, 12 Dec 2024 00:15:17 +0200 Subject: [PATCH] linear_regression_intro WIP --- notebooks/noj_book/linear_regression_intro.clj | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/notebooks/noj_book/linear_regression_intro.clj b/notebooks/noj_book/linear_regression_intro.clj index 5ee33cd..c4199c6 100644 --- a/notebooks/noj_book/linear_regression_intro.clj +++ b/notebooks/noj_book/linear_regression_intro.clj @@ -121,11 +121,13 @@ totals-with-one-hot-days-of-week ;; bike count for the corresponding day of week. (def fit - (reg/lm (:total totals-with-one-hot-days-of-week) - (-> totals-with-one-hot-days-of-week - (tc/drop-columns [:total]) - tc/rows) - {:intercept? false})) + (let [data-without-target (-> totals-with-one-hot-days-of-week + (tc/drop-columns [:total]))] + data-without-target + (reg/lm (:total totals-with-one-hot-days-of-week) + (tc/rows data-without-target) + {:intercept? false + :names (vec (tc/column-names data-without-target))}))) ;; Here are the regression results: