Skip to content

Commit

Permalink
Add some initial thoughts and rename value_filler.py to imputer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
louisPoulain authored Oct 18, 2024
1 parent 4774838 commit 5d53eb9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mlpp_lib/value_filler.py → mlpp_lib/imputer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
from typing_extensions import Self


class ValueFiller:
class Imputer:
"""
Abstract class for filling missing values in a dataset.
"""
#TODO:
# - create subclasses to handle different types of imputing:
# - constant
# - location-based (stations) / elevation
# - based on lead time ? E.g., replace by the mean of the distribution for observed values at such lead time
# - based on valid time -> may be more appropriate than lead time

@abstractmethod
def fill(self, data: xr.Dataset) -> xr.Dataset:
Expand All @@ -29,4 +35,4 @@ class ConstantFiller(ValueFiller):
fillvalue: dict[str, float] = field(init=True, default=-5)

def fill(self, data: xr.Dataset) -> xr.Dataset:
return data.fillna(self.fillvalue)
return data.fillna(self.fillvalue)

0 comments on commit 5d53eb9

Please sign in to comment.