"""This file performs Sample-wise normalization on the data."""
from typing import Union
import numpy as np
from scalr.data.preprocess import PreprocessorBase
[docs]
class SampleNorm(PreprocessorBase):
"""Class for Samplewise Normalization"""
def __init__(self, scaling_factor: float = 1.0):
"""Initialize parameters for Sample-wise normalization.
Args:
scaling_factor: `Target sum` to maintain for each sample.
"""
self.scaling_factor = scaling_factor
[docs]
@classmethod
def get_default_params(cls) -> dict:
"""Class method to get default params for preprocess_config."""
return dict(scaling_factor=1.0)