Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ema_workbench/analysis/logistic_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def calculate_covden(fitted_model, x, y, step=0.1):
def calculate_covden_for_treshold(predicted, y, threshold):
"""Helper function for calculating coverage and density"""

tp = np.sum(((predicted > threshold) == True) & (y == True))
fp = np.sum(((predicted > threshold) == True) & (y == False))
fn = np.sum(((predicted > threshold) == False) & (y == True))
tp = np.sum(((predicted > threshold) is True) & (y is True))
fp = np.sum(((predicted > threshold) is True) & (y is False))
fn = np.sum(((predicted > threshold) is False) & (y is True))

precision = tp / (tp + fp)
recall = tp / (tp + fn)
Expand Down
2 changes: 1 addition & 1 deletion ema_workbench/analysis/scenario_discovery_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def _determine_restricted_dims(box_limits, box_init):
"""
cols = box_init.columns.values
restricted_dims = cols[
np.all(box_init.values == box_limits.values, axis=0) == False
np.all(box_init.values == box_limits.values, axis=0) is False
]
# restricted_dims = [column for column in box_init.columns if not
# np.all(box_init[column].values == box_limits[column].values)]
Expand Down
2 changes: 1 addition & 1 deletion ema_workbench/connectors/simio_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def __init__(

"""
super().__init__(name, wd=wd, model_file=model_file)
assert main_model != None
assert main_model is not None
self.main_model_name = main_model
self.output = {}
self.n_replications = n_replications
Expand Down
2 changes: 1 addition & 1 deletion ema_workbench/em_framework/samplers.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def sample(self, distribution, size):
# corner case fix (try siz=49)
# is not a proper fix, it means that perc is wrong
# so your intervals are wrong
samples = samples[np.isnan(samples) == False]
samples = samples[np.isnan(samples) is False]

return samples

Expand Down
4 changes: 2 additions & 2 deletions test/test_analysis/test_scenario_discovery_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,14 @@ def test_compare(self):
# all dimensions different
a = np.array([(0, 1), (0, 1)], dtype=[("a", np.float), ("b", np.float)])
b = np.array([(1, 1), (0, 0)], dtype=[("a", np.float), ("b", np.float)])
test = sdutil._compare(a, b) == False
test = sdutil._compare(a, b) is False
self.assertTrue(np.all(test))

# dimensions 1 different and dimension 2 the same
a = np.array([(0, 1), (0, 1)], dtype=[("a", np.float), ("b", np.float)])
b = np.array([(1, 1), (0, 1)], dtype=[("a", np.float), ("b", np.float)])
test = sdutil._compare(a, b)
test = (test[0] == False) & (test[1] == True)
test = (test[0] is False) & (test[1] is True)
self.assertTrue(test)

def test_plot_box(self):
Expand Down