Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, width=100):
"""Instanciate with window length.
Args:
width (int): window lenght.
Returns:
self
"""
self.width = 2 * (width // 2)
# window
self.win = np.sign(np.linspace(-1, 1, self.width)).reshape(-1, 1)
self.n_samples = None
self.signal = None
self.cost = Cost(model="constantl2")
self.score = None
Detailled description
Args:
model (str): constantl1|constantl2|rbf
min_size (int, optional): minimum segment length
jump (int, optional): subsample (one every "jump" points)
Returns:
self
"""
self.model = model
self.min_size = min_size
self.jump = jump
self.seg = lru_cache(maxsize=None)(
self._seg) # dynamic programming dans cette fonction.
self.cost = Cost(model=self.model)
self.n_samples = None
"""One line description
Detailled description
Args:
model (str): constantl1|constantl2|rbf, defaults to constantl2
min_size (int, optional): minimum segment length
jump (int, optional): subsample (one every "jump" points)
Returns:
self
"""
self.model = model # not used
self.min_size = min_size
self.jump = jump
self.cost = Cost(model="constantl2")
self.n_samples = None
self.signal = None
"""One line description
Detailled description
Args:
model (str): constantl1|constantl2|rbf
min_size (int, optional): minimum segment length
jump (int, optional): subsample (one every "jump" points)
Returns:
self
"""
self.model = model
self.min_size = min_size
self.jump = jump
self.cost = Cost(model=self.model)
self.n_samples = None