(defn nway-new [n D trainer tester distance] (let [pro-folds (folds D n)] (loop [fold pro-folds result []] (if (empty? fold) result (recur (rest fold) (conj result (let [training (:train (first fold)) tests (:test (first fold)) model (trainer training) want-got (apply vector (map #(tester % model) ;(first model)) (if (= (nrow tests) 1) [tests] tests))) answer (conj (Transpose want-got) (count model)) testdata (bind-columns (sel tests :cols (range 0 (- (ncol tests) 1))) (matrix (second answer))) brittle? (brittleness testdata D model distance)] (conj answer brittle?))))))))