#### Previous topic

fynance.features.scale.roll_standardize

#### Next topic

fynance.features.scale.Scale.fit

# fynance.features.scale.Scale¶

class fynance.features.scale.Scale(X, kind='std', a=0.0, b=1.0, axis=0, **kwargs)

Object to scale data.

Parameters: X : np.ndarray[dtype, ndim=1 or 2] Data to fit the parameters of scale transformation. kind : str, optional “std” : Standardized scale transformation (default), see standardize. “norm” : Normalized scale transformation, see normalize. “raw” : No scale is apply. “roll_std” : Standardized scale transformation, computed with rolling mean and standard deviation (see roll_standardize). “roll_norm” : Normalized scale transformation, computed with roling minimum and maximum (see roll_normalize). a, b : float or array_like, optional Some scale factors to apply after the transformation. By default is respectively 0 and 1. axis : int, optional Axis along which compute the scale parameters. Default is 0. **kwargs : keyword arguments for particular functions E.g: for rolling function set w the lagged window (see roll_normalize) or for rolling standardization set kind_moment={"s", "w", "e"} (see roll_standardize).
Attributes: func : callable The scale function. revert_func : callable The revert scale function. params : dict Parameters of the scale transformation. axis : int The axis along which is computed the scale parameters. kind : str The kind of scale transformation.

Methods

 fit(X[, kind, a, b, axis]) Compute the parameters of the scale transformation. scale(X[, axis]) Scale the data with the fitted parameters. revert(X[, axis]) Revert the transformation of the scale with the fitted parameters.