File tree 3 files changed +25
-15
lines changed
3 files changed +25
-15
lines changed Original file line number Diff line number Diff line change 4
4
:license {:name " Eclipse Public License"
5
5
:url " http://www.eclipse.org/legal/epl-v10.html" }
6
6
:dependencies [[org.clojure/clojure " 1.10.1-beta2" ]
7
- [techascent/tech.ml " 1.0-alpha3 " ]]
7
+ [techascent/tech.ml " 1.0-alpha4 " ]]
8
8
9
9
:profiles {:dev {:dependencies [[org.clojure/tools.logging " 0.3.1" ]
10
10
[ch.qos.logback/logback-classic " 1.1.3" ]]}})
Original file line number Diff line number Diff line change 4
4
[tech.ml.dataset :as ml-dataset]
5
5
[tech.ml.loss :as loss]
6
6
[tech.libs.xgboost]
7
+ [tech.v2.datatype :as dtype]
7
8
[tech.libs.smile.classification]
8
9
[tech.libs.svm]
9
- [clojure.core.matrix :as m]
10
10
[taoensso.nippy :as nippy]
11
11
[tech.io :as io]))
12
12
27
27
(ml-dataset/ds-concat train-ds test-ds)
28
28
train-ds)]
29
29
(->> base-systems
30
- (mapcat (fn [opts]
31
- (let [gs-options (ml/auto-gridsearch-options opts)]
32
- (println (format " Dataset: %s, Model: %s" name (:model-type opts)))
33
- (->> (ml/gridsearch (merge options gs-options
34
- {:k-fold (if (> (first (m/shape train-ds)) 200 )
35
- 5
36
- 3 )
37
- :gridsearch-depth 75 })
38
- loss/classification-loss
39
- train-ds)
40
- (map (partial merge (dissoc base-dataset :test-ds :train-ds :options )))))))
30
+ (mapcat
31
+ (fn [opts]
32
+ (let [gs-options (ml/auto-gridsearch-options opts)]
33
+ (println (format " Dataset: %s, Model: %s"
34
+ name (:model-type opts)))
35
+ (->> (ml/gridsearch
36
+ (merge options gs-options
37
+ {:k-fold (if (> (first (dtype/shape train-ds))
38
+ 200 )
39
+ 5
40
+ 3 )
41
+ :gridsearch-depth 75 })
42
+ loss/classification-loss
43
+ train-ds)
44
+ (map (partial merge (dissoc base-dataset
45
+ :test-ds :train-ds
46
+ :options )))))))
41
47
(sort-by :average-loss )
42
48
(take 15 )))})))))
43
49
Original file line number Diff line number Diff line change 5
5
[tech.ml.dataset.svm :as svm]
6
6
[tech.ml.dataset :as ds]
7
7
[tech.ml.dataset.pipeline :as dsp]
8
+ [tech.ml.dataset.pipeline.pipeline-operators
9
+ :refer [without-recording
10
+ pipeline-train-context
11
+ pipeline-inference-context]]
8
12
[tech.ml.dataset.column :as ds-col]
9
13
[tech.v2.datatype :as dtype]))
10
14
36
40
(time
37
41
(let [{train-ds :dataset
38
42
train-context :context }
39
- (dsp/ pipeline-train-context
43
+ (pipeline-train-context
40
44
(-> (svm/parse-svm-file train-fname :label-map label-map)
41
45
svm-pipeline))
42
46
{test-ds :dataset } (when test-fname
43
- (dsp/ pipeline-inference-context
47
+ (pipeline-inference-context
44
48
train-context
45
49
(-> (svm/parse-svm-file test-fname :label-map label-map)
46
50
svm-pipeline)))]
You can’t perform that action at this time.
0 commit comments