0Pricing
Data Science Academy · Lesson

Score Your First Model

Reading the model's score method.

Score Your First Model is a free Data Science Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Data Science Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Is It Any Good?

Training a model is only half the job. Next you ask the real question: how well does it actually predict? 🧐

The score Method

Every estimator offers a score method that returns a single number summarizing performance. One call, one quick verdict.

model.score(X_test, y_test)

Score Needs Truth

You pass both features and the real answers, so score can compare its predictions against what truly happened.

What Regression Reports

For regressors, score returns R squared: the fraction of the target's variation your model manages to explain.

Reading R Squared

An R squared of 1.0 is a perfect fit and 0.0 is no better than guessing the mean. Higher is better, and it can even go negative.

Test, Don't Reuse Training

Always score on data the model never saw. A great training score with a poor test score is the classic sign of overfitting.

Beyond the Built-In

For finer detail, the metrics module offers many measures. You compare true and predicted values directly with a chosen function.

from sklearn.metrics import mean_absolute_error

Average Error in Units

Mean absolute error tells you the typical miss in the target's own units. It is wonderfully easy to explain to anyone.

mean_absolute_error(y_test, y_pred)

Classifiers Score Differently

For classifiers, the score method returns accuracy: the share of labels predicted correctly. Same method name, different meaning.

One Number Is a Start

A single metric never tells the whole story. Pair it with plots and several measures before you trust a model.

Compare to a Baseline

A score only means something next to a baseline, like always predicting the mean. Beat that simple guess to prove real value.

Quick Check

What does score return for a regression model?

Recap

Use score for a fast R squared, reach for metrics like MAE for detail, and always test on unseen data versus a baseline. 🏁

Frequently asked questions

Is the “Score Your First Model” lesson free?

Yes — the full text of “Score Your First Model” is free to read here on the web, and the Data Science Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Data Science Academy course, upgrade to CoddyKit PRO.

What will I learn in “Score Your First Model”?

Reading the model's score method. You practise Data Science Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Data Science Academy?

No prior experience is required. Data Science Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Score Your First Model” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Data Science Academy lesson?

Yes. Every Data Science Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. The fit and predict Contract
  2. Features X and Target y
  3. Train a Linear Regression
  4. Score Your First Model
← Back to Data Science Academy