import { DataFrameInterface, Scikit1D, Transformer, Tensor2D } from '../types'; import { Serialize } from '../simpleSerializer'; declare type Selection = string | string[] | number[] | number; declare type SingleTransformation = [string, Transformer, Selection]; declare type TransformerTriple = Array; /** * The parameters for the Column Transormer */ export interface ColumnTransformerParams { /** * A list of transformations. Every element is itself a list [name, Transformer, Selection]. **default = []** */ transformers?: TransformerTriple; /** * What should we do with the remainder columns? Possible values for remainder are a Transformer that * will be applied to all remaining columns. It can also be 'passthrough' which simply passes the columns * untouched through this, or 'drop', which drops all untransformed columns. **default = "drop"** */ remainder?: Transformer | 'drop' | 'passthrough'; } /** * The ColumnTransformer transformers a 2D matrix of mixed types, with possibly missing values * into a 2DMatrix that is ready to be put into a machine learning model. Usually this class does * the heavy lifting associated with imputing missing data, one hot encoding categorical variables, * and any other preprocessing steps that are deemed necessary (standard scaling, etc). * * @example * ```typescript const X = [ [2, 2], [2, 3], [0, NaN], [2, 0] ] const transformer = new ColumnTransformer({ transformers: [ ['minmax', new MinMaxScaler(), [0]], ['simpleImpute', new SimpleImputer({ strategy: 'median' }), [1]] ] }) let result = transformer.fitTransform(X) const expected = [ [1, 2], [1, 3], [0, 2], [1, 0] ] * ``` */ export declare class ColumnTransformer extends Serialize { transformers: TransformerTriple; remainder: Transformer | 'drop' | 'passthrough'; /** Useful for pipelines and column transformers to have a default name for transforms */ name: string; tf: any; constructor({ transformers, remainder }?: ColumnTransformerParams); fit(X: Tensor2D | DataFrameInterface, y?: Scikit1D): this; transform(X: Tensor2D | DataFrameInterface, y?: Scikit1D): any; fitTransform(X: Tensor2D | DataFrameInterface, y?: Scikit1D): any; getColumns(X: DataFrameInterface | Tensor2D, selectedColumns: Selection): Tensor2D; } export {};