Tabular prediction
scikit-learn
ChakraTab is also a scikit-learn estimator, so existing scikit-learn code works with it unchanged. Install the extra first:
pip install "yhatlabs[sklearn]"This scores ChakraTab with 3-fold cross-validation on the breast cancer dataset:
from sklearn.datasets import load_breast_cancerfrom sklearn.model_selection import cross_val_scorefrom yhatlabs.integrations import ChakraTabClassifier
X, y = load_breast_cancer(return_X_y=True, as_frame=True)
scores = cross_val_score(ChakraTabClassifier(ttl_hours=1), X, y, cv=3)print("accuracy per fold:", scores.round(3), "mean:", round(scores.mean(), 3))accuracy per fold: [0.974 0.984 0.974] mean: 0.977ChakraTabClassifierandChakraTabRegressorare inyhatlabs.integrations.fit(X, y)fits once on our side;predictandpredict_probasend only the rows to score.ChakraTabRegressor().predict_quantiles(X, (0.05, 0.5, 0.95))returns intervals indexed likeX..importance(X_holdout, y_holdout)returns column importance.- Arguments:
model,preset,eval_metric,time_limit,seed,ttl_hours,api_key,base_url. - They work in
Pipeline,GridSearchCVandcross_val_score, clone cleanly, and pickle with their fit.
Each fold or grid point is its own fit: a 3-fold cross-validation uses three fits from your quota.

