Util.plot_rules bugfix
This commit is contained in:
parent
74debe42ee
commit
f9d6538bae
@ -10,9 +10,10 @@ import numpy as np
|
|||||||
|
|
||||||
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):
|
||||||
if axis is None and rules_by_axis is None:
|
if axis is None and rules_by_axis is None:
|
||||||
fig, axis = plt.subplots(nrows=1, ncols=1, figsize=size)
|
rows = 1
|
||||||
elif axis is None and rules_by_axis is not None:
|
elif axis is None and rules_by_axis is not None:
|
||||||
rows = (((len(model.flrgs.keys())//rules_by_axis)) // columns)+1
|
rows = (((len(model.flrgs.keys())//rules_by_axis)) // columns)+1
|
||||||
|
|
||||||
fig, axis = plt.subplots(nrows=rows, ncols=columns, figsize=size)
|
fig, axis = plt.subplots(nrows=rows, ncols=columns, figsize=size)
|
||||||
|
|
||||||
if rules_by_axis is None:
|
if rules_by_axis is None:
|
||||||
@ -31,7 +32,12 @@ def plot_rules(model, size=[5, 5], axis=None, rules_by_axis=None, columns=1):
|
|||||||
colcount = (ct // rules_by_axis) % columns
|
colcount = (ct // rules_by_axis) % columns
|
||||||
rowcount = (ct // rules_by_axis) // columns
|
rowcount = (ct // rules_by_axis) // columns
|
||||||
|
|
||||||
ax = axis[rowcount, colcount] if columns > 1 else axis[rowcount]
|
if rows > 1 and columns > 1:
|
||||||
|
ax = axis[rowcount, colcount]
|
||||||
|
elif columns > 1:
|
||||||
|
ax = axis[rowcount]
|
||||||
|
else:
|
||||||
|
ax = axis
|
||||||
|
|
||||||
if ct % rules_by_axis == 0:
|
if ct % rules_by_axis == 0:
|
||||||
draw_sets_on_axis(ax, model, size)
|
draw_sets_on_axis(ax, model, size)
|
||||||
|
@ -69,10 +69,6 @@ class ConditionalVarianceFTS(hofts.HighOrderFTS):
|
|||||||
self.forecasts = self.forecasts[-self.memory_window:]
|
self.forecasts = self.forecasts[-self.memory_window:]
|
||||||
self.inputs = np.array(ndata[-self.memory_window:]).tolist()
|
self.inputs = np.array(ndata[-self.memory_window:]).tolist()
|
||||||
|
|
||||||
print(self.mean_residual)
|
|
||||||
print(self.variance_residual)
|
|
||||||
print([self.original_min,self.original_max])
|
|
||||||
|
|
||||||
|
|
||||||
def generate_flrg(self, flrs, **kwargs):
|
def generate_flrg(self, flrs, **kwargs):
|
||||||
for flr in flrs:
|
for flr in flrs:
|
||||||
|
Loading…
Reference in New Issue
Block a user