Skip to content

Commit

Permalink
linear_regression_intro WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
daslu committed Dec 11, 2024
1 parent 59aa280 commit f89fff0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions notebooks/noj_book/linear_regression_intro.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit f89fff0

Please sign in to comment.