|
14 | 14 | "metadata": {}, |
15 | 15 | "source": [ |
16 | 16 | "# Installation\n", |
17 | | - "First things first, to install fuzzylogic, just use `python -m pip install fuzzylogic` and you should be good to go!" |
| 17 | + "First things first: To install fuzzylogic, just enter `python -m pip install fuzzylogic` and you should be good to go!" |
18 | 18 | ] |
19 | 19 | }, |
20 | 20 | { |
|
27 | 27 | "Why the distinction? Functions only map values, nothing special there at all - which is good for testing and performance. Sets on the other hand implement logical operations that have special python syntax, which makes it easy to work with but a little more difficult to test and adds some performance overhead. So, sets are for abstraction and easy handling, functions for performance.\n", |
28 | 28 | "\n", |
29 | 29 | "### Domains\n", |
30 | | - "You can use (I do so regularly) fuzzy functions outside any specific fuzzy context. However, if you want take advantage of the logic of fuzzy sets, plot stuff or defuzzyfy values, you need to use Domains. Domains and Sets are special in a way that they intrically rely on each other. This is enforced by how assignments work. Regular Domain attributes are the sets that were assigned to the domain. Also, if just a function is assigned it is automatically wrapped in a Set." |
| 30 | + "You can use (I do so regularly) fuzzy functions outside any specific fuzzy context. However, if you want to take advantage of the logic of fuzzy sets, plot stuff or defuzzyfy values, you need to use Domains. Domains and Sets are special in a way that they intrically rely on each other. This is enforced by how assignments work. Regular Domain attributes are the sets that were assigned to the domain. Also, if just a function is assigned it is automatically wrapped in a Set." |
31 | 31 | ] |
32 | 32 | }, |
33 | 33 | { |
34 | 34 | "cell_type": "code", |
35 | 35 | "execution_count": 1, |
36 | 36 | "metadata": { |
37 | 37 | "execution": { |
38 | | - "iopub.execute_input": "2021-05-27T12:45:07.171582Z", |
39 | | - "iopub.status.busy": "2021-05-27T12:45:07.171035Z", |
40 | | - "iopub.status.idle": "2021-05-27T12:45:07.738472Z", |
41 | | - "shell.execute_reply": "2021-05-27T12:45:07.737507Z", |
42 | | - "shell.execute_reply.started": "2021-05-27T12:45:07.171504Z" |
| 38 | + "iopub.execute_input": "2021-05-27T13:02:19.976123Z", |
| 39 | + "iopub.status.busy": "2021-05-27T13:02:19.975449Z", |
| 40 | + "iopub.status.idle": "2021-05-27T13:02:20.529960Z", |
| 41 | + "shell.execute_reply": "2021-05-27T13:02:20.528972Z", |
| 42 | + "shell.execute_reply.started": "2021-05-27T13:02:19.976029Z" |
43 | 43 | } |
44 | 44 | }, |
45 | 45 | "outputs": [], |
|
53 | 53 | "execution_count": 2, |
54 | 54 | "metadata": { |
55 | 55 | "execution": { |
56 | | - "iopub.execute_input": "2021-05-27T12:45:07.744125Z", |
57 | | - "iopub.status.busy": "2021-05-27T12:45:07.743698Z", |
58 | | - "iopub.status.idle": "2021-05-27T12:45:07.792900Z", |
59 | | - "shell.execute_reply": "2021-05-27T12:45:07.791900Z", |
60 | | - "shell.execute_reply.started": "2021-05-27T12:45:07.744066Z" |
| 56 | + "iopub.execute_input": "2021-05-27T13:02:20.534866Z", |
| 57 | + "iopub.status.busy": "2021-05-27T13:02:20.534460Z", |
| 58 | + "iopub.status.idle": "2021-05-27T13:02:20.580307Z", |
| 59 | + "shell.execute_reply": "2021-05-27T13:02:20.579116Z", |
| 60 | + "shell.execute_reply.started": "2021-05-27T13:02:20.534831Z" |
61 | 61 | } |
62 | 62 | }, |
63 | 63 | "outputs": [], |
|
73 | 73 | "execution_count": 3, |
74 | 74 | "metadata": { |
75 | 75 | "execution": { |
76 | | - "iopub.execute_input": "2021-05-27T12:45:07.795027Z", |
77 | | - "iopub.status.busy": "2021-05-27T12:45:07.794611Z", |
78 | | - "iopub.status.idle": "2021-05-27T12:45:08.158621Z", |
79 | | - "shell.execute_reply": "2021-05-27T12:45:08.157645Z", |
80 | | - "shell.execute_reply.started": "2021-05-27T12:45:07.794990Z" |
| 76 | + "iopub.execute_input": "2021-05-27T13:02:20.582752Z", |
| 77 | + "iopub.status.busy": "2021-05-27T13:02:20.582231Z", |
| 78 | + "iopub.status.idle": "2021-05-27T13:02:20.934617Z", |
| 79 | + "shell.execute_reply": "2021-05-27T13:02:20.933627Z", |
| 80 | + "shell.execute_reply.started": "2021-05-27T13:02:20.582701Z" |
81 | 81 | } |
82 | 82 | }, |
83 | 83 | "outputs": [ |
|
104 | 104 | "execution_count": 4, |
105 | 105 | "metadata": { |
106 | 106 | "execution": { |
107 | | - "iopub.execute_input": "2021-05-27T12:45:08.160581Z", |
108 | | - "iopub.status.busy": "2021-05-27T12:45:08.159977Z", |
109 | | - "iopub.status.idle": "2021-05-27T12:45:08.492115Z", |
110 | | - "shell.execute_reply": "2021-05-27T12:45:08.491130Z", |
111 | | - "shell.execute_reply.started": "2021-05-27T12:45:08.160543Z" |
| 107 | + "iopub.execute_input": "2021-05-27T13:02:20.936053Z", |
| 108 | + "iopub.status.busy": "2021-05-27T13:02:20.935660Z", |
| 109 | + "iopub.status.idle": "2021-05-27T13:02:21.252337Z", |
| 110 | + "shell.execute_reply": "2021-05-27T13:02:21.250984Z", |
| 111 | + "shell.execute_reply.started": "2021-05-27T13:02:20.936008Z" |
112 | 112 | } |
113 | 113 | }, |
114 | 114 | "outputs": [ |
|
135 | 135 | "execution_count": 5, |
136 | 136 | "metadata": { |
137 | 137 | "execution": { |
138 | | - "iopub.execute_input": "2021-05-27T12:45:08.494534Z", |
139 | | - "iopub.status.busy": "2021-05-27T12:45:08.493771Z", |
140 | | - "iopub.status.idle": "2021-05-27T12:45:08.844964Z", |
141 | | - "shell.execute_reply": "2021-05-27T12:45:08.843665Z", |
142 | | - "shell.execute_reply.started": "2021-05-27T12:45:08.494495Z" |
| 138 | + "iopub.execute_input": "2021-05-27T13:02:21.254511Z", |
| 139 | + "iopub.status.busy": "2021-05-27T13:02:21.254054Z", |
| 140 | + "iopub.status.idle": "2021-05-27T13:02:21.573991Z", |
| 141 | + "shell.execute_reply": "2021-05-27T13:02:21.572729Z", |
| 142 | + "shell.execute_reply.started": "2021-05-27T13:02:21.254460Z" |
143 | 143 | } |
144 | 144 | }, |
145 | 145 | "outputs": [ |
|
166 | 166 | "execution_count": 6, |
167 | 167 | "metadata": { |
168 | 168 | "execution": { |
169 | | - "iopub.execute_input": "2021-05-27T12:45:08.846944Z", |
170 | | - "iopub.status.busy": "2021-05-27T12:45:08.846398Z", |
171 | | - "iopub.status.idle": "2021-05-27T12:45:09.187473Z", |
172 | | - "shell.execute_reply": "2021-05-27T12:45:09.186104Z", |
173 | | - "shell.execute_reply.started": "2021-05-27T12:45:08.846907Z" |
| 169 | + "iopub.execute_input": "2021-05-27T13:02:21.575506Z", |
| 170 | + "iopub.status.busy": "2021-05-27T13:02:21.575123Z", |
| 171 | + "iopub.status.idle": "2021-05-27T13:02:21.895911Z", |
| 172 | + "shell.execute_reply": "2021-05-27T13:02:21.894896Z", |
| 173 | + "shell.execute_reply.started": "2021-05-27T13:02:21.575470Z" |
174 | 174 | } |
175 | 175 | }, |
176 | 176 | "outputs": [ |
|
204 | 204 | "execution_count": 7, |
205 | 205 | "metadata": { |
206 | 206 | "execution": { |
207 | | - "iopub.execute_input": "2021-05-27T12:45:09.189158Z", |
208 | | - "iopub.status.busy": "2021-05-27T12:45:09.188645Z", |
209 | | - "iopub.status.idle": "2021-05-27T12:45:09.534206Z", |
210 | | - "shell.execute_reply": "2021-05-27T12:45:09.533093Z", |
211 | | - "shell.execute_reply.started": "2021-05-27T12:45:09.189112Z" |
| 207 | + "iopub.execute_input": "2021-05-27T13:02:21.897113Z", |
| 208 | + "iopub.status.busy": "2021-05-27T13:02:21.896718Z", |
| 209 | + "iopub.status.idle": "2021-05-27T13:02:22.244371Z", |
| 210 | + "shell.execute_reply": "2021-05-27T13:02:22.242964Z", |
| 211 | + "shell.execute_reply.started": "2021-05-27T13:02:21.897078Z" |
212 | 212 | } |
213 | 213 | }, |
214 | 214 | "outputs": [ |
|
255 | 255 | "execution_count": 8, |
256 | 256 | "metadata": { |
257 | 257 | "execution": { |
258 | | - "iopub.execute_input": "2021-05-27T12:45:09.537990Z", |
259 | | - "iopub.status.busy": "2021-05-27T12:45:09.537199Z", |
260 | | - "iopub.status.idle": "2021-05-27T12:45:09.905933Z", |
261 | | - "shell.execute_reply": "2021-05-27T12:45:09.904494Z", |
262 | | - "shell.execute_reply.started": "2021-05-27T12:45:09.537952Z" |
| 258 | + "iopub.execute_input": "2021-05-27T13:02:22.249176Z", |
| 259 | + "iopub.status.busy": "2021-05-27T13:02:22.248637Z", |
| 260 | + "iopub.status.idle": "2021-05-27T13:02:22.694953Z", |
| 261 | + "shell.execute_reply": "2021-05-27T13:02:22.693588Z", |
| 262 | + "shell.execute_reply.started": "2021-05-27T13:02:22.249128Z" |
263 | 263 | } |
264 | 264 | }, |
265 | 265 | "outputs": [ |
266 | 266 | { |
267 | 267 | "data": { |
268 | 268 | "text/plain": [ |
269 | | - "{Set(<function minus.<locals>.f at 0x7f1d625a69d0>): 0.5443310539518174,\n", |
270 | | - " Set(<function very.<locals>.f at 0x7f1d625a6b80>): 0.6400000000000001,\n", |
271 | | - " Set(<function bounded_sum.<locals>.f at 0x7f1d624f1160>): 0.8359591794226543}" |
| 269 | + "{Set(<function minus.<locals>.f at 0x7fddde5e7280>): 0.5443310539518174,\n", |
| 270 | + " Set(<function very.<locals>.f at 0x7fddde5e7790>): 0.6400000000000001,\n", |
| 271 | + " Set(<function bounded_sum.<locals>.f at 0x7fddde4f0160>): 0.8359591794226543}" |
272 | 272 | ] |
273 | 273 | }, |
274 | 274 | "execution_count": 8, |
|
314 | 314 | "execution_count": 9, |
315 | 315 | "metadata": { |
316 | 316 | "execution": { |
317 | | - "iopub.execute_input": "2021-05-27T12:45:09.908524Z", |
318 | | - "iopub.status.busy": "2021-05-27T12:45:09.907811Z", |
319 | | - "iopub.status.idle": "2021-05-27T12:45:10.257676Z", |
320 | | - "shell.execute_reply": "2021-05-27T12:45:10.256627Z", |
321 | | - "shell.execute_reply.started": "2021-05-27T12:45:09.908486Z" |
| 317 | + "iopub.execute_input": "2021-05-27T13:02:22.697889Z", |
| 318 | + "iopub.status.busy": "2021-05-27T13:02:22.697239Z", |
| 319 | + "iopub.status.idle": "2021-05-27T13:02:23.034827Z", |
| 320 | + "shell.execute_reply": "2021-05-27T13:02:23.033817Z", |
| 321 | + "shell.execute_reply.started": "2021-05-27T13:02:22.697824Z" |
322 | 322 | } |
323 | 323 | }, |
324 | 324 | "outputs": [ |
325 | 325 | { |
326 | 326 | "data": { |
327 | 327 | "text/plain": [ |
328 | | - "{Set(<function bounded_sigmoid.<locals>.f at 0x7f1d62667af0>): 0.5,\n", |
329 | | - " Set(<function bounded_sigmoid.<locals>.f at 0x7f1d623029d0>): 0.012195121951219511,\n", |
330 | | - " Set(<function MIN.<locals>.F at 0x7f1d6228a040>): 0.5}" |
| 328 | + "{Set(<function bounded_sigmoid.<locals>.f at 0x7fde080d73a0>): 0.5,\n", |
| 329 | + " Set(<function bounded_sigmoid.<locals>.f at 0x7fddde303b80>): 0.012195121951219511,\n", |
| 330 | + " Set(<function MIN.<locals>.F at 0x7fddde28a1f0>): 0.5}" |
331 | 331 | ] |
332 | 332 | }, |
333 | 333 | "execution_count": 9, |
|
373 | 373 | "execution_count": 10, |
374 | 374 | "metadata": { |
375 | 375 | "execution": { |
376 | | - "iopub.execute_input": "2021-05-27T12:45:10.259121Z", |
377 | | - "iopub.status.busy": "2021-05-27T12:45:10.258719Z", |
378 | | - "iopub.status.idle": "2021-05-27T12:45:10.596479Z", |
379 | | - "shell.execute_reply": "2021-05-27T12:45:10.594003Z", |
380 | | - "shell.execute_reply.started": "2021-05-27T12:45:10.259083Z" |
| 376 | + "iopub.execute_input": "2021-05-27T13:02:23.036527Z", |
| 377 | + "iopub.status.busy": "2021-05-27T13:02:23.036156Z", |
| 378 | + "iopub.status.idle": "2021-05-27T13:02:23.353576Z", |
| 379 | + "shell.execute_reply": "2021-05-27T13:02:23.352746Z", |
| 380 | + "shell.execute_reply.started": "2021-05-27T13:02:23.036493Z" |
381 | 381 | } |
382 | 382 | }, |
383 | 383 | "outputs": [ |
|
430 | 430 | "execution_count": 11, |
431 | 431 | "metadata": { |
432 | 432 | "execution": { |
433 | | - "iopub.execute_input": "2021-05-27T12:45:10.599499Z", |
434 | | - "iopub.status.busy": "2021-05-27T12:45:10.598639Z", |
435 | | - "iopub.status.idle": "2021-05-27T12:45:10.620447Z", |
436 | | - "shell.execute_reply": "2021-05-27T12:45:10.618738Z", |
437 | | - "shell.execute_reply.started": "2021-05-27T12:45:10.599433Z" |
| 433 | + "iopub.execute_input": "2021-05-27T13:02:23.355445Z", |
| 434 | + "iopub.status.busy": "2021-05-27T13:02:23.355027Z", |
| 435 | + "iopub.status.idle": "2021-05-27T13:02:23.370308Z", |
| 436 | + "shell.execute_reply": "2021-05-27T13:02:23.369033Z", |
| 437 | + "shell.execute_reply.started": "2021-05-27T13:02:23.355410Z" |
438 | 438 | } |
439 | 439 | }, |
440 | 440 | "outputs": [ |
|
486 | 486 | "execution_count": 12, |
487 | 487 | "metadata": { |
488 | 488 | "execution": { |
489 | | - "iopub.execute_input": "2021-05-27T12:45:10.623708Z", |
490 | | - "iopub.status.busy": "2021-05-27T12:45:10.622975Z", |
491 | | - "iopub.status.idle": "2021-05-27T12:45:10.750231Z", |
492 | | - "shell.execute_reply": "2021-05-27T12:45:10.748779Z", |
493 | | - "shell.execute_reply.started": "2021-05-27T12:45:10.623656Z" |
| 489 | + "iopub.execute_input": "2021-05-27T13:02:23.372313Z", |
| 490 | + "iopub.status.busy": "2021-05-27T13:02:23.371791Z", |
| 491 | + "iopub.status.idle": "2021-05-27T13:02:23.476438Z", |
| 492 | + "shell.execute_reply": "2021-05-27T13:02:23.475603Z", |
| 493 | + "shell.execute_reply.started": "2021-05-27T13:02:23.372267Z" |
494 | 494 | } |
495 | 495 | }, |
496 | 496 | "outputs": [ |
|
0 commit comments