/** * @license * Copyright 2022, 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 { CrossValidator } from './CrossValidator'; import { Scikit1D, Scikit2D, Scalar, Tensor1D, Tensor2D } from '../types'; /** * Evaluates a score by cross-validation. This particular overload * of the function uses the given scorer function to cross validate * a supervised estimator. * * @param estimator A supervised estimator that has an async `fit(X,y)` function. * * @param Xy A two element array containing the features and targets * of the cross validation dataset. * * @param params Cross validation parameters. `cv` is the {@link CrossValidator} * responsible for splitting the dataset into training in test * data in one or more folds. `groups` is additional grouping * information which is used by some {@link CrossValidator} * instance to determine which groups of datapoints may not * appear both in test and training data at the same time. * `scoring` is the scorer function which is being called * with `estimator` as `this` and the test features `X_test` * and targets `y_test` as arguments. * * @returns The test score for each split/fold that was generated by * the {@link CrossValidator} `cv` */ export declare function crossValScore; }>(estimator: T, X: Scikit2D, y: Scikit1D, params: { cv?: CrossValidator; groups?: Scikit1D; scoring: (this: T, X: Tensor2D, y: Tensor1D) => Scalar; }): Promise; /** * Evaluates a score by cross-validation. This particular overload * of the function uses the given scorer to cross validate an * unsupervised estimator. * * @param estimator A supervised estimator that has an async `fit(X)` function. * * @param X An single element array containing the features of the * cross validation dataset. * * @param params Cross validation parameters. `cv` is the {@link CrossValidator} * responsible for splitting the dataset into training in test * data in one or more folds. `groups` is additional grouping * information which is used by some {@link CrossValidator} * instance to determine which groups of datapoints may not * appear both in test and training data at the same time. * `scoring` is the scorer function which is being called * with `estimator` as `this` and the test features `X_test` * as argument. * * @returns The test score for each split/fold that was generated by * the {@link CrossValidator} `cv` */ export declare function crossValScore; }>(estimator: T, X: Scikit2D, params: { cv?: CrossValidator; groups?: Scikit1D; scoring: (this: T, X: Tensor2D) => Scalar; }): Promise; /** * Evaluates a score by cross-validation. This particular overload * of the function uses the default score of a supervised estimator * for scoring. * * @param estimator A supervised estimator that has an async `fit(X,y)` * function and a `score(X,y)` function. * * @param Xy A two element array containing the features and targets * of the cross validation dataset. * * @param params Cross validation parameters. `cv` is the {@link CrossValidator} * responsible for splitting the dataset into training in test * data in one or more folds. `groups` is additional grouping * information which is used by some {@link CrossValidator} * instance to determine which groups of datapoints may not * appear both in test and training data at the same time. * * @returns The test score for each split/fold that was generated by * the {@link CrossValidator} `cv` */ export declare function crossValScore(estimator: { fit(X: Tensor2D, y: Tensor1D): Promise; score(X: Tensor2D, y: Tensor1D): Scalar; }, X: Scikit2D, y: Scikit1D, params: { cv?: CrossValidator; groups?: Scikit1D; }): Promise; /** * Evaluates a score by cross-validation. This particular overload * of the function uses the default score of an unsupervised estimator * for scoring. * * @param estimator A supervised estimator that has an async `fit(X)` * function and a `score(X)` function. * * @param X An single element array containing the features of the * cross validation dataset. * * @param params Cross validation parameters. `cv` is the {@link CrossValidator} * responsible for splitting the dataset into training in test * data in one or more folds. `groups` is additional grouping * information which is used by some {@link CrossValidator} * instance to determine which groups of datapoints may not * appear both in test and training data at the same time. * * @returns The test score for each split/fold that was generated by * the {@link CrossValidator} `cv` */ export declare function crossValScore(estimator: { fit(X: Tensor2D): Promise; score(X: Tensor2D): Scalar; }, X: Scikit2D, params: { cv?: CrossValidator; groups?: Scikit1D; }): Promise;