Example #1
0
 def smooth_lowess(self,
                   smoothing_parameter=None,
                   number_of_iterations=None,
                   show_progressbar=None):
     """Lowess data smoothing in place.
     If `smoothing_parameter` or `number_of_iterations` are None the method
     is run in interactive mode.
     Parameters
     ----------
     smoothing_parameter: float or None
         Between 0 and 1. The fraction of the data used
         when estimating each y-value.
     number_of_iterations: int or None
         The number of residual-based reweightings
         to perform.
     show_progressbar : None or bool
         If True, display a progress bar. If None the default is set in
         `preferences`.
     Raises
     ------
     SignalDimensionError if the signal dimension is not 1.
     ImportError if statsmodels is not installed.
     Notes
     -----
     This method uses the lowess algorithm from statsmodels. statsmodels
     is required for this method.
     """
     if not statsmodels_installed:
         raise ImportError("statsmodels is not installed. This package is "
                           "required for this feature.")
     self._check_signal_dimension_equals_one()
     if smoothing_parameter is None or number_of_iterations is None:
         smoother = SmoothingLowess(self)
         if smoothing_parameter is not None:
             smoother.smoothing_parameter = smoothing_parameter
         if number_of_iterations is not None:
             smoother.number_of_iterations = number_of_iterations
         smoother.edit_traits()
     else:
         self.map(lowess,
                  exog=self.axes_manager[-1].axis,
                  frac=smoothing_parameter,
                  it=number_of_iterations,
                  is_sorted=True,
                  return_sorted=False,
                  show_progressbar=show_progressbar)
Example #2
0
 def smooth_lowess(self, smoothing_parameter = None,
     number_of_iterations=None, differential_order = 0):
     '''Lowess data smoothing'''
     smoother = SmoothingLowess(self)
     smoother.differential_order = differential_order
     if smoothing_parameter is not None:
         smoother.smoothing_parameter = smoothing_parameter
     if number_of_iterations is not None:
         smoother.number_of_iterations = number_of_iterations
     if smoothing_parameter is None or smoothing_parameter is None:
         smoother.edit_traits()
     else:
         smoother.apply()
Example #3
0
 def smooth_lowess(self,
                   smoothing_parameter=None,
                   number_of_iterations=None,
                   show_progressbar=None,
                   parallel=None):
     """Lowess data smoothing in place.
     If `smoothing_parameter` or `number_of_iterations` are None the method
     is run in interactive mode.
     Parameters
     ----------
     smoothing_parameter: float or None
         Between 0 and 1. The fraction of the data used
         when estimating each y-value.
     number_of_iterations: int or None
         The number of residual-based reweightings
         to perform.
     show_progressbar : None or bool
         If True, display a progress bar. If None the default is set in
         `preferences`.
     parallel : {Bool, None, int}
         Perform the operation parallely
     Raises
     ------
     SignalDimensionError if the signal dimension is not 1.
     ImportError if statsmodels is not installed.
     Notes
     -----
     This method uses the lowess algorithm from statsmodels. statsmodels
     is required for this method.
     """
     if not statsmodels_installed:
         raise ImportError("statsmodels is not installed. This package is "
                           "required for this feature.")
     self._check_signal_dimension_equals_one()
     if smoothing_parameter is None or number_of_iterations is None:
         smoother = SmoothingLowess(self)
         if smoothing_parameter is not None:
             smoother.smoothing_parameter = smoothing_parameter
         if number_of_iterations is not None:
             smoother.number_of_iterations = number_of_iterations
         smoother.edit_traits()
     else:
         self.map(lowess,
                  exog=self.axes_manager[-1].axis,
                  frac=smoothing_parameter,
                  it=number_of_iterations,
                  is_sorted=True,
                  return_sorted=False,
                  show_progressbar=show_progressbar,
                  parallel=parallel)