-
Notifications
You must be signed in to change notification settings - Fork 231
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
Heatmap plot in sobol analysis with groups #612
Comments
Hi @nikithiel thanks for reporting this. Is it possible to share a minimum working example? Or at least your problem specification? It would help confirm, or track down the cause. Thank you! |
Hey @ConnectedSystems, I'm using from SALib.test_functions import Ishigami
from SALib import ProblemSpec
import matplotlib.pyplot as plt
# Example from '.../examples/sobol/sobol.py' using ProblemSpec() class
# Parameters from '../../src/SALib/test_functions/params/Ishigami_groups.txt'
paramsSobol = {
'names': ['x1', 'x2', 'x3'],
'bounds': [[-3.14159265359, 3.14159265359], [-3.14159265359, 3.14159265359], [-3.14159265359, 3.14159265359]],
'num_vars': 3,
'groups': ['Group_1', 'Group_2', 'Group_2'],
'dists': None,
'sample_scaled': True
}
problem = ProblemSpec(
{
'num_vars': paramsSobol['num_vars'],
'names': paramsSobol['names'],
'bounds': paramsSobol['bounds'],
'groups': paramsSobol['groups']
}
)
problem.sample_sobol(1024, calc_second_order=True, skip_values=2048)
Y = Ishigami.evaluate(problem.samples)
problem.set_results(Y)
problem.analyze_sobol(calc_second_order=True, conf_level=0.95, print_to_console=True)
problem.heatmap()
plt.show() Let me know, what you think. |
Hmmm, it works as expected for me on from SALib.test_functions import Ishigami
from SALib import ProblemSpec
import matplotlib.pyplot as plt
# Example from '.../examples/sobol/sobol.py' using ProblemSpec() class
# Parameters from '../../src/SALib/test_functions/params/Ishigami_groups.txt'
problem = ProblemSpec(
{
'names': ['x1', 'x2', 'x3'],
'bounds': [[-3.14159265359, 3.14159265359], [-3.14159265359, 3.14159265359], [-3.14159265359, 3.14159265359]],
'num_vars': 3,
'groups': ['Group_1', 'Group_2', 'Group_2'],
'dists': None,
'sample_scaled': True
}
)
problem.sample_sobol(1024, calc_second_order=True, skip_values=2048)
problem.evaluate(Ishigami.evaluate)
problem.analyze_sobol(calc_second_order=True, conf_level=0.95, print_to_console=False)
problem.heatmap()
plt.show() Could you try the most recent development version? pip uninstall SALib
pip install git+https://github.com/SALib/SALib.git#egg=SALib |
Hey, thanks for checking the MWE. This indexing problem is exactly what I've meant. Results generally look the same for me. |
Oh okay, I misunderstood. I interpreted the G1, G2, ..., as the equivalent to x1, x2 etc, and that you were seeing groups being ignored. The fix will be merged in shortly if you would like to try the dev version. I will release a patched version over the weekend. |
Great. Thanks for the prompt fix! |
Hey there,
First of all, thanks for the great package! It integrates well into my coding project and helps me a lot.
R.n. I'm doing a Sobol analysis using grouping of my 24 input parameters. When I call
problem.heatmap()
after the analysis, I get the following heatmap, which I guess isn't exactly the right behavior:The heatmap shows the results for groups 2, 1, 3 and 4, but the labels are incorrect. In
heatmap.py
,heatmap()
uses the following as x-axis labels:SALib/src/SALib/plotting/heatmap.py
Lines 71 to 77 in ee5e2cf
I think the correct behavior would be something like this:
Let me know what you think about it. Maybe I got something wrong here.
The text was updated successfully, but these errors were encountered: