TimeSeriesDBSCAN
TimeSeriesDBSCAN
- class TimeSeriesDBSCAN(distance='euclidean', eps=0.5, min_samples=5, algorithm='auto', leaf_size=30, distance_params=None, n_jobs=None)[source]
DBSCAN for time series distances.
Interface to sklearn DBSCAN with sktime time series distances.
Time series distances are passed as the
distance argument, which can be:a string. This will substitute a hard-coded distance metric from
sktime.dists_kernels._numba_distances. These default distances are intended to be performant, but cannot deal with unequal length or multivariate series.a
sktimepairwise transformer. These are available insktime.dists_kernels, and can be discovered viaregistry.all_estimatorsby searching forpairwise-transformertype.and are composable first class citizens in thesktimeframework. Distances dealing with unequal length or multivariate series are available, these can be discovered viacapability:unequal_lengthandcapability:multivariatetags.a callable. The exact signature for callables is described below.
- Parameters:
- distancestr, sktime pairwise transformer, or callable, optional. default =’dtw’
distance measure between time series
if str, must be one of the following strings: ‘euclidean’, ‘squared’, ‘dtw’, ‘ddtw’, ‘wdtw’, ‘wddtw’, ‘lcss’, ‘edr’, ‘erp’, ‘msm’, ‘twe’ this will substitute a hard-coded distance metric from
sktime.dists_kernels._numba_distances.if
sktimepairwise transformer, must implement thepairwise-transformerinterface.sktimetransformers are available insktime.dists_kernels, and discoverable viaregistry.all_estimatorsby searching forpairwise-transformertype.if non-class callable, parameters can be passed via
distance_paramsif any callable, must be of signature
(X: Panel, X2: Panel) -> np.ndarray. The output must be mxn array if X is Panel of m Series, X2 of n Series; ifdistance_mtypeis not set, must be able to takeX,X2which are ofpd_multiindexandnumpy3Dmtype
- epsfloat, default=0.5
The maximum distance between two samples for one to be considered as in the neighborhood of the other. This is not a maximum bound on the distances of points within a cluster. This is the most important DBSCAN parameter to choose appropriately for your data set and distance function.
- min_samplesint, default=5
The number of samples (or total weight) in a neighborhood for a point to be considered as a core point. This includes the point itself.
- algorithm{‘auto’, ‘ball_tree’, ‘kd_tree’, ‘brute’}, default=’auto’
The algorithm to be used by the NearestNeighbors module to compute pointwise distances and find nearest neighbors. See NearestNeighbors module documentation for details.
- leaf_sizeint, default=30
Leaf size passed to BallTree or cKDTree. This can affect the speed of the construction and query, as well as the memory required to store the tree. The optimal value depends on the nature of the problem.
- distance_paramsdict, optional, default = None.
dictionary for distance parameters, in case that distance is a str or callable
- n_jobsint, default=None
The number of parallel jobs to run.
Nonemeans 1 unless in ajoblib.parallel_backendcontext.-1means using all processors. See Glossary for more details.
- Attributes:
- core_sample_indices_ndarray of shape (n_core_samples,)
Indices of core samples.
- components_ndarray of shape (n_core_samples, n_features)
Copy of each core sample found by training.
- labels_ndarray of shape (n_samples)
Cluster labels for each point in the dataset given to fit(). Noisy samples are given the label -1.
Methods
check_is_fitted([method_name])Check if the estimator has been fitted.
clone()Obtain a clone of the object with same hyper-parameters and config.
clone_tags(estimator[, tag_names])Clone tags from another object as dynamic override.
create_test_instance([parameter_set])Construct an instance of the class, using first test parameter set.
create_test_instances_and_names([parameter_set])Create list of all test instances and a list of names for them.
fit(X[, y])Fit time series clusterer to training data.
fit_predict(X[, y])Compute cluster centers and predict cluster index for each time series.
get_class_tag(tag_name[, tag_value_default])Get class tag value from class, with tag level inheritance from parents.
get_class_tags()Get class tags from class, with tag level inheritance from parent classes.
get_config()Get config flags for self.
get_fitted_params([deep])Get fitted parameters.
get_param_defaults()Get object's parameter defaults.
get_param_names([sort])Get object's parameter names.
get_params([deep])Get a dict of parameters values for this object.
get_tag(tag_name[, tag_value_default, ...])Get tag value from instance, with tag level inheritance and overrides.
get_tags()Get tags from instance, with tag level inheritance and overrides.
get_test_params([parameter_set])Return testing parameter settings for the estimator.
is_composite()Check if the object is composed of other BaseObjects.
load_from_path(serial)Load object from file location.
load_from_serial(serial)Load object from serialized memory container.
predict(X[, y])Predict the closest cluster each sample in X belongs to.
predict_proba(X)Predicts labels probabilities for sequences in X.
reset()Reset the object to a clean post-init state.
save([path, serialization_format])Save serialized self to bytes-like object or to (.zip) file.
score(X[, y])Score the quality of the clusterer.
set_config(**config_dict)Set config flags to given values.
set_params(**params)Set the parameters of this object.
set_random_state([random_state, deep, ...])Set random_state pseudo-random seed parameters for self.
set_tags(**tag_dict)Set instance level tag overrides to given values.

