Comments (3)
I think the bug is in ga.py file, plot_pop_evo function. Adding squeeze=False in plt.subplots and changing the axes[i] to axes[i,0] and axes[-1] to axes[-1,0] seems to be solved.
`def plot_pop_evo(self, file=None):
"""
Creates a plot with the evolution of all parameters as a scatter plot.
Can be interpreted as the population diversity.
The color of the points is darker for higher accuracy.
:param file: string, path to the file. If ``None``, file not created.
:return: Axes
"""
estimates = self.all_estim_and_err
pars = list(estimates.columns)
pars.remove('individual')
pars.remove(GA.ITER)
pars.remove(GA.ERR)
assert len(pars) > 0, 'No parameters found'
fig, axes = plt.subplots(nrows=len(pars), sharex=True, squeeze=False)
fig.subplots_adjust(right=0.75)
i = 0
last_err = self.fittest_errors[-1]
first_err = self.fittest_errors[0]
for v in pars:
ax = axes[i,0]
scatter = ax.scatter(x=estimates[GA.ITER],
y=estimates[v],
c=estimates[GA.ERR],
cmap='viridis',
edgecolors='none',
vmin=last_err,
vmax=first_err,
alpha=0.25)
ax.set_xlim([0, estimates[GA.ITER].max() + 1])
ax.text(x=1.05, y=0.5, s=v,
transform=ax.transAxes, fontweight='bold',
horizontalalignment='center', verticalalignment='center')
i += 1
axes[-1,0].set_xlabel('Generation')
# Color bar on the side
cbar_ax = fig.add_axes([0.85, 0.10, 0.05, 0.8])
fig.colorbar(scatter, cax=cbar_ax, label='Error')
if file:
fig.set_size_inches(GA.FIG_SIZE)
fig.savefig(file, dpi=GA.FIG_DPI)
return axes`
from modest-py.
Thanks @ArTheBu, I'll test it and update in the coming days.
from modest-py.
@ArTheBu, it works like a charm (4615033). Thanks!
TODO:
- update on PyPi
- update on conda
from modest-py.
Related Issues (20)
- Logging should not interfere with the logger of the parent application HOT 1
- Add simple GUI HOT 1
- Add FMPy support HOT 9
- Python 3 support HOT 3
- Unit test fails on Debian 9 HOT 1
- Replace the GA implementation HOT 3
- FMU created with OpenModelica HOT 7
- Add win64 FMUs in examples and unit tests HOT 1
- Upload v. 0.0.8 to PyPi HOT 1
- run.tests() fails on Linux (WSL2, Ubuntu 18.04) HOT 1
- Unrecognized argument passed to SciPy solver HOT 1
- modestga zero division error HOT 2
- modestga: cannot start a new process HOT 1
- Catch an exception from FMU if solver failed and continue estimation HOT 5
- ValueError when time is floating point in _select_lp HOT 1
- Step-by-step instructions to get examples up and running HOT 6
- FMUs stored in Temp folder HOT 5
- Does not work on Ubuntu 20.04 HOT 1
- Switch to pytest HOT 1
- Refactor code with black and isort HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modest-py.