import { Scikit1D, Scikit2D, Tensor1D, Tensor2D } from '../types'; import { ClassifierMixin } from '../mixins'; export interface VotingClassifierParams { /** 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[]; /** If ‘hard’, uses predicted class labels for majority rule voting. * Else if ‘soft’, predicts the class label based on the argmax of the * sums of the predicted probabilities, which is recommended for an * ensemble of well-calibrated classifiers. */ voting?: 'hard' | 'soft'; } /** * 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 { VotingClassifier, DummyClassifier, LogisticRegression } from 'scikitjs' * * const X = [ [1, 2], [2, 1], [2, 2], [3, 1], [4, 4] ] const y = [0, 0, 1, 1, 1] const voter = new VotingClassifier({ estimators: [ ['dt', new DummyClassifier()], ['dt', new DummyClassifier()], ['lr', new LogisticRegression({ penalty: 'none' })] ] }) await voter.fit(X, y) assert.deepEqual(voter.predict(X).arraySync(), [1, 1, 1, 1, 1]) * ``` */ export declare class VotingClassifier extends ClassifierMixin { estimators: Array<[string, any]>; weights?: number[]; le: any; name: string; tf: any; constructor({ estimators, weights, voting }?: VotingClassifierParams); fit(X: Scikit2D, y: Scikit1D): Promise; predictProba(X: Scikit2D): Tensor1D; predict(X: Scikit2D): Tensor1D; transform(X: Scikit2D): Array | Array; fitTransform(X: Scikit2D, y: Scikit1D): Promise | Array>; } export declare function makeVotingClassifier(...args: any[]): VotingClassifier;