In our previous lesson, we dove into the mechanics of how a machine learning model learns, using the analogy of throwing darts to understand the iterative cycle of prediction, error calculation, and adjustment via Gradient Descent. You now have a solid grasp of the core "training" engine.
This lesson zooms out from the training loop to view the entire landscape of a machine learning project. We will map out the complete journey from a rough idea to a working model, focusing specifically on the crucial, and often most time-consuming, initial stages. By the end of this lesson, you will be able to outline the first three phases of an ML project—problem definition, data collection, and data preparation—using our running example of predicting student exam scores. This will form the foundation for the "data planning" part of your presentation.
The Machine Learning Project Lifecycle
Every ML project, whether it's recommending movies or diagnosing diseases, follows a general sequence of steps. Think of it as a recipe or a blueprint that guides a data scientist from a question to an answer.

As the chart shows, the process is not always linear; steps like training and evaluation often form a loop of their own. For this lesson, we will focus on the first three fundamental stages: defining the goal, gathering data, and data preprocessing.
Stage 1: Defining the Goal
Before writing a single line of code, the most critical step is to clearly define what you want to achieve. This is about translating a real-world problem into a precise, machine-readable task. A poorly defined goal is like setting out on a road trip with no destination in mind.
To understand this better, let's revisit our student score example.
Predicting Student Exam Scores with Machine Learning (Full Data Science Project Walkthrough)
This video provides a full project walkthrough for our student score prediction example. The introduction clearly sets the stage for the project's goal.
Watch the first part of the video from the introduction. Notice how the presenter explicitly states the objective: to predict student exam scores using available features.
The goal here is not just "to understand student performance," but to predict a specific, measurable outcome (the exam score) using a given set of inputs (student information).
Framing the problem correctly also helps us identify the type of ML problem we're facing, which we discussed in a previous lesson.
- Is it Supervised Learning? Yes, because we will have data that includes both the student information (features) and the final exam score (the "correct answer" or label).
- Is it a Regression or Classification task? Since the exam score is a continuous numerical value (e.g., 69.5, 88, 92), this is a regression problem. If we were instead predicting whether a student would "Pass" or "Fail," it would be a classification problem.
A clearly defined goal acts as a compass for the entire project, guiding every subsequent decision, starting with what data to collect.
Stage 2: Gathering Data
Once the goal is set, we need the raw material for learning: data. The model is like a student who needs the right textbooks to learn a subject. The quality, relevance, and quantity of this data will fundamentally limit how well your model can perform. This is famously summarized by the principle: "Garbage In, Garbage Out."
This next video uses the cautionary tale of a failed Amazon AI recruiting tool to powerfully illustrate why having the right data is non-negotiable.
How is data prepared for machine learning?
This video from AltexSoft explains the critical importance of data quality in machine learning projects.
Watch the first two segments of the video: The introduction about the Amazon project explains how a biased dataset led to a sexist AI model. The next section, "planning and data collection," discusses the importance of data quantity, quality, and adequacy for the problem at hand.
For our student score predictor, we would need to gather data that might plausibly influence academic performance. This could include:
- Academic history: previous grades, number of past failures.
- Study habits: daily study hours, attendance percentage.
- Demographics & family: parental education level.
- Lifestyle: hours on social media, extracurricular activities.
Finding such datasets is a task in itself. Often, they are sourced from company databases, public repositories like the UCI Machine Learning Repository or platforms like Kaggle, or are collected from scratch.
Stage 3: Data Preparation
Raw data is almost never ready to be fed directly into a model. It's often messy, incomplete, and inconsistent—like a textbook with torn pages, coffee stains, and scribbles in the margins. Data preparation (or preprocessing) is the process of cleaning and structuring this data. It is often the most time-consuming phase, taking up to 80% of a project's time.

This process typically begins with Exploratory Data Analysis (EDA), where you "get to know" your data by calculating summary statistics and creating visualizations to spot patterns, anomalies, and relationships. Let's see this in action with a hands-on walkthrough.
Predicting Student Exam Scores with Machine Learning (Full Data Science Project Walkthrough)
The "Predicting Student Exam Scores" video provides a fantastic, practical demonstration of data preparation, from loading the data to exploring it.
Please watch the following segments, paying close attention to the steps a data scientist takes to understand and clean the data: Loading and Initial Inspection: See how the dataset is loaded and basic functions like .head() and .info() are used to get a first look. Handling Missing and Duplicate Data: This section shows how to find and deal with empty values (NA) and redundant rows. Exploratory Data Analysis (EDA): Observe how summary statistics (.describe()) and visualizations (histograms, count plots) are used to understand the distribution of different features. Correlation Analysis: This is a key step. Pay attention to how a heatmap is used to visualize the correlation matrix, which shows the relationships between variables and helps identify which ones might be most predictive of the exam score.
The video gives a great practical overview. Now, let's dive deeper into one of the most important parts of data preparation for your technically-minded audience: Feature Selection.
A Deeper Look: Feature Selection
Not all data you collect is equally useful. Feature selection is the process of choosing the most relevant variables (features) to build your model. Including irrelevant or redundant features can confuse the model, increase training time, and even hurt performance.
One of the most common ways to perform feature selection in regression tasks is by examining the correlation coefficient. This value, ranging from -1 to +1, measures the strength and direction of a linear relationship between two variables.
- A value near +1 indicates a strong positive correlation (as one variable increases, the other tends to increase).
- A value near -1 indicates a strong negative correlation (as one variable increases, the other tends to decrease).
- A value near 0 indicates a weak or no linear correlation.
The following article demonstrates exactly how to apply this technique to our student grade prediction problem.
Bayesian Linear Regression in Python: Using Machine Learning to Predict Student Grades Part 1
This article provides a clear, code-backed example of Exploratory Data Analysis and Feature Selection on a student performance dataset very similar to our own.
Please read the following sections to see how data exploration informs which features are chosen for the model: Start at the heading "Exploratory Data Analysis" and read down to the start of "Feature Selection." Pay attention to how visualizations like histograms are used to understand the data's characteristics. Read the entire section on "Feature Selection." This is the core part. Focus on how the author calculates the correlation between numerical variables and the final grade. Also, note the technique of one-hot encoding to do the same for non-numerical data. Finally, read the brief section about splitting the data. This is a critical step that ensures we have a separate set of data to test our model's performance on later.
By using correlation analysis, we can make an informed decision to select features like studytime and failures, which have a strong relationship with the final grade, while potentially discarding less relevant ones. This is a perfect example of the "real tech stuff" that underpins a data-driven workflow.
Conclusion
In this lesson, we mapped out the foundational stages of a machine learning project. We saw that long before a model is trained, a significant amount of work goes into defining the problem and preparing the data.
Key Takeaways:
- The ML workflow begins with three crucial data-centric stages: defining a clear and measurable goal, gathering relevant and high-quality data, and meticulously preparing that data for the model.
- Problem Definition involves translating a business need into a specific ML task (e.g., supervised regression) and identifying the target to be predicted.
- Data Collection is guided by the "Garbage In, Garbage Out" principle. The quality and adequacy of your data are paramount, as biased or irrelevant data can lead to failed projects.
- Data Preparation is the intensive process of cleaning, exploring, and structuring raw data. It includes EDA, handling missing values, and performing feature selection to choose the most predictive variables, often using statistical methods like correlation analysis.
We have now covered the entire "data planning" half of the project lifecycle. In the next lesson, we will move on to the second half: the core modeling and deployment stages. We'll take our prepared student data and use it to train a model, evaluate its performance, and finally, deploy it for use.