Bugfix in common.Util.plot_interval2

This commit is contained in:
Petrônio Cândido 2019-05-30 10:22:59 -03:00
parent 985e91f2ee
commit 99c36fc5e9
2 changed files with 1 additions and 6 deletions

View File

@ -265,7 +265,6 @@ def plot_interval2(intervals, data, **kwargs):
:keyword typeonlegend: :keyword typeonlegend:
:keyword ls: matplotlib line style :keyword ls: matplotlib line style
:keyword linewidth: matplotlib width :keyword linewidth: matplotlib width
:return: a list [lower, upper] with the minimum and maximum bounds of the intervals
''' '''
l = len(intervals) l = len(intervals)
@ -283,8 +282,6 @@ def plot_interval2(intervals, data, **kwargs):
lower = [kk[0] for kk in intervals] lower = [kk[0] for kk in intervals]
upper = [kk[1] for kk in intervals] upper = [kk[1] for kk in intervals]
mi = min(lower) * 0.95
ma = max(upper) * 1.05
typeonlegend = kwargs.get('typeonlegend', False) typeonlegend = kwargs.get('typeonlegend', False)
color = kwargs.get('color', 'red') color = kwargs.get('color', 'red')
@ -296,8 +293,6 @@ def plot_interval2(intervals, data, **kwargs):
if typeonlegend: label += " (Interval)" if typeonlegend: label += " (Interval)"
ax.plot(lower, color=color, label=label, ls=ls,linewidth=linewidth) ax.plot(lower, color=color, label=label, ls=ls,linewidth=linewidth)
ax.plot(upper, color=color, ls=ls,linewidth=linewidth) ax.plot(upper, color=color, ls=ls,linewidth=linewidth)
return [mi, ma]
def plot_rules(model, size=[5, 5], axis=None, rules_by_axis=None, columns=1): def plot_rules(model, size=[5, 5], axis=None, rules_by_axis=None, columns=1):

View File

@ -39,7 +39,7 @@ distributions = model.predict(test[:10], type='distribution', steps_ahead=horizo
fig, ax = plt.subplots(nrows=1, ncols=1,figsize=[15,5]) fig, ax = plt.subplots(nrows=1, ncols=1,figsize=[15,5])
ax.plot(test[:10], label='Original',color='black') ax.plot(test[:10], label='Original',color='black')
cUtil.plot_interval(ax, intervals, model.order, label='ensemble') cUtil.plot_interval2(intervals, test[:10], start_at=3, ax=ax)
cUtil.plot_distribution2(distributions, test[:10], start_at=2, ax=ax, cmap="Blues") cUtil.plot_distribution2(distributions, test[:10], start_at=2, ax=ax, cmap="Blues")
''' '''