Skip to content
CampusEduX

Problem 4: Compare Cross-Validation Mean and Standard Deviation for Two Models

Easypython
Learn the Concept: Cross-Validation

Problem Description

Write a Python program that performs 5-Fold Cross-Validation on both a Logistic Regression model and a Decision Tree model, comparing their mean scores and standard deviations.

Input

A labeled dataset.

Output

Mean and standard deviation for both models.

Constraints

  • At least 15 labeled examples.

Example Input

text
(A labeled dataset with 15+ examples)

Example Output

text
Logistic Regression: Mean=0.90, Std=0.05 Decision Tree: Mean=0.85, Std=0.12

Concepts Covered

cross_val_score(), .mean(), .std(), model comparison.

Related Problems

  • Problem 1: Perform Basic 5-Fold Cross-Validation
    Easy · python
    Solve Problem
  • Problem 2: Compare Different Values of k
    Easy · python
    Solve Problem
  • Problem 3: Use Stratified K-Fold on Imbalanced Data
    Easy · python
    Solve Problem

Input (stdin)

Output

Run your code to see output here...