How can learning curves be used to visualize and analyze the performance of machine learning models?

I’m working on a machine learning project, and I want to evaluate my model’s performance as I increase the size of my training dataset. I’ve heard about using learning curves to visualize this, but I’m not quite sure how to create them in Python. Can someone explain what learning curves are and provide an example of how to use them to visualize model performance?

Here’s the iris dataset that I am using for my project:

from sklearn.datasets import load_iris

iris = load_iris()
X, y =,