Takes a linear-model and an x value (either a scalar or vector)
and returns the predicted value based on the linear-model.
(defn predict
"Takes a linear-model and an x value (either a scalar or vector)
and returns the predicted value based on the linear-model."
([model x]
(let [predictor (if (coll? x)
(cons 1 x)
[1 x])]
(mmult (trans (:coefs model))
predictor))))
Comments top
No comments for predict. Log in to add a comment.