Public API#

The package root contains version, registry, protocol, and diagnostic objects. Estimators are imported from their scientific family.

Linear#

Paper-aligned linear dimensionality reduction estimators.

class believe14.linear.PCA(n_components=2, *, whiten=False)#

Principal component analysis by an economy SVD of centered data.

class believe14.linear.CanonicalCorrelationAnalysis(n_components=2)#

Hotelling canonical correlation analysis using covariance support SVDs.

fit_transform(X, Y)#

Fit to data, then transform it.

Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.

Parameters:
  • X (array-like of shape (n_samples, n_features)) – Input samples.

  • y (array-like of shape (n_samples,) or (n_samples, n_outputs), default=None) – Target values (None for unsupervised transformations).

  • **fit_params (dict) – Additional fit parameters. Pass only if the estimator accepts additional params in its fit method.

Returns:

X_new – Transformed array.

Return type:

ndarray array of shape (n_samples, n_features_new)

class believe14.linear.FactorAnalysis(n_components=2, *, tol=1e-06, max_iter=500, min_noise_variance=1e-10)#

Gaussian factor analysis fitted by the Rubin–Thayer EM updates.

The fitted transform is the posterior mean of each latent factor. The uniqueness variances are constrained below by min_noise_variance; active constraints are reported in diagnostics_.warnings.

class believe14.linear.FastICA(n_components=2, *, alpha=1.0, tol=1e-05, max_iter=500, random_state=None)#

Symmetric FastICA with unit-variance whitening and log-cosh contrast.

class believe14.linear.FisherScore(n_features_to_select=10)#

Select features using the multiclass Fisher between/within ratio.

transform(X)#

Reduce X to the selected features.

Parameters:

X (array of shape [n_samples, n_features]) – The input samples.

Returns:

X_r – The input samples with only the selected features.

Return type:

array of shape [n_samples, n_selected_features]

class believe14.linear.GaussianRandomProjection(n_components=2, *, random_state=None)#

Dense Gaussian random projection with variance 1 / n_components.

class believe14.linear.LaplacianScore(n_features_to_select=1, *, n_neighbors=5, weighting='binary', gamma=1.0)#

Select original features with the smallest graph Laplacian quotient.

Scores measure squared variation across graph edges relative to degree-weighted variance. Constant features are ineligible and assigned the maximum possible quotient (two). Ties follow original column order.

transform(X)#

Reduce X to the selected features.

Parameters:

X (array of shape [n_samples, n_features]) – The input samples.

Returns:

X_r – The input samples with only the selected features.

Return type:

array of shape [n_samples, n_selected_features]

class believe14.linear.LinearDiscriminantAnalysis(n_components=2, *, regularization=0.0)#

Fisher/Rao linear discriminant subspace transformer.

A zero regularization solves the finite problem on the numerical range of the within-class scatter matrix and rejects infinite Fisher directions. Positive values scale their ridge by trace(Sw) / n_features, falling back to total-scatter scale only when the within-class trace is zero.

class believe14.linear.NeighborhoodComponentsAnalysis(n_components=2, *, init='pca', max_iter=100, tol=1e-05)#

Learn a linear projection maximizing stochastic nearest-neighbor accuracy.

The leave-one-out probabilities exclude the observation itself. Optimization starts from the principal axes or identity rows in centered, globally scaled feature units. The fitted transform uses the original feature units.

class believe14.linear.PLSRegression(n_components=2, *, scale=True, tol=1e-06, max_iter=500)#

NIPALS PLS2 regression with regression-mode X and Y deflation.

Each component starts from the leading right singular vector of the residual cross-covariance, preventing convergence to a subdominant mode. tol and max_iter control the subsequent NIPALS weight updates.

fit_transform(X, y=None)#

Fit to data, then transform it.

Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.

Parameters:
  • X (array-like of shape (n_samples, n_features)) – Input samples.

  • y (array-like of shape (n_samples,) or (n_samples, n_outputs), default=None) – Target values (None for unsupervised transformations).

  • **fit_params (dict) – Additional fit parameters. Pass only if the estimator accepts additional params in its fit method.

Returns:

X_new – Transformed array.

Return type:

ndarray array of shape (n_samples, n_features_new)

class believe14.linear.ProbabilisticPCA(n_components=2)#

Closed-form maximum-likelihood probabilistic PCA.

class believe14.linear.SlicedAverageVarianceEstimation(n_components=2, *, n_slices=5)#

Cook’s SAVE using maximum-likelihood covariance within each slice.

class believe14.linear.SlicedInverseRegression(n_components=2, *, n_slices=10)#

Li’s sliced inverse regression with tie-preserving quantile slices.

class believe14.linear.SparsePCA(n_components=2, *, alpha=0.01, ridge_alpha=0.001, init='pca', tol=1e-06, max_iter=500, coordinate_max_iter=1000, random_state=None)#

Elastic-net sparse PCA using the Zou–Hastie–Tibshirani criterion.

Alternation uses exact orthogonal Procrustes updates for the reconstruction directions and coordinate descent for each elastic-net loading vector.

Nonlinear#

Nonlinear dimensionality-reduction estimators.

class believe14.nonlinear.PHATE(n_components=2, *, n_neighbors=5, decay=40.0, diffusion_time=20, max_diffusion_time=100, n_landmarks=None, potential_floor=1e-12, mds_max_iter=300, mds_tol=1e-06)#

PHATE using an adaptive alpha-decay kernel and potential distances.

fit(X, y=None)#

Fit the transductive diffusion-potential embedding.

fit_transform(X, y=None)#

Fit and return the training coordinates.

get_feature_names_out(input_features=None)#

Return output-coordinate names.

class believe14.nonlinear.TSNE(n_components=2, *, perplexity=30.0, early_exaggeration=12.0, early_exaggeration_iter=250, init='pca', max_iter=1000, tol=1e-07, function_tol=1e-12, random_state=None)#

Exact symmetric dense t-SNE optimized with analytic gradients.

tol bounds the maximum absolute gradient entry. function_tol independently bounds relative objective improvement for L-BFGS-B. stopping_reason_ records the solver’s criterion; gradient_converged_ distinguishes stationarity from objective stagnation. Neither certifies a global optimum of this nonconvex objective.

fit(X, y=None)#

Fit the transductive t-SNE embedding.

fit_transform(X, y=None)#

Fit and return the training coordinates.

get_feature_names_out(input_features=None)#

Return output-coordinate names.

class believe14.nonlinear.ClassicalMDS(n_components=2, *, dissimilarity='euclidean')#

Classical metric scaling by double centering squared dissimilarities.

fit(X, y=None)#

Fit the transductive embedding.

fit_transform(X, y=None)#

Fit and return the training coordinates.

get_feature_names_out(input_features=None)#

Return output-coordinate names.

class believe14.nonlinear.DiffusionMap(n_components=2, *, gamma=None, alpha=1.0, diffusion_time=1)#

Density-normalized diffusion maps with a Nyström extension.

fit(X, y=None)#

Fit the symmetric conjugate of the diffusion operator.

transform(X)#

Extend fitted diffusion eigenfunctions by the Nyström equation.

get_feature_names_out(input_features=None)#

Return output-coordinate names.

class believe14.nonlinear.FastMap(n_components=2, *, dissimilarity='euclidean', pivot_iterations=5)#

FastMap using deterministic farthest-pivot selection.

fit(X, y=None)#

Fit pivots and training coordinates.

fit_transform(X, y=None, **fit_params)#

Fit and return exact stored training coordinates.

transform(X)#

Embed queries using feature or query-to-training pivot distances.

get_feature_names_out(input_features=None)#

Return output-coordinate names.

class believe14.nonlinear.Isomap(n_components=2, *, n_neighbors=5)#

Isomap with an exact connected k-neighbor graph and classical scaling.

fit(X, y=None, *, neighbors=None)#

Fit the transductive geodesic-distance embedding.

fit_transform(X, y=None, *, neighbors=None)#

Fit and return the training coordinates.

get_feature_names_out(input_features=None)#

Return output-coordinate names.

class believe14.nonlinear.KernelPCA(n_components=2, *, kernel='rbf', gamma=None, degree=3, coef0=1.0)#

Kernel PCA with explicit Gram centering and Nyström projection.

fit(X, y=None)#

Fit the centered kernel eigensystem.

transform(X)#

Project query samples by the centered-kernel Nyström formula.

get_feature_names_out(input_features=None)#

Return output-coordinate names.

class believe14.nonlinear.LandmarkIsomap(n_components=2, *, n_neighbors=5, n_landmarks=None, landmark_indices=None)#

Landmark scaling of shortest paths on an exact union k-neighbor graph.

Fit computes shortest paths only from landmarks. Each new query connects to its k closest training points, preserving the fitted graph.

fit_transform(X, y=None, *, neighbors=None)#

Fit to data, then transform it.

Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.

Parameters:
  • X (array-like of shape (n_samples, n_features)) – Input samples.

  • y (array-like of shape (n_samples,) or (n_samples, n_outputs), default=None) – Target values (None for unsupervised transformations).

  • **fit_params (dict) – Additional fit parameters. Pass only if the estimator accepts additional params in its fit method.

Returns:

X_new – Transformed array.

Return type:

ndarray array of shape (n_samples, n_features_new)

class believe14.nonlinear.LandmarkMDS(n_components=2, *, n_landmarks=None, landmark_indices=None, dissimilarity='euclidean')#

Classical scaling on landmarks with distance-based extension.

Use explicit landmark indices or select n_landmarks evenly spaced row indices. The default count is ceil(sqrt(n)), at least n_components + 1. In precomputed mode supply a square training distance matrix; transform takes distances to all training rows, in their original order.

fit_transform(X, y=None)#

Fit to data, then transform it.

Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.

Parameters:
  • X (array-like of shape (n_samples, n_features)) – Input samples.

  • y (array-like of shape (n_samples,) or (n_samples, n_outputs), default=None) – Target values (None for unsupervised transformations).

  • **fit_params (dict) – Additional fit parameters. Pass only if the estimator accepts additional params in its fit method.

Returns:

X_new – Transformed array.

Return type:

ndarray array of shape (n_samples, n_features_new)

class believe14.nonlinear.LaplacianEigenmaps(n_components=2, *, n_neighbors=5, weighting='heat', gamma=1.0)#

Laplacian Eigenmaps using a connected, symmetric k-neighbor graph.

fit(X, y=None, *, neighbors=None)#

Fit the transductive graph-Laplacian embedding.

fit_transform(X, y=None, *, neighbors=None)#

Fit and return the training coordinates.

get_feature_names_out(input_features=None)#

Return output-coordinate names.

class believe14.nonlinear.LocalTangentSpaceAlignment(n_components=2, *, n_neighbors=8)#

Local Tangent Space Alignment with exact local SVDs.

fit(X, y=None, *, neighbors=None)#

Fit the transductive local-tangent alignment embedding.

fit_transform(X, y=None, *, neighbors=None)#

Fit and return the training coordinates.

get_feature_names_out(input_features=None)#

Return output-coordinate names.

class believe14.nonlinear.LocallyLinearEmbedding(n_components=2, *, n_neighbors=5, regularization=0.001)#

Standard LLE with regularized local barycentric weights.

fit(X, y=None, *, neighbors=None)#

Fit the transductive reconstruction-weight embedding.

fit_transform(X, y=None, *, neighbors=None)#

Fit and return the training coordinates.

get_feature_names_out(input_features=None)#

Return output-coordinate names.

class believe14.nonlinear.MetricMDS(n_components=2, *, dissimilarity='euclidean', init='classical', max_iter=300, tol=1e-06, random_state=None)#

Metric MDS minimizing complete unweighted raw stress with SMACOF.

fit(X, y=None)#

Fit the transductive raw-stress embedding.

fit_transform(X, y=None)#

Fit and return the training coordinates.

get_feature_names_out(input_features=None)#

Return output-coordinate names.

class believe14.nonlinear.SammonMapping(n_components=2, *, dissimilarity='euclidean', init='classical', max_iter=300, tol=1e-07, random_state=None)#

Sammon mapping with the paper’s normalized inverse-distance stress.

fit(X, y=None)#

Fit the transductive Sammon embedding.

fit_transform(X, y=None)#

Fit and return the training coordinates.

get_feature_names_out(input_features=None)#

Return output-coordinate names.

Estimation#

Intrinsic-dimension estimators.

class believe14.estimation.CorrelationDimension(*, radii=None, n_radii=20, quantile_range=(0.05, 0.2))#

Estimate correlation dimension from a declared radius interval.

The fitted slope is that of log(C_n(r)) against log(r), where C_n(r) is the fraction of unordered pairs with distance strictly below r. If radii is omitted, logarithmically spaced radii between two empirical positive-distance quantiles define the advertised scale range.

Parameters:
  • radii (array-like of shape (n_radii,), default=None) – Absolute, positive, strictly increasing radii. Supplying radii makes the scale choice entirely user controlled.

  • n_radii (int, default=20) – Number of logarithmically spaced radii used when radii is omitted.

  • quantile_range (tuple of float, default=(0.05, 0.2)) – Pair-distance quantiles defining the automatic scale interval.

References

Grassberger, P. and Procaccia, I. (1983), Physica D 9, 189–208.

fit(X, y=None)#

Estimate the slope of the empirical correlation integral.

class believe14.estimation.DANCo(*, n_neighbors=10, max_dimension=None, random_state=None)#

Dimension from Angle and Norm Concentration (DANCo).

For every integer candidate from two through max_dimension, one equally sized uniform unit-ball calibration sample is drawn using a local random generator. Equation (13)’s sum of the norm and von Mises KL divergences chooses the dimension. Equal-distance neighbors are ordered stably by row index; a tie between the first and (k+1)-st radii is rejected because the norm likelihood is then singular. The angular model is defined only for intrinsic dimensions of at least two; collinear data are rejected.

References

Ceruti, C. et al. (2014), Pattern Recognition 47, 2569–2581.

fit(X, y=None, *, neighbors=None)#

Calibrate and minimize the joint paper divergence.

class believe14.estimation.LevinaBickelMLE(*, k_min=10, k_max=20, bias_correction=True)#

Estimate dimension from local Poisson-process likelihoods.

For each k in [k_min, k_max], local estimates use Equation (8) of Levina and Bickel. bias_correction=True replaces its k - 1 factor by the paper’s asymptotically unbiased k - 2 factor. The global result is the arithmetic mean over observations and then over k (Equation 9).

The matrix local_dimensions_by_k_ records each observation (rows) at each fitted neighbor count (columns in k_values_ order).

References

Levina, E. and Bickel, P. J. (2004), Advances in NIPS 17, 777–784.

fit(X, y=None, *, neighbors=None)#

Fit the averaged local likelihood estimator.

class believe14.estimation.MiNDML(*, n_neighbors=10, max_dimension=None)#

Maximum likelihood for normalized minimum-neighbor distances.

The statistic is rho_i = T_1(i) / T_{k+1}(i) and its density is g(r; k, d) = k d r**(d-1) (1-r**d)**(k-1). The likelihood is optimized continuously on [1, max_dimension]; this class does not silently round the estimate to an integer.

References

Lombardi, G. et al. (2011), ECML PKDD, LNCS 6912, 374–389.

fit(X, y=None, *, neighbors=None)#

Maximize the normalized minimum-distance likelihood.

class believe14.estimation.TightLocalEstimator(*, n_neighbors=20)#

Estimate one intrinsic dimension per observation using reflected moving centers.

Uses the TLE variant of Amsaleg et al. (2022), with ordered distinct neighbor pairs and their reflected centers. The arithmetic mean of local estimates is provided as a descriptive global summary. Neighborhoods are exact Euclidean neighborhoods excluding the observation itself.

fit(X, y=None, *, neighbors=None)#

Fit the pointwise likelihoods at the selected neighborhood size.

class believe14.estimation.TwoNN(*, discard_fraction=0.1)#

Estimate dimension by the Facco et al. two-neighbor ratio regression.

The largest 10 percent of ratios are discarded by default exactly as in the paper. Positive distance ties are retained; exact neighbor ties are broken stably by input row index and only the radii enter the statistic.

Parameters:

discard_fraction (float, default=0.1) – Fraction of the largest r_2 / r_1 ratios omitted before fitting the line through the origin.

References

Facco, E. et al. (2017), Scientific Reports 7, 12140.

fit(X, y=None, *, neighbors=None)#

Fit the origin-constrained empirical-CDF regression.

class believe14.estimation.UStatisticDimension(*, max_dimension=None, random_state=None)#

Estimate dimension with the Hein–Audibert five-scale U-statistic.

The implementation follows Sections 3.1–3.2: the compact kernel is k(x)=(1-x)_+, subsample divisors are 1 through 5, weights are 1/r, and the selected integer candidate has the smallest absolute log-log slope. A local random permutation makes the interleaved paper partitions independent of an externally sorted input while preserving their i.i.d. interpretation.

Finite-sample accuracy is assessed separately from numerical convergence. The registry and validation ledger record the current status and tested configurations. Successful computation does not certify dimension recovery.

References

Hein, M. and Audibert, J.-Y. (2005), ICML, 289–296.

fit(X, y=None)#

Evaluate all paper candidate slopes and choose the flattest.

Neighborhoods and embedding quality#

Reusable exact Euclidean neighborhoods with deterministic tie handling.

class believe14.neighbors.ExactNeighborGraph(X, n_neighbors=5)#

Immutable, directed nearest-neighbor lists for a particular ordered dataset.

Each row excludes itself. Distinct observations at equal distance are ordered by their original row index. A graph built for k neighbors can supply every smaller neighborhood without repeating the distance search.

property distances#

Euclidean distances ordered from nearest to farthest.

property indices#

Training row indices of the selected neighbors.

query(X, n_neighbors)#

Return a prefix after checking that X matches the original observations.

believe14.neighbors.build_neighbor_graph(X, n_neighbors=5)#

Compute exact sorted neighbors using O(nk + np) working memory.

Local neighborhood fidelity measures for dimensionality reduction.

believe14.metrics.trustworthiness(X, embedding, *, n_neighbors=5)#

Score neighborhood intrusions in the embedding on a scale of zero to one.

Each embedded neighbor is penalized by how far its original rank exceeds k (Venna and Kaski, 2001). Self is excluded; ties follow input row order. The standard normalization requires k < n/2.

believe14.metrics.continuity(X, embedding, *, n_neighbors=5)#

Score missing original neighbors using their ranks in the embedding.

Using a neighbor graph in a pipeline#

Pass neighbors=graph directly to a supported estimator’s fit method. When scikit-learn metadata routing is enabled, use the estimator’s set_fit_request(neighbors=True) to request a graph through a pipeline. Build the graph for the exact rows being fitted, including their order. Cross-validation folds require their own training graphs. See the scikit-learn metadata routing guide.

Registry and contracts#

Public typing and diagnostic records for believe14 estimators.

class believe14.api.Capability(*values)#

Capabilities advertised by a public estimator.

class believe14.api.FitDiagnostics(*, solver, converged, n_iter=None, residual_norm=None, objective_value=None, numerical_rank=None, condition_estimate=None, warnings=())#

Numerical status recorded by every successful fit.

class believe14.api.EstimatorInfo(*, name, qualified_name, family, approaches, supervision, input_kinds, capabilities, out_of_sample, complexity, references, estimator, validation_status='validated')#

Immutable public registry entry.

validation_status describes the recorded evidence, not a guarantee for untested data. Experimental methods have unresolved accuracy limitations.

class believe14.api.EstimatorProtocol(*args, **kwargs)#

Static structural contract shared by public estimators.

class believe14.api.DimensionEstimatorProtocol(*args, **kwargs)#

Contract for global intrinsic-dimension estimators.

class believe14.api.TransductiveEmbeddingProtocol(*args, **kwargs)#

Contract for embeddings defined only on their training observations.

class believe14.api.InductiveEmbeddingProtocol(*args, **kwargs)#

Contract for embeddings with a justified out-of-sample map.

class believe14.api.InvertibleEmbeddingProtocol(*args, **kwargs)#

Contract for embeddings with a defined reconstruction map.

class believe14.api.FeatureSelectorProtocol(*args, **kwargs)#

Contract for supervised or unsupervised feature selectors.

class believe14.api.PairedViewEmbeddingProtocol(*args, **kwargs)#

Contract for estimators trained on two aligned data views.

transform(**kwds)#

Helper for @overload to raise when called.

Explicit registry of the 35 public believe14 estimators.

believe14.registry.list_estimators(*, family=None, capability=None, supervision=None, approach=None, validation_status=None)#

List explicitly allowlisted public estimators matching all filters.

Validation status refers to the evidence recorded in each method’s ledger; it does not guarantee accuracy outside the tested scenarios.

believe14.registry.get_estimator(name)#

Return a public estimator record by class or qualified name.

believe14.registry.public_estimator_names()#

Return the frozen public class-name inventory without importing methods.