File:MYCIN certainty factors combination.svg
From testwiki
Jump to navigation
Jump to search
Original file (SVG file, nominally 768 × 768 pixels, file size: 61 KB)
Contents
This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.
Summary
| DescriptionMYCIN certainty factors combination.svg |
English: MYCIN certainty factors combination contour plot.
Matplotlibimport numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import TwoSlopeNorm
def cf_combine(x, y):
"""MYCIN certainty factor combination formula"""
if x > 0 and y > 0:
return x + y - x*y
elif x < 0 and y < 0:
return x + y + x*y
else:
min_abs = min(abs(x), abs(y))
if min_abs == 1: # Handle division by zero case
return np.nan
return (x + y)/(1 - min_abs)
# Create a grid of x and y values
n = 200
x = np.linspace(-1, 1, n)
y = np.linspace(-1, 1, n)
X, Y = np.meshgrid(x, y)
# Calculate Z values using the combination formula
Z = np.zeros((n, n))
for i in range(n):
for j in range(n):
Z[i, j] = cf_combine(X[i, j], Y[i, j])
# Create figure and axes with 1:1 aspect ratio
fig, ax = plt.subplots(figsize=(8, 8))
# Contour plot
levels = np.linspace(-1, 1, 21)
im = ax.contour(X, Y, Z, levels=levels, cmap='RdBu')
ax.clabel(im, inline=True, fontsize=8)
ax.set_title('Contour Plot of MYCIN Certainty Factor Combination')
ax.grid(True, linestyle='--', alpha=0.6)
ax.axhline(y=0, color='k', linestyle='-', alpha=0.3)
ax.axvline(x=0, color='k', linestyle='-', alpha=0.3)
ax.set_aspect('equal') # Ensure 1:1 aspect ratio
plt.tight_layout()
plt.savefig('mycin_cf_combine.svg')
plt.show() |
| Date | |
| Source | Own work |
| Author | Cosmia Nebula |
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Captions
Add a one-line explanation of what this file represents
Items portrayed in this file
depicts
some value
3 November 2024
62,696 byte
image/svg+xml
d6a936ee48919a3a5c0aa5070b87d1c2599f691d
File history
Click on a date/time to view the file as it appeared at that time.
| Date/Time | Thumbnail | Dimensions | User | Comment | |
|---|---|---|---|---|---|
| current | 22:22, 3 November 2024 | 768 × 768 (61 KB) | wikimediacommons>Cosmia Nebula | Uploaded while editing "Mycin" on en.wikipedia.org |
File usage
There are no pages that use this file.