import { PolynomialFeatures, PolynomialFeaturesConfig } from './polynomial-features'; /** * For internal use only */ export declare type PolynomialRegressorConfig = { weights: number[][]; polyFeatures: PolynomialFeaturesConfig; }; /** * Model for performing multivariate polynomial regression. * * Train the model by *fit()*ing it on data available for training. Afterwards * *predict()*ion is possible. * * The model is implemented as a pipe consisting of two steps. First the input * is transformed by the class PolynomialFeatures, this reduces the problem to a * *linear* regression problem. Hence in the second step we simply apply linear * regression. */ export declare class PolynomialRegressor { private _polyFeatures; private _weights; /** * Basic configuration. You can skip configuration by providing no arguments. * * In case no arguments are given you have to use the method fromConfig(...) * to set up a configuration in order to use the method fit(...). * * For the exact meaning of the arguments see the documentation of * PolynomialFeatures. * * @param degree Highest order of the monomials * @param homogeneous Whether to include only highest order monomials * @param interactionOnly Whether to disallow higher powers of single features */ constructor(degree?: number, homogeneous?: boolean, interactionOnly?: boolean); /** Number of input features. */ get nFeaturesIn(): number; /** Number of output features. */ get nFeaturesOut(): number; /** The weight matrix of the underlying linear regression model. */ get weights(): number[][]; /** Instance of PolynomialFeatures responsible for transforming the input. */ get polyFeatures(): PolynomialFeatures; /** * Trains the model. * * @param x List of input vectors. * @param y List of corresponding desired output vectors. */ fit(x: number[][], y: number[][]): void; /** * Make predictions. * * @param x List of inputs. */ predict(x: number[][]): number[][]; /** * Saves configuration to a simple option-bag * * The configuration specifies the internal state of a PolynomialRegressor * completely. Hence the config of a fitted model can be used to save the * model to a file. */ get config(): PolynomialRegressorConfig; /** * Loads configuration from simple option-bag. * * @param config The configuration to load from. */ fromConfig(config: PolynomialRegressorConfig): void; private predictPoly; }