import { Scikit1D, Scikit2D, Tensor1D } from '../types'; import { RegressorMixin } from '../mixins'; export interface VotingRegressorParams { /** List of name, estimator pairs. Example * `[['lr', new LinearRegression()], ['dt', new DecisionTree()]]` */ estimators?: Array<[string, any]>; /** The weights for the estimators. If not present, then there is a uniform weighting. */ weights?: number[]; } /** * A voting regressor is an ensemble meta-estimator that fits several base * regressors, each on the whole dataset. Then it averages the individual * predictions to form a final prediction. * * @example * ```js * import { VotingRegressor, DecisionTreeRegressor, LinearRegression } from 'scikitjs' * * const X = [ [2, 2], [2, 3], [5, 4], [1, 0] ] const y = [5, 3, 4, 1.5] const voter = new VotingRegressor({ estimators: [ ['dt', new DecisionTreeRegressor()], ['lr', new LinearRegression({ fitIntercept: false })] ] }) await voter.fit(X, y) * ``` */ export declare class VotingRegressor extends RegressorMixin { estimators: Array<[string, any]>; weights?: number[]; name: string; constructor({ estimators, weights }?: VotingRegressorParams); fit(X: Scikit2D, y: Scikit1D): Promise; predict(X: Scikit2D): Tensor1D; transform(X: Scikit2D): Array; fitTransform(X: Scikit2D, y: Scikit1D): Promise; } /** * * Helper function for make a VotingRegressor. Just pass your Estimators as function arguments. * * @example * ```typescript * import {makeVotingRegressor, DummyRegressor, LinearRegression} from 'scikitjs' * const X = [ [1, 2], [2, 1], [2, 2], [3, 1] ] const y = [3, 3, 4, 4] const voter = makeVotingRegressor( new DummyRegressor(), new LinearRegression({ fitIntercept: true }) ) await voter.fit(X, y) ``` */ export declare function makeVotingRegressor(...args: any[]): VotingRegressor;