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
TThe numeric type for calculations (e.g., float, double).
- Inheritance
-
PHATE<T>
- Implements
- 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
nComponentsintTarget dimensionality. Defaults to 2.
nNeighborsintNumber of neighbors for affinity computation. Defaults to 5.
diffusionTimeintNumber of diffusion steps. Defaults to auto (-1) or use specific value.
decaydoubleAlpha decay for kernel. Defaults to 40.
gammadoubleInformational distance parameter. Defaults to 1 (log potential).
randomStateint?Random seed for reproducibility.
columnIndicesint[]The column indices to use, or null for all columns.
Properties
DiffusionTime
Gets the diffusion time parameter.
public int DiffusionTime { get; }
Property Value
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
NNeighbors
Gets the number of neighbors.
public int NNeighbors { get; }
Property Value
SupportsInverseTransform
Gets whether this transformer supports inverse transformation.
public override bool SupportsInverseTransform { get; }
Property Value
Methods
FitCore(Matrix<T>)
Fits PHATE and computes the embedding.
protected override void FitCore(Matrix<T> data)
Parameters
dataMatrix<T>
GetFeatureNamesOut(string[]?)
Gets the output feature names after transformation.
public override string[] GetFeatureNamesOut(string[]? inputFeatureNames = null)
Parameters
inputFeatureNamesstring[]
Returns
- string[]
InverseTransformCore(Matrix<T>)
Inverse transformation is not supported.
protected override Matrix<T> InverseTransformCore(Matrix<T> data)
Parameters
dataMatrix<T>
Returns
- Matrix<T>
TransformCore(Matrix<T>)
Returns the embedding computed during Fit.
protected override Matrix<T> TransformCore(Matrix<T> data)
Parameters
dataMatrix<T>
Returns
- Matrix<T>