(defun makeDataFiles (data1 data2 statFunc dataset ruleselector) (sh "/bin/bash" "-c" "rm makecharts/data/*.rdr") (let ((num) (stat1) (stat2) (ndata1) (ndata2) (class) (count -1) (temp)) (dolist (x (car data1)) ; get the first item in the list (progn (incf count) ;increment the postion counter (setf num (car x)) ;gets the itteration number ;maybe put in a check to make sure the number of folds matches? (setf ndata1 (remove num x)) (setf ndata2 (copy-list data2)) ;(format t "x = ~A~% at postion = ~A~% ndata1 = ~A~% ndata2 = ~A~%" x count ndata1 ndata2) ;(format t " cdr data1 = ~A Length of ~A~%" (cdr data1) (length (cdr data1))) (dolist (y ndata1) (progn (if (equal (setf class (abcd-for y)) '?) (setf class "Unknown")) (with-open-file (out (format nil "makecharts/data/~A.rdr" class) :direction :output :if-does-not-exist :create :if-exists :append) (progn (setf stat1 (funcall statFunc y)) ;store the stat (setf stat2 (find (abcd-for y) ndata2 :key #'(lambda (x) (abcd-for x)))) (setf stat2 (if stat2 (funcall statFunc stat2) 0)) ;(format t " About to print~%") (format out "~A ~A" num (fround stat2 3)) ;print baseline to end of file (format out " ~A " (fround stat1 3)) ;print number and first start to file (dolist (z (cdr data1));being cycle through inner (progn (setf temp (nth count z)) (format out "~A " (fround (funcall statFunc (find (abcd-for y) (remove num temp) :key #'(lambda (x) (abcd-for x))))) 3) )) ;end cycle through inner (format out "~%") ;(pop ndata2) )));Print the info line ;(pop data2) ;(format t "new data1: ~A~%" data1) ;true degug line ))))(plot_data dataset ruleselector) )