Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nreinicke committed Nov 17, 2023
1 parent 6b04055 commit 084031b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 2 additions & 6 deletions nrel/routee/powertrain/validation/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
}


def mean_squared_error(
A, B, axis: Optional[int] = None
) -> float:
def mean_squared_error(A, B, axis: Optional[int] = None) -> float:
return np.square(A - B).mean(axis=axis)


Expand All @@ -41,9 +39,7 @@ def net_energy_error(target, target_pred) -> float:
return net_error


def weighted_relative_percent_difference(
target, target_pred
) -> float:
def weighted_relative_percent_difference(target, target_pred) -> float:
epsilon = np.finfo(np.float64).eps

w = np.array(np.abs(target) / np.sum(np.abs(target)))
Expand Down
8 changes: 4 additions & 4 deletions scripts/developers/train_model_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,25 +312,25 @@ def load_all_files(files, file_limit=FILE_LIMIT):
pt.DataColumn(name="grade_dec", units="decimal"),
pt.DataColumn(name="entry_angle", units="degrees"),
]
features = [
features = [
[pt.DataColumn(name="speed_mph", units="mph")],
[
pt.DataColumn(name="speed_mph", units="mph"),
pt.DataColumn(name="grade_dec", units="decimal")
pt.DataColumn(name="grade_dec", units="decimal"),
],
[
pt.DataColumn(name="speed_mph", units="mph"),
pt.DataColumn(name="previous_speed_mph", units="mph"),
pt.DataColumn(name="grade_dec", units="decimal"),
pt.DataColumn(name="previous_grade_dec", units="decimal")
pt.DataColumn(name="previous_grade_dec", units="decimal"),
],
[
pt.DataColumn(name="previous_speed_mph", units="mph"),
pt.DataColumn(name="speed_mph", units="mph"),
pt.DataColumn(name="previous_grade_dec", units="decimal"),
pt.DataColumn(name="grade_dec", units="decimal"),
pt.DataColumn(name="entry_angle", units="degrees"),
pt.DataColumn(name="exit_angle", units="degrees")
pt.DataColumn(name="exit_angle", units="degrees"),
],
]

Expand Down

0 comments on commit 084031b

Please sign in to comment.