mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
refine conditions for recommending ewi in mds
This commit is contained in:
parent
bbe35400bd
commit
548672cc10
2 changed files with 17 additions and 10 deletions
|
|
@ -203,11 +203,11 @@ class TrainingDataset(BaseDataset):
|
||||||
common_cols = [[col + "_starting", col + "_ending"] for col in common_cols]
|
common_cols = [[col + "_starting", col + "_ending"] for col in common_cols]
|
||||||
|
|
||||||
self.df = self.df.loc[
|
self.df = self.df.loc[
|
||||||
:,
|
:,
|
||||||
no_suffix_cols
|
no_suffix_cols
|
||||||
+ only_ending_cols
|
+ only_ending_cols
|
||||||
+ [col for cols in common_cols for col in cols],
|
+ [col for cols in common_cols for col in cols],
|
||||||
]
|
]
|
||||||
|
|
||||||
def _remove_abnormal_change_in_floor_area(self):
|
def _remove_abnormal_change_in_floor_area(self):
|
||||||
"""
|
"""
|
||||||
|
|
@ -511,7 +511,7 @@ class TrainingDataset(BaseDataset):
|
||||||
expanded_df["is_sandstone_or_limestone"]
|
expanded_df["is_sandstone_or_limestone"]
|
||||||
== expanded_df["is_sandstone_or_limestone_ending"]
|
== expanded_df["is_sandstone_or_limestone_ending"]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
elif component == "floor":
|
elif component == "floor":
|
||||||
expanded_df = expanded_df[
|
expanded_df = expanded_df[
|
||||||
(expanded_df["is_suspended"] == expanded_df["is_suspended_ending"])
|
(expanded_df["is_suspended"] == expanded_df["is_suspended_ending"])
|
||||||
|
|
@ -528,7 +528,7 @@ class TrainingDataset(BaseDataset):
|
||||||
expanded_df["is_to_external_air"]
|
expanded_df["is_to_external_air"]
|
||||||
== expanded_df["is_to_external_air_ending"]
|
== expanded_df["is_to_external_air_ending"]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
elif component == "roof":
|
elif component == "roof":
|
||||||
expanded_df = expanded_df[
|
expanded_df = expanded_df[
|
||||||
(expanded_df["is_pitched"] == expanded_df["is_pitched_ending"])
|
(expanded_df["is_pitched"] == expanded_df["is_pitched_ending"])
|
||||||
|
|
@ -541,7 +541,7 @@ class TrainingDataset(BaseDataset):
|
||||||
expanded_df["has_dwelling_above"]
|
expanded_df["has_dwelling_above"]
|
||||||
== expanded_df["has_dwelling_above_ending"]
|
== expanded_df["has_dwelling_above_ending"]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
return expanded_df
|
return expanded_df
|
||||||
|
|
||||||
|
|
@ -742,7 +742,7 @@ class TrainingDataset(BaseDataset):
|
||||||
self.df[col] = self.df[col].fillna("Unknown")
|
self.df[col] = self.df[col].fillna("Unknown")
|
||||||
|
|
||||||
def _null_validation(self, information: str):
|
def _null_validation(self, information: str):
|
||||||
print(f"Null validation after {information}")
|
# print(f"Null validation after {information}")
|
||||||
if pd.isnull(self.df).sum().sum():
|
if pd.isnull(self.df).sum().sum():
|
||||||
raise ValueError(f"Null values found in dataset, after step {information}")
|
raise ValueError(f"Null values found in dataset, after step {information}")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,10 @@ class Mds:
|
||||||
# There are certain measures where we need to
|
# There are certain measures where we need to
|
||||||
if measure == "external_wall_insulation":
|
if measure == "external_wall_insulation":
|
||||||
# Check if the wall is not cavity since the other wall types can take external wall insulation
|
# Check if the wall is not cavity since the other wall types can take external wall insulation
|
||||||
if self.wall_recommender.ewi_valid():
|
if (
|
||||||
|
self.wall_recommender.ewi_valid() and
|
||||||
|
not self.property_instance.walls["insulation_thickness"] in ["average", "above average"]
|
||||||
|
):
|
||||||
pruned_measures.append(measure)
|
pruned_measures.append(measure)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
@ -177,9 +180,13 @@ class Mds:
|
||||||
if measure == "solar_pv":
|
if measure == "solar_pv":
|
||||||
if self.solar_recommender.is_solar_pv_valid():
|
if self.solar_recommender.is_solar_pv_valid():
|
||||||
pruned_measures.append(measure)
|
pruned_measures.append(measure)
|
||||||
|
continue
|
||||||
|
|
||||||
raise NotImplementedError("Implement me")
|
raise NotImplementedError("Implement me")
|
||||||
|
|
||||||
|
if not pruned_measures:
|
||||||
|
continue
|
||||||
|
|
||||||
pruned_measures_formatted = []
|
pruned_measures_formatted = []
|
||||||
for pm in pruned_measures:
|
for pm in pruned_measures:
|
||||||
pruned_measures_formatted.append({pm: self.format_map[pm]})
|
pruned_measures_formatted.append({pm: self.format_map[pm]})
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue