select-append and project-attributes filters
This commit is contained in:
parent
8facf1dfe2
commit
df2fe1913f
1 changed files with 25 additions and 0 deletions
|
@ -76,6 +76,23 @@
|
||||||
cols-val-a)]
|
cols-val-a)]
|
||||||
(into-array cols-val-b))))
|
(into-array cols-val-b))))
|
||||||
|
|
||||||
|
(defmethod make-filter-options :select-append-attributes
|
||||||
|
([kind map]
|
||||||
|
(let [cols (get map :attributes)
|
||||||
|
pre-cols (reduce #(str %1 "," (+ %2 1)) "" cols)
|
||||||
|
cols-val-a ["-R" (.substring pre-cols 1 (.length pre-cols))]
|
||||||
|
cols-val-b (check-options {:invert "-V"}
|
||||||
|
map
|
||||||
|
cols-val-a)]
|
||||||
|
(into-array cols-val-b))))
|
||||||
|
|
||||||
|
(defmethod make-filter-options :project-attributes
|
||||||
|
([kind options]
|
||||||
|
(let [opts (if (nil? (:invert options))
|
||||||
|
(conj options {:invert true})
|
||||||
|
(dissoc options :invert))]
|
||||||
|
(make-filter-options :remove-attributes opts))))
|
||||||
|
|
||||||
|
|
||||||
;; Creation of filters
|
;; Creation of filters
|
||||||
|
|
||||||
|
@ -112,6 +129,14 @@
|
||||||
([kind options]
|
([kind options]
|
||||||
(make-filter-m kind options weka.filters.unsupervised.attribute.Remove)))
|
(make-filter-m kind options weka.filters.unsupervised.attribute.Remove)))
|
||||||
|
|
||||||
|
(defmethod make-filter :select-append-attributes
|
||||||
|
([kind options]
|
||||||
|
(make-filter-m kind options weka.filters.unsupervised.attribute.Copy)))
|
||||||
|
|
||||||
|
(defmethod make-filter :project-attributes
|
||||||
|
([kind options]
|
||||||
|
(make-filter-m kind options weka.filters.unsupervised.attribute.Remove)))
|
||||||
|
|
||||||
;; Processing the filtering of data
|
;; Processing the filtering of data
|
||||||
|
|
||||||
(defn filter-apply
|
(defn filter-apply
|
||||||
|
|
Loading…
Reference in a new issue