-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect plotting in FuzzySystem plot_surface method #30
Comments
After reviewing the issue in detail and exploring the relevant documentation, I have identified the cause of the problem and a few potential solutions. The issue with the Specifically, the method currently constructs the surface data Cause of the issueThe problematic loop in the current code is as follows: for a in A:
temp = []
for b in B:
self.set_variable(v1, a)
self.set_variable(v2, b)
res = self.inference()[output]
temp.append(res)
C.append(temp)
C = array(C)
A, B = meshgrid(A, B) Here, as described above, the variable Possible solutionsI found three ways to fix it, that with some testings seemed to be reasonable. Change the indexing in `meshgrid``We can fix the issue by changing the indexing mode in the meshgrid function to match how The change would be: A, B = meshgrid(A, B, indexing='ij') Change how
|
Hello there,
It seems there is a bug in the plot_surface method of the FuzzySystem class that results in an incorrect surface plot.
In order to make the problem more evident, I changed slightly the code example provided in https://github.com/aresio/simpful/blob/master/examples/example_output_surface.py . The following code reproduces the issue:
The relevant change here is that a single rule "IF (Service IS excellent) THEN (Tip IS generous)" was added to the fuzzy system.
Observed output: The resulting plot (image bellow) incorrectly suggests that the tip increases with food quality instead of service quality.
The version of the packages I used in this execution:
I also replicated the issue with the following versions:
Is this really an unexpected behavior?
Thanks.
Guilherme.
The text was updated successfully, but these errors were encountered: