Table of Contents

Class PHATE<T>

Namespace
AiDotNet.Preprocessing.DimensionalityReduction
Assembly
AiDotNet.dll

PHATE: Potential of Heat-diffusion for Affinity-based Transition Embedding.

public class PHATE<T> : TransformerBase<T, Matrix<T>, Matrix<T>>, IDataTransformer<T, Matrix<T>, Matrix<T>>

Type Parameters

T

The numeric type for calculations (e.g., float, double).

Inheritance
TransformerBase<T, Matrix<T>, Matrix<T>>
PHATE<T>
Implements
IDataTransformer<T, Matrix<T>, Matrix<T>>
Inherited Members

Remarks

PHATE is a dimensionality reduction method designed for visualizing high-dimensional biological data, particularly single-cell data. It captures both local and global structure by using diffusion-based distances and a special potential distance metric.

The algorithm: 1. Compute local affinities using adaptive bandwidth Gaussian kernel 2. Construct diffusion operator from affinities 3. Diffuse for t steps to capture multi-scale structure 4. Compute potential distance using log transform 5. Embed using MDS on potential distances

For Beginners: PHATE excels at revealing data trajectories: - Captures smooth progression paths in data (differentiation, time courses) - Preserves both local clusters and global connectivity - The potential distance emphasizes transitions between states - Particularly effective for biological data

Use cases:

  • Single-cell RNA sequencing visualization
  • Developmental trajectories and cell differentiation
  • Time-series data with smooth transitions
  • Any data with underlying continuous processes

Constructors

PHATE(int, int, int, double, double, int?, int[]?)

Creates a new instance of PHATE<T>.

public PHATE(int nComponents = 2, int nNeighbors = 5, int diffusionTime = -1, double decay = 40, double gamma = 1, int? randomState = null, int[]? columnIndices = null)

Parameters

nComponents int

Target dimensionality. Defaults to 2.

nNeighbors int

Number of neighbors for affinity computation. Defaults to 5.

diffusionTime int

Number of diffusion steps. Defaults to auto (-1) or use specific value.

decay double

Alpha decay for kernel. Defaults to 40.

gamma double

Informational distance parameter. Defaults to 1 (log potential).

randomState int?

Random seed for reproducibility.

columnIndices int[]

The column indices to use, or null for all columns.

Properties

DiffusionTime

Gets the diffusion time parameter.

public int DiffusionTime { get; }

Property Value

int

Embedding

Gets the embedding result.

public double[,]? Embedding { get; }

Property Value

double[,]

NComponents

Gets the number of components (dimensions).

public int NComponents { get; }

Property Value

int

NNeighbors

Gets the number of neighbors.

public int NNeighbors { get; }

Property Value

int

SupportsInverseTransform

Gets whether this transformer supports inverse transformation.

public override bool SupportsInverseTransform { get; }

Property Value

bool

Methods

FitCore(Matrix<T>)

Fits PHATE and computes the embedding.

protected override void FitCore(Matrix<T> data)

Parameters

data Matrix<T>

GetFeatureNamesOut(string[]?)

Gets the output feature names after transformation.

public override string[] GetFeatureNamesOut(string[]? inputFeatureNames = null)

Parameters

inputFeatureNames string[]

Returns

string[]

InverseTransformCore(Matrix<T>)

Inverse transformation is not supported.

protected override Matrix<T> InverseTransformCore(Matrix<T> data)

Parameters

data Matrix<T>

Returns

Matrix<T>

TransformCore(Matrix<T>)

Returns the embedding computed during Fit.

protected override Matrix<T> TransformCore(Matrix<T> data)

Parameters

data Matrix<T>

Returns

Matrix<T>