Skip to content

Commit

Permalink
ns cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
daslu committed Dec 13, 2024
1 parent 018de5d commit 29c4019
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions notebooks/noj_book/linear_regression_intro.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
[tablecloth.api :as tc]
[tablecloth.column.api :as tcc]
[tech.v3.datatype.datetime :as datetime]
[tech.v3.dataset.modelling :as dsmod]
[scicloj.metamorph.ml :as ml]
[tech.v3.dataset.modelling :as ds-mod]
[fastmath.ml.regression :as reg]
[scicloj.kindly.v4.kind :as kind]))

Expand Down Expand Up @@ -111,18 +110,18 @@ totals-with-day-of-week
totals-with-day-of-week
days-of-week)
(tc/drop-columns [:day-of-week])
(dsmod/set-inference-target :total)))
(ds-mod/set-inference-target :total)))

(-> totals-with-one-hot-days-of-week
(tc/select-columns dsmod/inference-column?))
(tc/select-columns ds-mod/inference-column?))

;; Let us compute the linear regression model using Fastmath.
;; We will use this wrapper function that handles a dataset
;; (a concept which is unknown to Fastmath):

(defn lm [dataset options]
(let [inference-column-name (-> dataset
dsmod/inference-target-column-names
ds-mod/inference-target-column-names
first)
ds-without-target (-> dataset
(tc/drop-columns [inference-column-name]))]
Expand Down

0 comments on commit 29c4019

Please sign in to comment.