Monday

FuzzyCLIPS: Certainty Factor example

Enter the following code statement-by-statement in the FuzzyCLIPS's Dialog Window:

FuzzyCLIPS> (defrule organism-is-streptococcus
(declare (CF 0.7))
(stain positive)
(morphology coccus)
(growth chains)
=>
(assert (organism streptococcus))
)

FuzzyCLIPS> (assert (stain positive) CF 0.5)
FuzzyCLIPS> (assert (morphology coccus) CF 0.6)
FuzzyCLIPS> (assert (growth chains) CF 0.3)

FuzzyCLIPS> (run)
FuzzyCLIPS> (facts)
f-0     (stain positive) CF 0.50
f-1     (morphology coccus) CF 0.60
f-2     (growth chains) CF 0.30
f-3     (organism streptococcus) CF 0.21
For a total of 4 facts.

The certainty factor of the conclusion using hand calculations
= min(0,5,0.6,0.3) * 0.7
= 0.3 * 0.7 = 0.21

No comments:

Measure execution time with Julia, example using sorting algorithms

# random integers between 1 and 100 inclusive, generate thousands of them x = rand ( 1 : 100 , 100000 ) @time sort (x; alg=InsertionSort, r...