API Reference#

Here, you will find detailed documentation of all the functions, classes, and methods available in our API.

Whether you are a developer who is new to our API or an experienced user looking for more advanced features, we hope you find this documentation helpful. If you have any questions or feedback, please don’t hesitate to reach out to us.

Algorithms#

This section provides an overview of the main algorithms implemented in the archetypes package. Each algorithm is designed to address different aspects of archetypal analysis, offering flexibility and performance across various computational backends. Explore the summaries and links below to learn more about their features, usage, and implementation details.

AA(n_archetypes, *[, max_iter, tol, init, ...])

Archetype Analysis.

KernelAA(n_archetypes, *[, kernel, ...])

Kernel Archetype Analysis.

FairAA(n_archetypes, *[, fairness_const, ...])

Fair Archetype Analysis.

FairKernelAA(n_archetypes, *[, ...])

Fair Kernel Archetype Analysis.

ADA(n_archetypes, *[, max_iter, tol, init, ...])

Archetypoid Analysis.

BiAA(n_archetypes, *[, max_iter, tol, init, ...])

Biarchetype Analysis.

SymmetricBiAA(n_archetypes, *[, max_iter, ...])

Symmetric BiArchetype Analysis.

NAA(n_archetypes, *[, max_iter, tol, init, ...])

N-dimensional archetype Analysis.

Visualization#

This section covers the visualization tools provided by the archetypes package. These utilities help you interpret and present the results of archetypal analysis through a variety of plots and graphical representations. Use these functions to gain insights into your data and effectively communicate your findings.

simplex(data[, show_axis, axis_params, ...])

A simplex plot of data with multiple optional parameters to obtain a customized visualization.

stacked_bar(points[, ax])

A stacked bar plot of points with multiple optional parameters to obtain a customized visualization.

heatmap(data[, coefficients, n, reorder, ax])

Plot a heatmap of the data.

Datasets#

This section introduces dataset-related utilities included in the archetypes package. These functions allow you to generate synthetic datasets with known archetypal structures, load benchmark datasets, and create controlled experimental scenarios. They are essential for algorithm validation, performance benchmarking, testing new methodological ideas, and educational purposes in archetypal analysis.

make_archetypal_dataset(archetypes, shape[, ...])

Generate a dataset from archetypes.

Processing#

This section covers data processing and manipulation utilities designed specifically for archetypal analysis workflows. These functions help you organize, sort, and transform your data and analysis results to extract meaningful insights. Use these tools to prepare datasets for analysis, post-process archetypal results, find representative samples, and create ordered visualizations that reveal archetypal patterns and relationships in your data.

permute(data[, perms])

Permute a dataset along each dimension.

shuffle(data[, axis, generator])

Shuffle a dataset along each dimension.

sort_by_coefficients(data, coefficients[, ...])

Sort a dataset using the archetypal spaces previously computed.

sort_by_labels(data, labels[, reorder])

Sort a dataset using the labels.

get_closest_n(data, coefficients[, n, reorder])

Return the n samples closest to each archetype based on their coefficients.

get_closest_threshold(data, coefficients[, ...])

Return the samples closest to each archetype based on their coefficients.