(defun newN-way (n tbl &key trainer tester (reporter #'newdefault-reporter) (finale #'newdefault-finale) (verbose t)) (let ((folds (folds (table-egs tbl) n :pred 'lt :key #'(lambda (x) (isa x tbl)))) reports cautions (make-caution)) (dolist (fold folds) (let* ((training (counted-all (fold-train fold))) (tests (counted-all (fold-test fold))) (tbl1 (table-copy tbl training)) (model (funcall trainer tbl1 cautions training)) (treports (list))) (dolist (test tests) (let* ((tested (funcall tester tbl1 cautions model test)) (reported (funcall reporter tbl1 cautions tested))) (push reported treports))) (push treports reports))) ;(print reports) ;(print "") (funcall finale tbl cautions reports verbose n))) (defun newdefault-reporter (tbl cautions test-result) (declare (ignore tbl cautions)) test-result) (defun newdefault-finale (tbl cautions reports verbose n) (declare (ignore tbl cautions)) (let ((i 0)) (mapcar #'(lambda (x) ;(abcd-stats x :verbose verbose) ;(cons (floor (* (/ (length (table-egs (funcall (table-name tbl)))) n)) (incf i)) (abcd-stats x :verbose verbose))) (cons (incf i) (abcd-stats x :verbose verbose))) reports)))