Learning API#

The learning namespace provides validated data adaptation, differentiable geometry primitives, supervised and semi-supervised prediction, intrinsic statistics, robust and scalable summaries, clustering, inference, transport, dimension reduction, and metric learning. High-level algorithms operate on dense distance matrices unless their documentation says otherwise.

Data and capability contracts#

class geojax.learning.ManifoldData(manifold, values, n_samples, batch_shape, event_shapes, report)#

Bases: object

Canonical observations bound to the geometry that validated them.

Binding prevents a validated dataset from being silently reused under a different metric or representation with the same event shape. Reusing the object with its original geometry skips checks that are already at least as strong as the requested validation level.

Parameters:
  • manifold (Any)

  • values (Any)

  • n_samples (int)

  • batch_shape (tuple[int, ...])

  • event_shapes (Any)

  • report (DataValidationReport)

class geojax.learning.DataValidationReport(valid, check, n_samples, batch_shape, invalid_count=0, repaired_count=0, messages=())#

Bases: object

Eager validation summary for one adapted manifold dataset.

Parameters:
  • valid (bool)

  • check (str)

  • n_samples (int)

  • batch_shape (tuple[int, ...])

  • invalid_count (int)

  • repaired_count (int)

  • messages (tuple[str, ...])

class geojax.learning.ManifoldDataAdapterProtocol(*args, **kwargs)#

Bases: Protocol

Callable protocol for user-registered representation adapters.

class geojax.learning.EquivariantEmbeddingProtocol(*args, **kwargs)#

Bases: Protocol

Geometry protocol for algorithms that require Euclidean embeddings.

embed(x)#

Map a represented point to equivariant Euclidean coordinates.

Parameters:

x (Any)

Return type:

Any

exception geojax.learning.LearningCapabilityError#

Bases: ValueError

Raised when an algorithm needs unavailable exact geometry operations.

geojax.learning.as_manifold_data(manifold, values, *, sample_axis=None, representation='canonical', check='belongs', repair=False)#

Convert manifold observations to the canonical learning-data layout.

sample_axis=None denotes the axis immediately before each geometry’s event dimensions. Product representations and axes may be pytrees matching manifold.factors. Python sequences of complete points require representation='point_sequence' so their interpretation is explicit.

Parameters:
  • manifold (Any)

  • values (Any)

  • sample_axis (Any)

  • representation (Any)

  • check (str)

  • repair (bool)

Return type:

ManifoldData

geojax.learning.check_manifold_data(manifold, values, *, sample_axis=None, representation='canonical', check='belongs')#

Return a validation report without propagating data-validation errors.

Parameters:
  • manifold (Any)

  • values (Any)

  • sample_axis (Any)

  • representation (Any)

  • check (str)

Return type:

DataValidationReport

geojax.learning.register_manifold_data_adapter(geometry_type, representation, adapter, *, overwrite=False)#

Register an explicit representation converter for a geometry class.

Parameters:
Return type:

None

Geometric primitives#

geojax.learning.pairwise_distances(manifold, x, y=None, *, squared=False, block_size=None)#

Return all pairwise exact distances between two point collections.

Collections use batch_shape + (n_samples,) + event_shape. Product collections use the factor pytree and share their sample and batch axes. block_size limits the number of right-hand samples materialized in one geometry call while retaining a dense result.

Parameters:
  • manifold (Any)

  • x (Any)

  • y (Any | None)

  • squared (bool)

  • block_size (int | None)

Return type:

Any

geojax.learning.geodesic_interpolation(manifold, x, y, t)#

Evaluate Exp_x(t Log_x(y)) on the selected exact geodesic.

Parameters:
  • manifold (Any)

  • x (Any)

  • y (Any)

  • t (Any)

Return type:

Any

geojax.learning.tangent_space_map(source, target, x, *, source_base, target_base, transform)#

Apply a user transform between exact source and target tangent spaces.

Parameters:
  • source (Any)

  • target (Any)

  • x (Any)

  • source_base (Any)

  • target_base (Any)

  • transform (Callable[[Any], Any])

Return type:

Any

geojax.learning.nearest_neighbors(manifold, data, queries=None, *, n_neighbors=5, exclude_self=True, block_size=None)#

Find exact-distance nearest neighbors in a dense manifold dataset.

Parameters:
  • manifold (Any)

  • data (Any)

  • queries (Any | None)

  • n_neighbors (int)

  • exclude_self (bool)

  • block_size (int | None)

Return type:

NeighborsResult

class geojax.learning.NeighborsResult(distances: 'Any', indices: 'Any')#

Bases: object

Parameters:
  • distances (Any)

  • indices (Any)

Statistics and scalar-response regression#

geojax.learning.frechet_mean(manifold, data, *, sample_weight=None, initial_point=None, solver=None, maxiter=200, tol=1e-07)#

Compute a weighted Fréchet mean minimizing sum_i w_i d(x, x_i)^2.

Parameters:
  • manifold (Any)

  • data (Any)

  • sample_weight (Any | None)

  • initial_point (Any | None)

  • solver (Any | None)

  • maxiter (int)

  • tol (float)

Return type:

FrechetMeanResult

geojax.learning.frechet_median(manifold, data, *, sample_weight=None, initial_point=None, smoothing=1e-08, maxiter=200, tol=1e-07)#

Compute a weighted geometric median with a guarded Weiszfeld iteration.

Parameters:
  • manifold (Any)

  • data (Any)

  • sample_weight (Any | None)

  • initial_point (Any | None)

  • smoothing (float)

  • maxiter (int)

  • tol (float)

Return type:

FrechetMedianResult

geojax.learning.minimum_enclosing_ball(manifold, data, *, initial_point=None, maxiter=500, tol=1e-07)#

Approximate the smallest enclosing geodesic ball by farthest-point updates.

Parameters:
  • manifold (Any)

  • data (Any)

  • initial_point (Any | None)

  • maxiter (int)

  • tol (float)

Return type:

EnclosingBallResult

geojax.learning.kernel_regression(manifold, data, targets, *, bandwidth, kernel=None)#

Fit Nadaraya-Watson regression with manifold-valued predictors.

Parameters:
  • manifold (Any)

  • data (Any)

  • targets (Any)

  • bandwidth (float)

  • kernel (Callable[[Any, float], Any] | None)

Return type:

KernelRegressionModel

geojax.learning.select_kernel_bandwidth(manifold, data, targets, bandwidths, *, n_folds=5, key, kernel=None)#

Select a kernel bandwidth by deterministic-key K-fold mean squared error.

Parameters:
  • manifold (Any)

  • data (Any)

  • targets (Any)

  • bandwidths (Any)

  • n_folds (int)

  • key (Any | int | None)

  • kernel (Callable[[Any, float], Any] | None)

Return type:

KernelCVResult

class geojax.learning.FrechetMeanResult(point: 'Any', objective: 'Any', gradient_norm: 'Any', iterations: 'int', converged: 'bool', reason: 'str', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • point (Any)

  • objective (Any)

  • gradient_norm (Any)

  • iterations (int)

  • converged (bool)

  • reason (str)

  • diagnostics (Mapping[str, Any])

class geojax.learning.FrechetMedianResult(point: 'Any', objective: 'Any', gradient_norm: 'Any', iterations: 'int', converged: 'bool', reason: 'str', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • point (Any)

  • objective (Any)

  • gradient_norm (Any)

  • iterations (int)

  • converged (bool)

  • reason (str)

  • diagnostics (Mapping[str, Any])

class geojax.learning.EnclosingBallResult(center: 'Any', radius: 'Any', objective: 'Any', iterations: 'int', converged: 'bool', reason: 'str', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • center (Any)

  • radius (Any)

  • objective (Any)

  • iterations (int)

  • converged (bool)

  • reason (str)

  • diagnostics (Mapping[str, Any])

class geojax.learning.KernelRegressionModel(manifold: 'Any', training_data: 'Any', targets: 'Any', bandwidth: 'float', kernel: 'Callable[..., Any] | None')#

Bases: object

Parameters:
  • manifold (Any)

  • training_data (Any)

  • targets (Any)

  • bandwidth (float)

  • kernel (Callable[[...], Any] | None)

class geojax.learning.KernelCVResult(model: 'KernelRegressionModel', bandwidth: 'float', scores: 'Any', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:

Supervised classification#

geojax.learning.nearest_centroid_classifier(manifold, data, labels, *, sample_weight=None, maxiter=200, tol=1e-07)#

Fit one intrinsic Fréchet centroid per class.

Parameters:
  • manifold (Any)

  • data (Any)

  • labels (Any)

  • sample_weight (Any | None)

  • maxiter (int)

  • tol (float)

Return type:

NearestCentroidModel

geojax.learning.knn_classifier(manifold, data, labels, *, n_neighbors=5, weights='uniform')#

Fit a geodesic-distance k-nearest-neighbors classifier.

Parameters:
  • manifold (Any)

  • data (Any)

  • labels (Any)

  • n_neighbors (int)

  • weights (str)

Return type:

KNearestNeighborsModel

geojax.learning.tangent_space_logistic_regression(manifold, data, labels, *, base_point=None, n_components=None, regularization=0.001, maxiter=500, tol=1e-07, learning_rate=1.0)#

Fit multinomial logistic regression in intrinsic tangent coordinates.

Parameters:
  • manifold (Any)

  • data (Any)

  • labels (Any)

  • base_point (Any | None)

  • n_components (int | None)

  • regularization (float)

  • maxiter (int)

  • tol (float)

  • learning_rate (float)

Return type:

TangentSpaceClassifierModel

geojax.learning.tangent_space_discriminant_analysis(manifold, data, labels, *, method='lda', base_point=None, n_components=None, regularization=0.0001, priors=None)#

Fit LDA or QDA in intrinsic metric-orthonormal tangent coordinates.

Parameters:
  • manifold (Any)

  • data (Any)

  • labels (Any)

  • method (str)

  • base_point (Any | None)

  • n_components (int | None)

  • regularization (float)

  • priors (Any | None)

Return type:

TangentSpaceClassifierModel

class geojax.learning.NearestCentroidModel(manifold: 'Any', classes: 'Any', centers: 'Any', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • manifold (Any)

  • classes (Any)

  • centers (Any)

  • diagnostics (Mapping[str, Any])

class geojax.learning.KNearestNeighborsModel(manifold: 'Any', training_data: 'Any', classes: 'Any', encoded_labels: 'Any', n_neighbors: 'int', weights: 'str', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • manifold (Any)

  • training_data (Any)

  • classes (Any)

  • encoded_labels (Any)

  • n_neighbors (int)

  • weights (str)

  • diagnostics (Mapping[str, Any])

class geojax.learning.TangentFeatureMap(manifold: 'Any', base_point: 'Any', basis: 'tuple[Any, ...]', eigenvalues: 'Any', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • manifold (Any)

  • base_point (Any)

  • basis (tuple[Any, ...])

  • eigenvalues (Any)

  • diagnostics (Mapping[str, Any])

class geojax.learning.TangentSpaceClassifierModel(manifold: 'Any', classes: 'Any', feature_map: 'TangentFeatureMap', method: 'str', coefficients: 'Any' = None, intercept: 'Any' = None, location: 'Any' = None, scale: 'Any' = None, class_means: 'Any' = None, covariances: 'Any' = None, priors: 'Any' = None, objective: 'Any' = None, iterations: 'int' = 0, converged: 'bool' = True, reason: 'str' = 'closed-form fit', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • manifold (Any)

  • classes (Any)

  • feature_map (TangentFeatureMap)

  • method (str)

  • coefficients (Any)

  • intercept (Any)

  • location (Any)

  • scale (Any)

  • class_means (Any)

  • covariances (Any)

  • priors (Any)

  • objective (Any)

  • iterations (int)

  • converged (bool)

  • reason (str)

  • diagnostics (Mapping[str, Any])

Manifold-valued response regression#

geojax.learning.geodesic_regression(manifold, predictors, responses, *, sample_weight=None, initial_point=None, solver=None, maxiter=200, tol=1e-07)#

Fit Y(t) = Exp_p((t - t_bar) v) by intrinsic least squares.

Parameters:
  • manifold (Any)

  • predictors (Any)

  • responses (Any)

  • sample_weight (Any | None)

  • initial_point (Any | None)

  • solver (Any | None)

  • maxiter (int)

  • tol (float)

Return type:

GeodesicRegressionModel

geojax.learning.local_polynomial_regression(manifold, predictors, responses, *, bandwidth, degree=1, kernel=None, maxiter=100, tol=1e-06)#

Fit local-constant or local-linear Fréchet regression.

Parameters:
  • manifold (Any)

  • predictors (Any)

  • responses (Any)

  • bandwidth (float)

  • degree (int)

  • kernel (Callable[[Any, float], Any] | None)

  • maxiter (int)

  • tol (float)

Return type:

LocalPolynomialRegressionModel

class geojax.learning.GeodesicRegressionModel(manifold: 'Any', intercept: 'Any', slope: 'Any', predictor_mean: 'Any', objective: 'Any', iterations: 'int', converged: 'bool', reason: 'str', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • manifold (Any)

  • intercept (Any)

  • slope (Any)

  • predictor_mean (Any)

  • objective (Any)

  • iterations (int)

  • converged (bool)

  • reason (str)

  • diagnostics (Mapping[str, Any])

class geojax.learning.LocalPolynomialRegressionModel(manifold: 'Any', predictors: 'Any', training_data: 'Any', bandwidth: 'float', degree: 'int', kernel: 'Callable[..., Any] | None', maxiter: 'int', tol: 'float', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • manifold (Any)

  • predictors (Any)

  • training_data (Any)

  • bandwidth (float)

  • degree (int)

  • kernel (Callable[[...], Any] | None)

  • maxiter (int)

  • tol (float)

  • diagnostics (Mapping[str, Any])

Inference#

geojax.learning.frechet_anova(manifold, data, groups, *, method='asymptotic', n_permutations=999, key=None, maxiter=100, tol=1e-06, variance_floor=1e-12)#

Test equality of metric-space populations using Dubey-Mueller FANOVA.

Parameters:
  • manifold (Any)

  • data (Any)

  • groups (Any)

  • method (str)

  • n_permutations (int)

  • key (Any | int | None)

  • maxiter (int)

  • tol (float)

  • variance_floor (float)

Return type:

HypothesisTestResult

geojax.learning.biswas_ghosh_two_sample_test(manifold, x, y, *, n_permutations=999, key)#

Run the metric-space modification of the Biswas-Ghosh two-sample test.

Parameters:
  • manifold (Any)

  • x (Any)

  • y (Any)

  • n_permutations (int)

  • key (Any | int | None)

Return type:

HypothesisTestResult

geojax.learning.wasserstein_two_sample_test(manifold, x, y, *, p=2.0, n_permutations=999, key, tolerance=1e-10)#

Permutation test using exact empirical Wasserstein distance.

Parameters:
  • manifold (Any)

  • x (Any)

  • y (Any)

  • p (float)

  • n_permutations (int)

  • key (Any | int | None)

  • tolerance (float)

Return type:

HypothesisTestResult

geojax.learning.bootstrap_frechet_mean(manifold, data, *, sample_weight=None, n_bootstrap=999, confidence_level=0.95, key, maxiter=100, tol=1e-06)#

Bootstrap an intrinsic mean and return a geodesic confidence ball.

Parameters:
  • manifold (Any)

  • data (Any)

  • sample_weight (Any | None)

  • n_bootstrap (int)

  • confidence_level (float)

  • key (Any | int | None)

  • maxiter (int)

  • tol (float)

Return type:

BootstrapResult

geojax.learning.energy_two_sample_test(manifold, x, y, *, n_permutations=999, key)#

Run the metric energy-distance two-sample permutation test.

Parameters:
  • manifold (Any)

  • x (Any)

  • y (Any)

  • n_permutations (int)

  • key (Any | int | None)

Return type:

HypothesisTestResult

geojax.learning.kernel_mmd_two_sample_test(manifold, x, y, *, bandwidth=None, kernel=None, check_psd=True, psd_tolerance=1e-08, n_permutations=999, key)#

Run a finite-sample PSD-kernel maximum mean discrepancy test.

Parameters:
  • manifold (Any)

  • x (Any)

  • y (Any)

  • bandwidth (float | None)

  • kernel (Callable[[Any], Any] | None)

  • check_psd (bool)

  • psd_tolerance (float)

  • n_permutations (int)

  • key (Any | int | None)

Return type:

HypothesisTestResult

geojax.learning.paired_frechet_test(manifold, x, y, *, n_permutations=999, key, maxiter=100, tol=1e-06)#

Test a zero mean paired displacement by within-pair random sign flips.

Parameters:
  • manifold (Any)

  • x (Any)

  • y (Any)

  • n_permutations (int)

  • key (Any | int | None)

  • maxiter (int)

  • tol (float)

Return type:

HypothesisTestResult

class geojax.learning.HypothesisTestResult(statistic: 'Any', pvalue: 'Any', null_distribution: 'Any', method: 'str', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • statistic (Any)

  • pvalue (Any)

  • null_distribution (Any)

  • method (str)

  • diagnostics (Mapping[str, Any])

class geojax.learning.BootstrapResult(estimate: 'Any', replicates: 'Any', confidence_radius: 'Any', confidence_level: 'float', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • estimate (Any)

  • replicates (Any)

  • confidence_radius (Any)

  • confidence_level (float)

  • diagnostics (Mapping[str, Any])

Clustering#

geojax.learning.kmeans(manifold, data, *, n_clusters, key=None, sample_weight=None, init='kmeans++', n_init=1, maxiter=100, tol=1e-06, center_maxiter=100)#

Run weighted intrinsic Lloyd clustering with deterministic-key initialization.

Parameters:
  • manifold (Any)

  • data (Any)

  • n_clusters (int)

  • key (Any | int | None)

  • sample_weight (Any | None)

  • init (str | Any)

  • n_init (int)

  • maxiter (int)

  • tol (float)

  • center_maxiter (int)

Return type:

ClusteringResult

geojax.learning.lightweight_coreset(manifold, data, *, size, key, sample_weight=None)#

Sample the lightweight-coreset sensitivity heuristic on a manifold.

Parameters:
  • manifold (Any)

  • data (Any)

  • size (int)

  • key (Any | int | None)

  • sample_weight (Any | None)

Return type:

CoresetResult

geojax.learning.kmedoids(manifold, data, *, n_clusters, key, sample_weight=None, maxiter=100)#

Cluster using exact sample medoids and arbitrary manifold distances.

Parameters:
  • manifold (Any)

  • data (Any)

  • n_clusters (int)

  • key (Any | int | None)

  • sample_weight (Any | None)

  • maxiter (int)

Return type:

ClusteringResult

geojax.learning.agglomerative_clustering(manifold, data, *, n_clusters=2, linkage='average')#

Perform dense single, complete, or average-linkage clustering.

Parameters:
  • manifold (Any)

  • data (Any)

  • n_clusters (int)

  • linkage (str)

Return type:

HierarchicalClusteringResult

geojax.learning.spectral_clustering(manifold, data, *, n_clusters, key, affinity='rbf', bandwidth=None, n_neighbors=7, laplacian='symmetric', maxiter=100)#

Cluster an exact-distance affinity graph through a Laplacian embedding.

Parameters:
  • manifold (Any)

  • data (Any)

  • n_clusters (int)

  • key (Any | int | None)

  • affinity (str)

  • bandwidth (float | None)

  • n_neighbors (int)

  • laplacian (str)

  • maxiter (int)

Return type:

ClusteringResult

geojax.learning.mean_shift(manifold, data, *, bandwidth, sample_weight=None, maxiter=100, tol=1e-06, merge_tol=None)#

Find modes by Gaussian-kernel geodesic mean-shift updates.

Parameters:
  • manifold (Any)

  • data (Any)

  • bandwidth (float)

  • sample_weight (Any | None)

  • maxiter (int)

  • tol (float)

  • merge_tol (float | None)

Return type:

ClusteringResult

geojax.learning.competitive_quantization(manifold, data, *, n_clusters, key, epochs=10, initial_gain=0.5, decay=0.01)#

Run competitive learning Riemannian quantization (CLRQ).

Parameters:
  • manifold (Any)

  • data (Any)

  • n_clusters (int)

  • key (Any | int | None)

  • epochs (int)

  • initial_gain (float)

  • decay (float)

Return type:

ClusteringResult

class geojax.learning.ClusteringResult(labels: 'Any', centers: 'Any', objective: 'Any', iterations: 'int', converged: 'bool', reason: 'str', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • labels (Any)

  • centers (Any)

  • objective (Any)

  • iterations (int)

  • converged (bool)

  • reason (str)

  • diagnostics (Mapping[str, Any])

class geojax.learning.HierarchicalClusteringResult(labels: 'Any', linkage: 'Any', objective: 'Any', iterations: 'int', converged: 'bool', reason: 'str', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • labels (Any)

  • linkage (Any)

  • objective (Any)

  • iterations (int)

  • converged (bool)

  • reason (str)

  • diagnostics (Mapping[str, Any])

class geojax.learning.CoresetResult(indices: 'Any', points: 'Any', weights: 'Any', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • indices (Any)

  • points (Any)

  • weights (Any)

  • diagnostics (Mapping[str, Any])

Scalable summaries#

geojax.learning.streaming_frechet_mean(manifold, data, *, sample_weight=None, initial_point=None, initial_weight=0.0)#

Compute the one-pass inductive Fréchet mean in observation order.

initial_point influences the estimate only when initial_weight is positive, making any prior mass explicit rather than silently counting the starting point as an extra observation.

Parameters:
  • manifold (Any)

  • data (Any)

  • sample_weight (Any | None)

  • initial_point (Any | None)

  • initial_weight (float)

Return type:

FrechetMeanResult

geojax.learning.minibatch_frechet_mean(manifold, data, *, batch_size=32, epochs=10, key, sample_weight=None, initial_point=None, learning_rate=1.0, decay=0.1, tol=1e-06)#

Approximate a Fréchet mean by shuffled mini-batch log-map updates.

Parameters:
  • manifold (Any)

  • data (Any)

  • batch_size (int)

  • epochs (int)

  • key (Any | int | None)

  • sample_weight (Any | None)

  • initial_point (Any | None)

  • learning_rate (float)

  • decay (float)

  • tol (float)

Return type:

FrechetMeanResult

geojax.learning.minibatch_kmeans(manifold, data, *, n_clusters, batch_size=32, epochs=10, key, sample_weight=None, learning_rate=0.5, decay=0.01, tol=1e-06)#

Run shuffled mini-batch intrinsic k-means center updates.

Parameters:
  • manifold (Any)

  • data (Any)

  • n_clusters (int)

  • batch_size (int)

  • epochs (int)

  • key (Any | int | None)

  • sample_weight (Any | None)

  • learning_rate (float)

  • decay (float)

  • tol (float)

Return type:

ClusteringResult

Barycentric coding and dictionaries#

geojax.learning.geodesic_barycentric_coding(manifold, data, atoms, *, ridge=1e-06, maxiter=200, tol=1e-07, reconstruction_maxiter=100)#

Code points by simplex weights minimizing a log-map barycentric residual.

Parameters:
  • manifold (Any)

  • data (Any)

  • atoms (Any)

  • ridge (float)

  • maxiter (int)

  • tol (float)

  • reconstruction_maxiter (int)

Return type:

BarycentricCodingResult

geojax.learning.manifold_dictionary_learning(manifold, data, *, n_atoms, key=None, initial_atoms=None, sample_weight=None, ridge=1e-06, maxiter=20, coding_maxiter=100, center_maxiter=100, tol=1e-05)#

Alternate intrinsic barycentric codes and weighted atom updates.

Parameters:
  • manifold (Any)

  • data (Any)

  • n_atoms (int)

  • key (Any | int | None)

  • initial_atoms (Any | None)

  • sample_weight (Any | None)

  • ridge (float)

  • maxiter (int)

  • coding_maxiter (int)

  • center_maxiter (int)

  • tol (float)

Return type:

DictionaryLearningResult

class geojax.learning.BarycentricCodingResult(codes: 'Any', reconstructions: 'Any', objective: 'Any', iterations: 'int', converged: 'bool', reason: 'str', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • codes (Any)

  • reconstructions (Any)

  • objective (Any)

  • iterations (int)

  • converged (bool)

  • reason (str)

  • diagnostics (Mapping[str, Any])

class geojax.learning.DictionaryLearningResult(atoms: 'Any', codes: 'Any', reconstructions: 'Any', objective: 'Any', iterations: 'int', converged: 'bool', reason: 'str', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • atoms (Any)

  • codes (Any)

  • reconstructions (Any)

  • objective (Any)

  • iterations (int)

  • converged (bool)

  • reason (str)

  • diagnostics (Mapping[str, Any])

Robust analysis#

geojax.learning.trimmed_frechet_mean(manifold, data, *, trim_fraction=0.1, sample_weight=None, initial_point=None, maxiter=100, center_maxiter=100, tol=1e-06)#

Compute a least-trimmed-squares intrinsic location estimate.

Parameters:
  • manifold (Any)

  • data (Any)

  • trim_fraction (float)

  • sample_weight (Any | None)

  • initial_point (Any | None)

  • maxiter (int)

  • center_maxiter (int)

  • tol (float)

Return type:

RobustLocationResult

geojax.learning.geodesic_m_estimator(manifold, data, *, loss='huber', scale=None, sample_weight=None, initial_point=None, maxiter=100, center_maxiter=100, tol=1e-06)#

Compute a geodesic M-location by iteratively reweighted Fréchet means.

Parameters:
  • manifold (Any)

  • data (Any)

  • loss (str)

  • scale (float | None)

  • sample_weight (Any | None)

  • initial_point (Any | None)

  • maxiter (int)

  • center_maxiter (int)

  • tol (float)

Return type:

RobustLocationResult

geojax.learning.geodesic_spatial_depth(manifold, points, reference_data, *, sample_weight=None)#

Evaluate intrinsic spatial depth relative to a reference sample.

Parameters:
  • manifold (Any)

  • points (Any)

  • reference_data (Any)

  • sample_weight (Any | None)

Return type:

Any

geojax.learning.metric_distance_ranks(manifold, data, *, center=None, sample_weight=None, maxiter=100, tol=1e-06)#

Rank observations by geodesic distance from an intrinsic median.

Parameters:
  • manifold (Any)

  • data (Any)

  • center (Any | None)

  • sample_weight (Any | None)

  • maxiter (int)

  • tol (float)

Return type:

MetricRanksResult

class geojax.learning.RobustLocationResult(point: 'Any', objective: 'Any', gradient_norm: 'Any', iterations: 'int', converged: 'bool', reason: 'str', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • point (Any)

  • objective (Any)

  • gradient_norm (Any)

  • iterations (int)

  • converged (bool)

  • reason (str)

  • diagnostics (Mapping[str, Any])

class geojax.learning.MetricRanksResult(ranks: 'Any', scores: 'Any', center: 'Any', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • ranks (Any)

  • scores (Any)

  • center (Any)

  • diagnostics (Mapping[str, Any])

Semi-supervised learning#

geojax.learning.label_propagation(manifold, data, labels, *, unlabeled=-1, bandwidth=None, n_neighbors=None, alpha=0.95, maxiter=1000, tol=1e-07)#

Propagate categorical labels over a geodesic-distance affinity graph.

Parameters:
  • manifold (Any)

  • data (Any)

  • labels (Any)

  • unlabeled (Any)

  • bandwidth (float | None)

  • n_neighbors (int | None)

  • alpha (float)

  • maxiter (int)

  • tol (float)

Return type:

SemiSupervisedResult

geojax.learning.manifold_regularized_regression(manifold, data, targets, *, labeled_mask=None, bandwidth=None, n_neighbors=None, ambient_regularization=0.001, intrinsic_regularization=1.0)#

Fit transductive squared-loss regression with graph-Laplacian regularization.

Parameters:
  • manifold (Any)

  • data (Any)

  • targets (Any)

  • labeled_mask (Any | None)

  • bandwidth (float | None)

  • n_neighbors (int | None)

  • ambient_regularization (float)

  • intrinsic_regularization (float)

Return type:

SemiSupervisedResult

class geojax.learning.SemiSupervisedResult(predictions: 'Any', scores: 'Any', objective: 'Any', iterations: 'int', converged: 'bool', reason: 'str', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • predictions (Any)

  • scores (Any)

  • objective (Any)

  • iterations (int)

  • converged (bool)

  • reason (str)

  • diagnostics (Mapping[str, Any])

Dimension reduction#

geojax.learning.classical_mds(manifold, data, *, n_components=2)#

Classical scaling of the exact manifold distance matrix.

Parameters:
  • manifold (Any)

  • data (Any)

  • n_components (int)

Return type:

EmbeddingResult

geojax.learning.principal_geodesic_analysis(manifold, data, *, n_components=2, mean=None, maxiter=200, tol=1e-07)#

Perform tangent PCA using the Riemannian metric at a Fréchet mean.

Parameters:
  • manifold (Any)

  • data (Any)

  • n_components (int)

  • mean (Any | None)

  • maxiter (int)

  • tol (float)

Return type:

EmbeddingResult

geojax.learning.kernel_pca(manifold, data, *, n_components=2, bandwidth=None, kernel=None)#

Kernel PCA using an RBF manifold-distance kernel or user callable.

Parameters:
  • manifold (Any)

  • data (Any)

  • n_components (int)

  • bandwidth (float | None)

  • kernel (Callable[[Any, float], Any] | None)

Return type:

EmbeddingResult

geojax.learning.isomap(manifold, data, *, n_components=2, n_neighbors=7, mutual=True, disconnected='error')#

Isomap with a dense exact-distance neighbor graph.

Parameters:
  • manifold (Any)

  • data (Any)

  • n_components (int)

  • n_neighbors (int)

  • mutual (bool)

  • disconnected (str)

Return type:

EmbeddingResult

geojax.learning.sammon_mapping(manifold, data, *, n_components=2, maxiter=300, tol=1e-07)#

Optimize Sammon stress from a classical-MDS initialization.

Parameters:
  • manifold (Any)

  • data (Any)

  • n_components (int)

  • maxiter (int)

  • tol (float)

Return type:

EmbeddingResult

geojax.learning.tsne(manifold, data, *, n_components=2, perplexity=30.0, key, maxiter=1000, learning_rate=None, early_exaggeration=12.0, exaggeration_iterations=250)#

Dense t-SNE from exact manifold distances with explicit random state.

Parameters:
  • manifold (Any)

  • data (Any)

  • n_components (int)

  • perplexity (float)

  • key (Any | int | None)

  • maxiter (int)

  • learning_rate (float | None)

  • early_exaggeration (float)

  • exaggeration_iterations (int)

Return type:

EmbeddingResult

geojax.learning.phate(manifold, data, *, n_components=2, n_neighbors=5, decay=40.0, diffusion_time=None, max_diffusion_time=50, potential='log')#

Dense PHATE using adaptive manifold-distance diffusion affinities.

Parameters:
  • manifold (Any)

  • data (Any)

  • n_components (int)

  • n_neighbors (int)

  • decay (float)

  • diffusion_time (int | None)

  • max_diffusion_time (int)

  • potential (str)

Return type:

EmbeddingResult

class geojax.learning.EmbeddingResult(coordinates: 'Any', objective: 'Any', iterations: 'int', converged: 'bool', reason: 'str', model: 'Any' = None, diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • coordinates (Any)

  • objective (Any)

  • iterations (int)

  • converged (bool)

  • reason (str)

  • model (Any)

  • diagnostics (Mapping[str, Any])

Transport and metric learning#

geojax.learning.empirical_wasserstein_distance(manifold, x, y, *, p=2.0, weights_x=None, weights_y=None, tolerance=1e-10, max_pivots=10000)#

Compute exact weighted empirical Wasserstein distance by transportation simplex.

Parameters:
  • manifold (Any)

  • x (Any)

  • y (Any)

  • p (float)

  • weights_x (Any | None)

  • weights_y (Any | None)

  • tolerance (float)

  • max_pivots (int)

Return type:

TransportResult

geojax.learning.sinkhorn_divergence(manifold, x, y, *, epsilon=0.05, p=2.0, weights_x=None, weights_y=None)#

Return debiased entropic transport divergence through optional OTT-JAX.

Parameters:
  • manifold (Any)

  • x (Any)

  • y (Any)

  • epsilon (float)

  • p (float)

  • weights_x (Any | None)

  • weights_y (Any | None)

Return type:

Any

class geojax.learning.TransportResult(distance: 'Any', cost: 'Any', plan: 'Any', iterations: 'int', converged: 'bool', reason: 'str', diagnostics: 'Mapping[str, Any]'=<factory>)#

Bases: object

Parameters:
  • distance (Any)

  • cost (Any)

  • plan (Any)

  • iterations (int)

  • converged (bool)

  • reason (str)

  • diagnostics (Mapping[str, Any])

geojax.learning.riemannian_metric_learning(manifold, data, labels, *, regularization=0.1, balance=0.5, embedding=None, eigenvalue_floor=1e-10)#

Fit regularized log-Euclidean RMML from embedded labeled pairs.

Parameters:
  • manifold (Any)

  • data (Any)

  • labels (Any)

  • regularization (float)

  • balance (float)

  • embedding (Callable[[Any], Any] | None)

  • eigenvalue_floor (float)

Return type:

MetricLearningModel

class geojax.learning.MetricLearningModel(metric: 'Any', embedding: 'Callable[[Any], Any]', regularization: 'float', diagnostics: 'Mapping[str, Any]' = <factory>)#

Bases: object

Parameters:
  • metric (Any)

  • embedding (Callable[[Any], Any])

  • regularization (float)

  • diagnostics (Mapping[str, Any])