detect_outliers (pyleoclim.utils.tsutils.detect_outliers)

pyleoclim.utils.tsutils.detect_outliers(ts, ys, auto=True, plot_knee=True, plot_outliers=True, plot_outliers_kwargs=None, plot_knee_kwargs=None, figsize=[10, 4], saveknee_settings=None, saveoutliers_settings=None, mute=False)[source]

Function to detect outliers in the given timeseries

for more details, see: https://scikit-learn.org/stable/modules/generated/sklearn.cluster.DBSCAN.html

Parameters
  • ts (array) – time axis of time series

  • ys (array) – y values of time series

  • plot (boolean) – true by default, plots the outliers using a scatter plot

  • auto (boolean) – true by default, if false the user manually selects the knee point

  • mute (bool, optional) – if True, the plot will not show; recommend to turn on when more modifications are going to be made on ax (going to be deprecated)

  • plot_kwargs (dict) – keyword arguments for ax.plot()

Returns

outliers – a list of values consisting of outlier indices

Return type

array

See also

pylecolim.utils.tsutils.distance_neighbors

Finds Distance of each point in the timeseries from its 4 nearest neighbors

pylecolim.utils.tsustils.find_knee

Finds knee point automatically in a given array sorted in decreasing order

pylecolim.utils.tsutils.remove_outliers

Removes outliers from a timeseries