select-append and project-attributes filters

This commit is contained in:
Antonio Garrote 2010-03-04 17:05:33 +01:00
parent 8facf1dfe2
commit df2fe1913f

View file

@ -76,6 +76,23 @@
cols-val-a)]
(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
@ -112,6 +129,14 @@
([kind options]
(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
(defn filter-apply