File wellmet/mplot/maxes.py changed (mode: 100644) (index 8b57ecc..2f2a0ed) |
... |
... |
__all__ = [ |
29 |
29 |
'candidates_plot', 'rejection_sampling_plot', |
'candidates_plot', 'rejection_sampling_plot', |
30 |
30 |
'candidates_sampling_plot', |
'candidates_sampling_plot', |
31 |
31 |
'convex_hull_plot', 'tri_plot', 'tri_nodes_plot', |
'convex_hull_plot', 'tri_plot', 'tri_nodes_plot', |
32 |
|
'tri_R_plot', 'tri_GK_plot', |
|
|
32 |
|
'tri_R_plot', 'tri_GK_plot', 'tri_G_plot', |
33 |
33 |
'tri_R_nodes_plot', 'tri_GK_nodes_plot', |
'tri_R_nodes_plot', 'tri_GK_nodes_plot', |
34 |
34 |
'convergence_diagram', 'convergence_legend', |
'convergence_diagram', 'convergence_legend', |
35 |
35 |
'convergence_square', 'beta_diagram', |
'convergence_square', 'beta_diagram', |
|
... |
... |
def convergence_diagram(ax): |
288 |
288 |
ax.set_ylabel("Probability measure") |
ax.set_ylabel("Probability measure") |
289 |
289 |
|
|
290 |
290 |
|
|
291 |
|
def beta_diagram(ax, sources=['box', 'user'], apply_proxy=False): |
|
292 |
|
#č pokorně jedeme použiť guessbox |
|
293 |
|
#č nic jiného nebylo pořádně implementováno |
|
294 |
|
from .. import stm_df |
|
295 |
|
df = stm_df.get_tri_data_frame(ax.sample_box, sources, apply_proxy) |
|
|
291 |
|
def beta_diagram(ax, df=None): |
|
292 |
|
if df is None: |
|
293 |
|
try: |
|
294 |
|
import pandas as pd |
|
295 |
|
df = pd.DataFrame(ax.sample_box.box_estimations) |
|
296 |
|
df.index = df.nsim.to_numpy() |
|
297 |
|
except BaseException as e: |
|
298 |
|
print(repr(e)) |
|
299 |
|
return |
296 |
300 |
try: |
try: |
297 |
301 |
pf_exact = ax.sample_box.pf_exact |
pf_exact = ax.sample_box.pf_exact |
298 |
302 |
pf_exact_method = ax.sample_box.pf_exact_method |
pf_exact_method = ax.sample_box.pf_exact_method |
|
... |
... |
def convergence_legend(ax): |
337 |
341 |
#č můde být třeba použit řez a skříňka tedy potřebné struktury může nemít |
#č můde být třeba použit řez a skříňka tedy potřebné struktury může nemít |
338 |
342 |
def tri_nodes_plot(ax, tri_space=None, tn_scheme=None, ms=3, mew=0.6, lw=0.7, |
def tri_nodes_plot(ax, tri_space=None, tn_scheme=None, ms=3, mew=0.6, lw=0.7, |
339 |
343 |
linewidths=[0.7, 0.5, 0.4, 0.3, 0.2, 0.1], nrid=200, |
linewidths=[0.7, 0.5, 0.4, 0.3, 0.2, 0.1], nrid=200, |
340 |
|
data_offset=0.5): |
|
|
344 |
|
data_offset=1): |
341 |
345 |
from .. import simplex as six |
from .. import simplex as six |
342 |
346 |
if tri_space is None: |
if tri_space is None: |
343 |
347 |
tri_space = ax.space |
tri_space = ax.space |
|
... |
... |
def tri_nodes_plot(ax, tri_space=None, tn_scheme=None, ms=3, mew=0.6, lw=0.7, |
399 |
403 |
mart.plot_boundaries(ax, lw=lw, zorder=1050, nrod=nrid) |
mart.plot_boundaries(ax, lw=lw, zorder=1050, nrod=nrid) |
400 |
404 |
except: |
except: |
401 |
405 |
pass |
pass |
402 |
|
mart.setup_labels(ax, data_offset=data_offset) |
|
|
406 |
|
min_coord = np.abs(np.min(getattr(ax.sample_box, ax.space))) |
|
407 |
|
mart.setup_labels(ax, data_offset=data_offset * min_coord) |
403 |
408 |
|
|
404 |
409 |
def tri_R_nodes_plot(ax, **kwargs): |
def tri_R_nodes_plot(ax, **kwargs): |
405 |
410 |
tri_nodes_plot(ax, tri_space='R', **kwargs) |
tri_nodes_plot(ax, tri_space='R', **kwargs) |
406 |
411 |
|
|
|
412 |
|
def tri_G_plot(ax, **kwargs): |
|
413 |
|
tri_plot(ax, tri_space='G', **kwargs) |
|
414 |
|
|
407 |
415 |
def tri_GK_nodes_plot(ax, **kwargs): |
def tri_GK_nodes_plot(ax, **kwargs): |
408 |
416 |
tri_nodes_plot(ax, tri_space='GK', **kwargs) |
tri_nodes_plot(ax, tri_space='GK', **kwargs) |
409 |
417 |
|
|
|
... |
... |
def tri_GK_nodes_plot(ax, **kwargs): |
412 |
420 |
#č protože já vím, že v těch obrázcích, ve kterých chcu ho použit, |
#č protože já vím, že v těch obrázcích, ve kterých chcu ho použit, |
413 |
421 |
#č můde být třeba použit řez a skříňka tedy potřebné struktury může nemít |
#č můde být třeba použit řez a skříňka tedy potřebné struktury může nemít |
414 |
422 |
def tri_plot(ax, tri_space=None, linewidths=[0.7, 0.5, 0.4, 0.3, 0.2, 0.1], |
def tri_plot(ax, tri_space=None, linewidths=[0.7, 0.5, 0.4, 0.3, 0.2, 0.1], |
415 |
|
ms=3, mew=0.6, lw=0.7, data_offset=0.5, nrid=200): |
|
|
423 |
|
ms=3, mew=0.6, lw=0.7, data_offset=1, nrid=200): |
416 |
424 |
from .. import simplex as six |
from .. import simplex as six |
417 |
425 |
if tri_space is None: |
if tri_space is None: |
418 |
426 |
tri_space = ax.space |
tri_space = ax.space |
|
... |
... |
def tri_plot(ax, tri_space=None, linewidths=[0.7, 0.5, 0.4, 0.3, 0.2, 0.1], |
437 |
445 |
mart.plot_boundaries(ax, lw=lw, zorder=1050, nrod=nrid) |
mart.plot_boundaries(ax, lw=lw, zorder=1050, nrod=nrid) |
438 |
446 |
except: |
except: |
439 |
447 |
pass |
pass |
440 |
|
mart.setup_labels(ax, data_offset=data_offset) |
|
|
448 |
|
min_coord = np.abs(np.min(getattr(ax.sample_box, ax.space))) |
|
449 |
|
mart.setup_labels(ax, data_offset=data_offset * min_coord) |
441 |
450 |
|
|
442 |
451 |
|
|
443 |
452 |
|
|
File wellmet/mplot/mgraph.py changed (mode: 100644) (index 7b10b8b..3caa68b) |
... |
... |
def tri_estimation_plot(ax, df, pf_exact=None, pf_exact_method="$p_f$", |
104 |
104 |
#ax.plot(df.index, wr, '-', label="$p_f$ wegthed ratio estimation", color='darkmagenta', zorder=10500, lw=lw/2, **kwargs) |
#ax.plot(df.index, wr, '-', label="$p_f$ wegthed ratio estimation", color='darkmagenta', zorder=10500, lw=lw/2, **kwargs) |
105 |
105 |
ax.plot(df.index, v, '-r', label="simple $p_f$ estimation", zorder=100500, lw=lw, **kwargs) |
ax.plot(df.index, v, '-r', label="simple $p_f$ estimation", zorder=100500, lw=lw, **kwargs) |
106 |
106 |
except: |
except: |
107 |
|
pass |
|
|
107 |
|
pass |
108 |
108 |
# v = df['vertex_estimation'].to_numpy() |
# v = df['vertex_estimation'].to_numpy() |
109 |
109 |
# wv = df['weighted_vertex_estimation'].to_numpy() |
# wv = df['weighted_vertex_estimation'].to_numpy() |
110 |
110 |
# ax.plot(df.index, wv, '-r', label="weighted $p_f$ estimation", zorder=100500, **kwargs) |
# ax.plot(df.index, wv, '-r', label="weighted $p_f$ estimation", zorder=100500, **kwargs) |
|
... |
... |
def tri_beta_plot(ax, df, pf_exact=None, pf_exact_method="$p_f$", |
135 |
135 |
#č aby se hezky kreslily v legendě |
#č aby se hezky kreslily v legendě |
136 |
136 |
|
|
137 |
137 |
v = -stats.norm.ppf(df['vertex_estimation'].to_numpy()) |
v = -stats.norm.ppf(df['vertex_estimation'].to_numpy()) |
138 |
|
wv = -stats.norm.ppf(df['weighted_vertex_estimation'].to_numpy()) |
|
139 |
|
ax.plot(df.index, wv, '-r', label="weighted $p_f$ estimation", zorder=100500, **kwargs) |
|
140 |
|
ax.plot(df.index, v, '-m', label="simple $p_f$ estimation", zorder=10500, **kwargs) |
|
|
138 |
|
#wv = -stats.norm.ppf(df['weighted_vertex_estimation'].to_numpy()) |
|
139 |
|
#ax.plot(df.index, wv, '-r', label="weighted $p_f$ estimation", zorder=100500, **kwargs) |
|
140 |
|
ax.plot(df.index, v, '-r', label="vertex $p_f$ estimation", zorder=10500, **kwargs) |
141 |
141 |
|
|
142 |
142 |
|
|
143 |
143 |
#č teď čáry |
#č teď čáry |