/** @import {InputType} from "../index.js" */ /** * @abstract * @template {InputType} T * @template {{ seed?: number }} Para * * Base class for all Dimensionality Reduction (DR) algorithms. * * Provides a common interface for parameters management, data initialization, * and transformation (both synchronous and asynchronous). * * @class */ export class DR< T extends InputType, Para extends { seed?: number; }, > { /** * Computes the projection. * * @template {InputType} T * @template {{ seed?: number }} Para * @param {T} X * @param {Para} parameters * @param {...unknown} args - Takes the same arguments of the constructor of the respective DR method. * @returns {T} The dimensionality reduced dataset. */ static transform< T_1 extends InputType, Para_1 extends { seed?: number; }, >(X: T_1, parameters: Para_1, ...args: unknown[]): T_1; /** * Computes the projection. * * @template {{ seed?: number }} Para * @param {InputType} X * @param {Para} parameters * @param {...unknown} args - Takes the same arguments of the constructor of the respective DR method. * @returns {Generator} A generator yielding the intermediate steps of the dimensionality * reduction method. */ static generator< Para_1 extends { seed?: number; }, >(X: InputType, parameters: Para_1, ...args: unknown[]): Generator; /** * Computes the projection. * * @template {{ seed?: number }} Para * @param {InputType} X * @param {Para} parameters * @param {...unknown} args - Takes the same arguments of the constructor of the respective DR method. * @returns {Promise} A promise yielding the dimensionality reduced dataset. */ static transform_async< Para_1 extends { seed?: number; }, >(X: InputType, parameters: Para_1, ...args: unknown[]): Promise; /** * Takes the default parameters and seals them, remembers the type of input `X`, and initializes the random number * generator. * * @param {T} X - The high-dimensional data. * @param {Para} default_parameters - Object containing default parameterization of the DR method. * @param {Partial} parameters - Object containing parameterization of the DR method to override defaults. */ constructor(X: T, default_parameters: Para, parameters?: Partial); /** @type {number} */ _D: number; /** @type {number} */ _N: number; /** @type {Randomizer} */ _randomizer: Randomizer; /** @type {boolean} */ _is_initialized: boolean; /** @type {T} */ __input: T; /** @type {Para} */ _parameters: Para; /** @type {"array" | "matrix" | "typed"} */ _type: "array" | "matrix" | "typed"; /** @type {Matrix} */ X: Matrix; /** @type {Matrix} */ Y: Matrix; /** * Get all Parameters. * @overload * @returns {Para} */ parameter(): Para; /** * Get value of given parameter. * @template {keyof Para} K * @overload * @param {K} name - Name of the parameter. * @returns {Para[K]} */ parameter(name: K): Para[K]; /** * Set value of given parameter. * @template {keyof Para} K * @overload * @param {K} name - Name of the parameter. * @param {Para[K]} value - Value of the parameter to set. * @returns {this} */ parameter(name: K, value: Para[K]): this; /** * Computes the projection. * * @abstract * @param {...unknown} args * @returns {T} The projection. */ transform(...args: unknown[]): T; /** * Computes the projection. * * @abstract * @param {...unknown} args * @returns {Generator} The intermediate steps of the projection. */ generator(...args: unknown[]): Generator; /** * @abstract * @param {...unknown} args */ init(...args: unknown[]): void; /** * If the respective DR method has an `init` function, call it before `transform`. * * @returns {DR} */ check_init(): DR; /** @returns {T} The projection in the type of input `X`. */ get projection(): T; /** * Computes the projection. * * @param {...unknown} args - Arguments the transform method of the respective DR method takes. * @returns {Promise} The dimensionality reduced dataset. */ transform_async(...args: unknown[]): Promise; } import type { InputType } from "../index.js"; import { Randomizer } from "../util/index.js"; import { Matrix } from "../matrix/index.js"; //# sourceMappingURL=DR.d.ts.map