skdim.id.TLE¶
-
class
skdim.id.TLE(epsilon=0.0001)[source]¶ Intrinsic dimension estimation using the Tight Local intrinsic dimensionality Estimator algorithm. [Amsaleg2019] [IDRadovanović]
Parameters: - epsilon : float
Methods
fit(X[, y, precomputed_knn_arrays, smooth, …])Fitting method for local ID estimators fit_transform(X[, y, …])Fit-transform method for local ID estimators fit_transform_pw(X[, …])Returns an array of pointwise ID estimates by fitting the estimator in kNN of each point. get_params([deep])Get parameters for this estimator. set_params(**params)Set the parameters of this estimator. transform([X])Predict ID after a previous call to self.fit transform_pw([X])Return an array of pointwise ID estimates after a previous call to self.fit_pw -
fit(X, y=None, precomputed_knn_arrays=None, smooth=False, n_neighbors=None, comb='mean', n_jobs=1)¶ Fitting method for local ID estimators
Parameters: - X : {array-like}, shape (n_samples, n_features)
The training input samples.
- y : dummy parameter to respect the sklearn API
- precomputed_knn_arrays : tuple[ np.array (n_samples x n_dims), np.array (n_samples x n_dims) ]
Provide two precomputed arrays: (sorted nearest neighbor distances, sorted nearest neighbor indices)
- n_neighbors : int, default=self._N_NEIGHBORS
Number of nearest neighbors to use (ignored when using precomputed_knn)
- n_jobs : int
Number of processes
- smooth : bool, default = False
Additionally computes a smoothed version of pointwise estimates by taking the ID of a point as the average ID of each point in its neighborhood (self.dimension_pw_) smooth_
Returns: self (object) – Returns self.
-
fit_transform(X, y=None, precomputed_knn_arrays=None, smooth=False, n_neighbors=None, comb='mean', n_jobs=1)¶ Fit-transform method for local ID estimators
Parameters: - X : {array-like}, shape (n_samples, n_features)
The training input samples.
- y : dummy parameter to respect the sklearn API
- precomputed_knn_arrays : tuple[ np.array (n_samples x n_dims), np.array (n_samples x n_dims) ]
Provide two precomputed arrays: (sorted nearest neighbor distances, sorted nearest neighbor indices)
- n_neighbors : int, default=self._N_NEIGHBORS
Number of nearest neighbors to use (ignored when using precomputed_knn)
- n_jobs : int
Number of processes
- smooth : bool, default = False
Additionally computes a smoothed version of pointwise estimates by taking the ID of a point as the average ID of each point in its neighborhood (self.dimension_pw_) smooth_
Returns: dimension_ ({int, float}) – The estimated intrinsic dimension
-
fit_transform_pw(X, precomputed_knn_arrays=None, smooth=False, n_neighbors=None, n_jobs=1)¶ Returns an array of pointwise ID estimates by fitting the estimator in kNN of each point.
Parameters: - X : np.array (n_samples x n_neighbors)
Dataset to fit
- precomputed_knn_arrays : tuple[ np.array (n_samples x n_dims), np.array (n_samples x n_dims) ]
Provide two precomputed arrays: (sorted nearest neighbor distances, sorted nearest neighbor indices)
- n_neighbors : int, default=self._N_NEIGHBORS
Number of nearest neighbors to use (ignored when using precomputed_knn).
- n_jobs : int
Number of processes
- smooth : bool, default = False
- Additionally computes a smoothed version of pointwise estimates by
taking the ID of a point as the average ID of each point in its neighborhood (self.dimension_pw_)
Returns: - dimension_pw (np.array) – Pointwise ID estimates
- dimension_pw_smooth (np.array) – If smooth is True, additionally returns smoothed pointwise ID estimates
-
get_params(deep=True)¶ Get parameters for this estimator.
Parameters: - deep : bool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators.
Returns: params (dict) – Parameter names mapped to their values.
-
set_params(**params)¶ Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as
Pipeline). The latter have parameters of the form<component>__<parameter>so that it’s possible to update each component of a nested object.Parameters: - **params : dict
Estimator parameters.
Returns: self (estimator instance) – Estimator instance.
-
transform(X=None)¶ Predict ID after a previous call to self.fit
Parameters: - X : Dummy parameter
Returns: dimension_ ({int, float}) – The estimated ID
-
transform_pw(X=None)¶ Return an array of pointwise ID estimates after a previous call to self.fit_pw
Parameters: - X : Dummy parameter
Returns: - dimension_pw (np.array) – Pointwise ID estimates
- dimension_pw_smooth (np.array) – If self.fit_pw(smooth=True), additionally returns smoothed pointwise ID estimates