Skip to content

Commit

Permalink
Update rail.py
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbailey committed Jan 30, 2019
1 parent 8e7946b commit f104df2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rail/rail.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def expected_loss_deterministic_mean(self) -> float:
return np.array(list(map(lambda row: row.evaluate_deterministic(), self.data.values()))).sum()

def calculate_dataframe_deterministic_mean(self):
df = risks.dataframe.copy()
df = self.dataframe.copy()
df['Risk (mean)'] = list(map(lambda x: x.evaluate_deterministic(), self.data.values()))
return df

Expand Down Expand Up @@ -271,7 +271,7 @@ def plot_risk_cost_matrix(self, controls, axes=None):
plt.ylabel('residual risk')
plt.xlabel('control cost')
plt.scatter(df['cost'], df['loss'], axes=axes)
plt.scatter(controls.costs(), risks.expected_loss_deterministic_mean(), color='red', axes=axes)
plt.scatter(controls.costs(), self.expected_loss_deterministic_mean(), color='red', axes=axes)
axes.set_xlim(xmin=0)

def sensitivity_test(self, controls, iterations=1000):
Expand Down

0 comments on commit f104df2

Please sign in to comment.