/** * @license * Copyright 2021, JsData. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ========================================================================== */ import { Scikit2D, Tensor2D, Tensor1D } from '../types'; import { TransformerMixin } from '../mixins'; export interface SimpleImputerParams { /** The strategy you'd use to impute missing values. "mean" means * fill missing values with the mean. Likewise for "median" and "mostFrequent". * Use "constant" if you'd like to pass in a "fillValue" and use that to fill * missing values. **default = "mean"** */ strategy?: 'mean' | 'median' | 'mostFrequent' | 'constant'; /** If you choose "constant" pick a value that you'd * like to use to fill the missing values. **default = undefined** */ fillValue?: string | number | undefined; /** This value is the actual missing value. **default = NaN** */ missingValues?: number | string | null | undefined; } export declare class SimpleImputer extends TransformerMixin { missingValues: number | string | null | undefined; fillValue: string | number | undefined; strategy: 'mean' | 'median' | 'mostFrequent' | 'constant'; statistics: Tensor1D; /** Useful for pipelines and column transformers to have a default name for transforms */ name: string; tf: any; constructor({ strategy, fillValue, missingValues }?: SimpleImputerParams); fit(X: Scikit2D): SimpleImputer; transform(X: Scikit2D): Tensor2D; }