diff --git a/src/propeller/core.cljc b/src/propeller/core.cljc index 2a500f2..bced168 100755 --- a/src/propeller/core.cljc +++ b/src/propeller/core.cljc @@ -7,7 +7,11 @@ (defn eval-problem-var [problem-name var-name] - (eval (symbol (str "propeller.problems." problem-name "/" var-name)))) + (eval (symbol (str "propeller.problems." problem-name "/" var-name))) + ;; Overload 2: PSB specific + ;; Passes into eval + [problem-name var-name PSB2-name] + ((eval (symbol (str "propeller.problems." problem-name "/" var-name))) PSB2-name)) (defn -main "Runs propel-gp, giving it a map of arguments." @@ -24,7 +28,15 @@ (spit "PSB2_path.txt" (second args)) (println (str "Set path to PSB2 as " (second args))) (System/exit 1)) - + + ;; Creates PSB2 problems + (when (= (first args) "PSB2") + ;; For tomorrow, Figure out what this does? + (require (symbol (str "propeller.problems.PSB2" (first args)))) + ;; For tomorrow, add the gp/gp function here + ;; --- + + ;; Creates regular problems (require (symbol (str "propeller.problems." (first args)))) (gp/gp diff --git a/src/propeller/problems/PSB2_Problems.cljc b/src/propeller/problems/PSB2_Problems.cljc index 9f7b273..fea00c9 100644 --- a/src/propeller/problems/PSB2_Problems.cljc +++ b/src/propeller/problems/PSB2_Problems.cljc @@ -1,3 +1,15 @@ (ns propeller.problems.PSB2-Problems (:require [psb2.core :as psb2])) +;; Get path from text file +(def PSB2-path (slurp "PSB2_path.txt")) + +(defn train-and-test + "Returns the train and test sets from PSB2 using Prof. Helmuth's function" + ;; Default to 200 train and 2000 test + [problem] + (psb2/fetch-examples PSB2-path problem 200 2000) + ;; To with 2 extra args, can customise train and test set sizes + [problem train test] + (psb2/fetch-examples PSB2-path problem train test)) + diff --git a/src/propeller/problems/simple_regression.cljc b/src/propeller/problems/simple_regression.cljc index a8c4993..94508cf 100755 --- a/src/propeller/problems/simple_regression.cljc +++ b/src/propeller/problems/simple_regression.cljc @@ -72,3 +72,8 @@ :errors errors :total-error #?(:clj (apply +' errors) :cljs (apply + errors)))))) + + +(defn test-thingy + [x] + (println x))