Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
+1 vote
69 views
in Artificial Intelligence (AI) by (114k points)
Explain the concept of cross-validation in machine learning.

Please log in or register to answer this question.

1 Answer

0 votes
by (114k points)

Cross-validation is a resampling technique used to evaluate the performance of machine learning models on limited data. It involves splitting the available data into multiple subsets or folds. The model is trained on a combination of folds and evaluated on the remaining fold. This process is repeated multiple times, with each fold serving as the validation set. Cross-validation helps in estimating the model's performance and detecting issues such as overfitting.

Example code:

# Example code illustrating cross-validation using k-fold
from sklearn.model_selection import cross_val_score
from sklearn.linear_model import LogisticRegression

logistic_model = LogisticRegression()
scores = cross_val_score(logistic_model, X, y, cv=5)  # cv is the number of folds

print("Cross-Validation Scores:", scores)

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...