Combined with the square() function from previously today one now has the ability to do such things as the following:
; sub-list, a function to subtract one list from the other
(define (sub-list xlist ylist)
(let* ((blah (list 'head)))
(let iter ((i 0))
(if (>= i (length xlist)) (cdr blah)
(begin
(set! blah
(append blah
(list (- (list-ref xlist i)
(list-ref ylist i)))))
(iter (+ i 1)))))))
; sum of squares
(define (sum-of-squares xlist)
(let* ((sum 0))
(for-each (lambda (x) (set! sum (+ sum (square x))))
xlist) sum))
; n-euclidean distance
(define (n-euclidean n n1)
(/ 1 (sqrt
(sum-of-squares
(sub-list n n1))) 1)))
- Use a standardised list of questions to create "compatibility" charts
- Use this as a performance metric - using the final result as a range from 0-1.0 with regards to predictions vs realities
- Plot the distance between objects in n-dimensional space
#2 is used in Build Your Own Expert System which is a book I have read, marked up, and re-read so many times it is looking very much worse for the wear.
#3 - well how many n-dimensional spaces do you know?
No comments:
Post a Comment