001 (ns org.clojars.punit-naik.clj-ml.utils.calculus)
002
003 (defn derivative
004 "Finds the derivative of a function ax^n+bx^n-1+...+z represented as a
005 Collection of it's coefficients [a b ... z]"
006 [eq]
007 (map-indexed
008 (fn [idx coeff]
009 (* coeff (dec (- (count eq) idx))))
010 (butlast eq)))