(defun RDR2 (testTbl trainTbl &key (RuleGenerator #'GenerateRuleMatchNB)) (let* ((traindata (cross-index trainTbl)) (ruleset (make-RDRule :comment "" :class (xindex-majority-class traindata) :fn #'(lambda (x) (not (null x)))))) (dolist (row (counted-all (table-all trainTbl))) (multiple-value-bind (prediction endruleset) (MakePrediction ruleset row) (if (funcall (RDRule-fn endruleset) row) (if (not (equal prediction (eg-class row))) (setf (RDRule-true endruleset) (make-RDRule :comment (concatenate 'string (RDRule-comment endruleset) "t"))) ) (print "patch false"))))))