Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the What you really need to know section for the big picture.

julearn.run_cross_validation

julearn.run_cross_validation(X, y, model, data, X_types=None, problem_type=None, preprocess=None, return_estimator=None, return_inspector=False, return_train_score=False, cv=None, groups=None, scoring=None, pos_labels=None, model_params=None, search_params=None, seed=None, n_jobs=None, verbose=0)

Run cross validation and score.

Parameters:
  • X (list[str]) – The features to use. See Data for details.

  • y (str) – The targets to predict. See Data for details.

  • model (str | PipelineCreator | BaseEstimator | list[PipelineCreator]) – If string, it will use one of the available models.

  • data (DataFrame) – DataFrame with the data. See Data for details.

  • X_types (dict | None, default: None) – A dictionary containing keys with column type as a str and the columns of this column type as a list of str.

  • problem_type – The kind of problem to model.

Returns:

  • scores (pd.DataFrame) – The resulting scores (one column for each score specified). Additionally, a ‘fit_time’ column will be added. And, if return_estimator='all' or return_estimator='cv', an ‘estimator’ columns with the corresponding estimators fitted for each CV split.

  • final_estimator (object) – The final estimator, fitted on all the data (only if return_estimator='all' or return_estimator='final')

  • inspector (Inspector | None) – The inspector object (only if return_inspector=True)

Examples using julearn.run_cross_validation

Multiclass Classification

Multiclass Classification

Regression Analysis

Regression Analysis

Stratified K-fold CV for regression analysis

Stratified K-fold CV for regression analysis

Grouped CV

Grouped CV

Simple Binary Classification

Simple Binary Classification

Simple Model Comparison

Simple Model Comparison

Inspecting SVM models

Inspecting SVM models

Inspecting Random Forest models

Inspecting Random Forest models

Preprocessing with variance threshold, zscore and PCA

Preprocessing with variance threshold, zscore and PCA

Inspecting the fold-wise predictions

Inspecting the fold-wise predictions

Transforming target variable with z-score

Transforming target variable with z-score

Regression Analysis

Regression Analysis

Target Generation

Target Generation

Tuning Multiple Hyperparameters Grids

Tuning Multiple Hyperparameters Grids

Tuning Hyperparameters

Tuning Hyperparameters

Tuning Hyperparameters using Bayesian Search

Tuning Hyperparameters using Bayesian Search

Stacking Classification

Stacking Classification

Confound Removal (model comparison)

Confound Removal (model comparison)

Return Confounds in Confound Removal

Return Confounds in Confound Removal

Custom Scoring Function for Regression

Custom Scoring Function for Regression

/auto_examples/99_docs/run_cbpm_docs

Connectome-based Predictive Modeling (CBPM)

/auto_examples/99_docs/run_confound_removal_docs

Cross-validation consistent Confound Removal

/auto_examples/99_docs/run_hyperparameters_docs

Hyperparameter Tuning

/auto_examples/99_docs/run_model_comparison_docs

Model Comparison

/auto_examples/99_docs/run_model_evaluation_docs

Model Evaluation

/auto_examples/99_docs/run_model_inspection_docs

Inspecting Models

/auto_examples/99_docs/run_pipeline_docs

Model Building

/auto_examples/99_docs/run_stacked_models_docs

Stacking Models

/auto_examples/99_docs/run_target_transformer_docs

Applying preprocessing to the target