Pipelines & Model Selection
GridSearchCV
Exhaustive search over specified parameter values for an estimator.
RandomizedSearchCV
Randomized search over parameter distributions.
OneVsOneClassifier
One-vs-One (OvO) multiclass strategy.
OneVsRestClassifier
One-vs-Rest (OvR) multiclass strategy.
ColumnTransformer
ColumnTransformer applies transformers to specific column subsets of the data.
FeatureUnion
Concatenate results of multiple transformer objects.
Pipeline
Pipeline of transforms with a final estimator.
Runtime helper to validate estimator-like objects.
Get the current global output type setting.
Get estimator tags from an estimator, using sensible defaults based on the estimator's interface.
Reset the output type to default (Tensor).
Set the global output type for all estimators.
Permutation feature importance.
Evaluate an estimator using cross-validation.
Evaluate an estimator using cross-validation with multiple metrics.
Convenience factory for creating a Pipeline with auto-generated step names.
import { GridSearchCV, Pipeline, cross_validate, permutationImportance,} from "deepbox/ml";import { LogisticRegression } from "deepbox/ml";import { tensor } from "deepbox/ndarray";import { StandardScaler } from "deepbox/preprocess";const X = tensor([[1], [2], [3], [4], [5], [6]]);const y = tensor([0, 0, 0, 1, 1, 1]);const pipeline = new Pipeline([ ["scaler", new StandardScaler()], ["model", new LogisticRegression()],]);console.log(cross_validate(pipeline, X, y, { cv: 3 }));console.log( new GridSearchCV(new LogisticRegression(), { maxIter: [50, 100] }, { cv: 3 }).fit(X, y).bestParams);console.log(permutationImportance(new LogisticRegression().fit(X, y), X, y));