import { OutlierBase } from '../base'; import { Params } from '../base/estimator'; import { KernelType } from './smo'; export interface OneClassSVMProps { kernel?: KernelType; degree?: number; /** 'scale' = 1/(n_features * Var(X)) like sklearn; 'auto' = 1/n_features */ gamma?: number | 'scale' | 'auto'; coef0?: number; tol?: number; /** * upper bound on the fraction of training errors (points classified as * outliers), lower bound on the fraction of support vectors */ nu?: number; /** hard limit on SMO pair updates; -1 (default) = run until convergence */ maxIter?: number; } /** * One-class SVM for unsupervised outlier/novelty detection (Schölkopf's * formulation, solved with SMO on the libsvm one-class dual). * * `decisionFunction(X)` returns f(x) = sum_i alpha_i K(sv_i, x) - rho; * `predict(X)` follows the sklearn label convention: **+1 = inlier, * -1 = outlier** (positive decision value = inlier). * * NOTE: this differs from this library's `IsolationForest`, whose `predict` * returns 1 for outliers and 0 for inliers. */ export declare class OneClassSVM extends OutlierBase { private kernel; private degree; private gamma; private coef0; private tol; private nu; private maxIter; private gammaValue; /** support-vector rows (copies of training samples with alpha_i > 0) */ private svX; /** training-set indices of the support vectors */ private supportIndices; /** unsigned dual coefficients alpha_i, aligned with svX */ private dualCoef; /** decision offset: f(x) = sum alpha_i K(sv_i, x) - rho */ private rho; private fitted; constructor(props?: OneClassSVMProps); getParams(): Params; private kernelConfig; fit(samplesX: number[][]): void; private checkFitted; /** signed distance-like score; positive = inlier, negative = outlier */ decisionFunction(samplesX: number[][]): number[]; /** sklearn convention: +1 = inlier, -1 = outlier */ predict(samplesX: number[][]): number[]; /** sorted training-set indices of the support vectors (sklearn's support_) */ getSupportVectors(): number[]; }