diff --git a/pyproject.toml b/pyproject.toml index ef60196..705f75a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "synnax-shared" -version = "1.8.0" +version = "1.9.0" description = "Synnax shared Python pacakges" readme = "README.md" requires-python = ">=3.11" diff --git a/src/synnax_shared/data_processing/scaler/linear_scaler.py b/src/synnax_shared/data_processing/scaler/linear_scaler.py index 73f0924..0411e67 100644 --- a/src/synnax_shared/data_processing/scaler/linear_scaler.py +++ b/src/synnax_shared/data_processing/scaler/linear_scaler.py @@ -26,24 +26,24 @@ def __init__(self, offset: float, divisor: float) -> None: self.offset = offset self.divisor = divisor - def transform_series(self, series: Series) -> Series: + def _transform_series(self, series: Series) -> Series: float_series = series.astype(float) return (float_series + self.offset) / self.divisor - def inverse_transform_series(self, series: Series) -> Series: + def _inverse_transform_series(self, series: Series) -> Series: float_series = series.astype(float) return (float_series * self.divisor) - self.offset - def transform_dataframe(self, dataframe: DataFrame) -> DataFrame: + def transform(self, dataframe: DataFrame) -> DataFrame: dataframe_copy = dataframe.copy() for column in dataframe_copy.select_dtypes(include=[number]): - dataframe_copy[column] = self.transform_series(dataframe_copy[column]) + dataframe_copy[column] = self._transform_series(dataframe_copy[column]) return dataframe_copy - def inverse_transform_dataframe(self, dataframe: DataFrame) -> DataFrame: + def inverse_transform(self, dataframe: DataFrame) -> DataFrame: dataframe_copy = dataframe.copy() for column in dataframe_copy.select_dtypes(include=[number]): - dataframe_copy[column] = self.inverse_transform_series( + dataframe_copy[column] = self._inverse_transform_series( dataframe_copy[column] ) return dataframe_copy