Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Split basis functions into their own module

  • Loading branch information...
commit d355501b2fef6b302a9899b23bf9174bd9f02a2b 1 parent bc44d9f
@batterseapower authored
View
7 Algorithms/MachineLearning/BasisFunctions.hs
@@ -0,0 +1,7 @@
+module Algorithms.MachineLearning.BasisFunctions where
+
+import Algorithms.MachineLearning.Utilities
+
+
+normalGaussianBasis :: Double -> Double -> Double -> Double
+normalGaussianBasis mean scale x = exp (negate $ (square (x - mean)) / (2 * (square scale)))
View
4 Algorithms/MachineLearning/Tests/Driver.hs
@@ -1,5 +1,6 @@
module Main where
+import Algorithms.MachineLearning.BasisFunctions
import Algorithms.MachineLearning.Framework
import Algorithms.MachineLearning.LinearAlgebra
import Algorithms.MachineLearning.LinearRegression
@@ -10,9 +11,6 @@ import GNUPlot
import System.Cmd
-normalGaussianBasis :: Double -> Double -> Double -> Double
-normalGaussianBasis mean scale x = exp (negate $ (square (x - mean)) / (2 * (square scale)))
-
basisFunctions :: [Double -> Double]
basisFunctions = const 1 : map (\mean -> normalGaussianBasis (rationalToDouble mean) 0.2) [-1,-0.9..1]
Please sign in to comment.
Something went wrong with that request. Please try again.