-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpful_code.py
More file actions
43 lines (36 loc) · 2.75 KB
/
Copy pathSimpful_code.py
File metadata and controls
43 lines (36 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# WARNING: this source code was automatically generated by pyFUME.
from simpful import *
FS = FuzzySystem(show_banner=False)
RULE1 = "IF (test IS cluster1) AND (symptoms IS cluster1) AND (action IS cluster1) THEN (OUTPUT IS fun1)"
RULE2 = "IF (test IS cluster2) AND (symptoms IS cluster2) AND (action IS cluster2) THEN (OUTPUT IS fun2)"
RULE3 = "IF (test IS cluster3) AND (symptoms IS cluster3) AND (action IS cluster3) THEN (OUTPUT IS fun3)"
RULE4 = "IF (test IS cluster4) AND (symptoms IS cluster4) AND (action IS cluster4) THEN (OUTPUT IS fun4)"
RULE5 = "IF (test IS cluster5) AND (symptoms IS cluster5) AND (action IS cluster5) THEN (OUTPUT IS fun5)"
FS.add_rules([RULE1, RULE2, RULE3, RULE4, RULE5])
FS.set_output_function('fun1', '0.25874549216184906+0.1393570713014261*test+0.3676521942463138*symptoms+-0.046018941491069026*action')
FS.set_output_function('fun2', '0.0+0.0*test+0.0*symptoms+0.0*action')
FS.set_output_function('fun3', '0.0+0.0*test+0.0*symptoms+0.0*action')
FS.set_output_function('fun4', '0.26707974977556664+0.2782421222732067*test+0.244443003334663*symptoms+-0.07281625397720518*action')
FS.set_output_function('fun5', '0.30430489038372865+0.13648165842033622*test+0.2920515283073658*symptoms+-0.06230257014768725*action')
FS_1 = FuzzySet(function=Gaussian_MF(0.330119, 0.230323), term='cluster1')
FS_2 = FuzzySet(function=Gaussian_MF(0.592408, 0.237525), term='cluster2')
FS_3 = FuzzySet(function=Gaussian_MF(0.280195, 0.188279), term='cluster3')
FS_4 = FuzzySet(function=Gaussian_MF(0.667563, 0.221680), term='cluster4')
FS_5 = FuzzySet(function=Gaussian_MF(0.390997, 0.211564), term='cluster5')
MF_test = LinguisticVariable([FS_1, FS_2, FS_3, FS_4, FS_5], concept='test')
FS.add_linguistic_variable('test', MF_test)
FS_6 = FuzzySet(function=Gaussian_MF(0.284875, 0.282021), term='cluster1')
FS_7 = FuzzySet(function=Gaussian_MF(0.698060, 0.254512), term='cluster2')
FS_8 = FuzzySet(function=Gaussian_MF(0.254946, 0.175349), term='cluster3')
FS_9 = FuzzySet(function=Gaussian_MF(0.770375, 0.225116), term='cluster4')
FS_10 = FuzzySet(function=Gaussian_MF(0.477521, 0.185142), term='cluster5')
MF_symptoms = LinguisticVariable([FS_6, FS_7, FS_8, FS_9, FS_10], concept='symptoms')
FS.add_linguistic_variable('symptoms', MF_symptoms)
FS_11 = FuzzySet(function=Gaussian_MF(-0.467210, 0.719215), term='cluster1')
FS_12 = FuzzySet(function=Gaussian_MF(0.408214, 0.000246), term='cluster2')
FS_13 = FuzzySet(function=Gaussian_MF(0.639749, 0.000290), term='cluster3')
FS_14 = FuzzySet(function=Gaussian_MF(1.324844, 0.681573), term='cluster4')
FS_15 = FuzzySet(function=Gaussian_MF(1.643691, 0.837915), term='cluster5')
MF_action = LinguisticVariable([FS_11, FS_12, FS_13, FS_14, FS_15], concept='action')
FS.add_linguistic_variable('action', MF_action)
# end of automatically generated code #