Data Science 101
This Introduction to Data Science guide covers the core concepts of the field, including what Data Science is, the differences between data analyst, data scientist, and data engineer roles, the full data science lifecycle, fundamentals of Machine Learning, and a practical application using linear regression in Python. Designed for beginners, it walks through everything from problem definition to building and evaluating predictive models, with a strong focus on real-world applications and hands-on learning.
Introduction to Data Science
This guide is based on a workshop I taught on Data Science during Amazon Hacking Week in 2024. The goal was to present the main concepts of the field in an accessible, practical way, focused on real-world applications. The content was structured to serve as a starting point for people who were having their first contact with the field.
1. What Is Data Science?
To begin with, I should make it clear that this is not the formula for getting rich (at least not after the pandemic), nor is it the study of board-game data.
According to AWS, Data Science is the study of data to extract meaningful insights for businesses.
We can say that it is the combination of:
- Mathematics and statistics
- Programming
- Data analysis
- Artificial intelligence and machine learning
- Business knowledge
In the data field, it is common to find three main roles: data analyst, data scientist, and data engineer. The data analyst looks at the past and the present, organizing, exploring, and visualizing data to answer questions and generate reports. The data scientist goes further, seeking to predict scenarios and build models that support decision-making, using statistics and machine learning. The data engineer works behind the scenes, being responsible for collecting, processing, and structuring data, ensuring that it is available, reliable, and scalable for use.
The difference between data engineers and data scientists is one of the most commonly confused. While the scientist is focused on extracting value from data by creating models, testing hypotheses, and generating insights, the engineer is focused on making sure the data exists, is organized, and can be accessed efficiently. In other words, the engineer builds the infrastructure and pipelines; the scientist uses that foundation to generate intelligence. Without engineering, the scientist cannot work; without science, the data does not generate value.
In the real world, Data Science is practically everywhere: from detecting fraud in banking transactions, recommending the next movie you will watch, to estimating property prices or optimizing delivery routes. And if you doubt it, the data scientist probably even knows how to knock down a wall. One day they are cleaning messy data, the next they are building a model, then creating a chart for a presentation, and even explaining results to non-technical people. In the end, it is exactly this mix of responsibilities that makes the field so interesting and so challenging at the same time.
2. The Data Science Cycle
Data Science is not a linear process, but rather an iterative cycle. This means that throughout a project, it is common to go back to earlier steps, refine hypotheses, and adjust decisions based on the results obtained.
In general, this cycle can be divided into the following stages:
Problem Definition
Everything starts with a good question. Before any code or analysis, it is essential to understand the problem you want to solve. This involves:
- Formulating clear and objective questions
- Understanding the business context
- Raising initial hypotheses
A common mistake is to start with the data, when in fact the starting point should be the problem.
Data Identification
Once the problem is defined, the next step is to understand which data is needed to answer it.
Data can be classified as:
- Qualitative: describe characteristics (e.g., color, category)
- Quantitative: represent numerical values
And they can also be:
- Nominal (no order)
- Ordinal (with order)
- Discrete (countable values)
- Continuous (measurable values)
Knowing what type of data you are dealing with directly influences the analysis and the models that can be used.
Data Collection
This is where the data is obtained. It can come from different sources:
- Primary data: surveys, interviews, forms
- Secondary data: existing datasets, APIs, web scraping
It is also important to consider where this data is stored:
- Relational databases
- Data warehouses
- Data lakes
- Spreadsheets and various files
The quality of the collection directly affects the rest of the process.
Data Processing
This is one of the most important stages, and often the most time-consuming.
Data rarely comes ready to use. It is necessary to:
- Clean the data (missing values, duplicates, errors)
- Standardize formats
- Handle inconsistencies
- Transform variables
This is where you start “tidying the house” before any more advanced analysis.
Data Exploration
Before modeling anything, it is essential to understand the data.
This includes:
- Visualization (charts, distributions, patterns)
- Descriptive statistics (mean, median, standard deviation)
- Identification of outliers (values outside the expected pattern)
This step helps validate initial hypotheses and uncover insights that were not always anticipated.
Modeling (when applicable)
Once the data is prepared and understood, it is possible to apply statistical or machine learning models.
This includes activities such as:
- Algorithm selection
- Model training
- Validation (train vs. test)
- Parameter tuning
The goal is to generate predictions or automate decisions based on the data.
Interpretation and Communication
A good model is useless if no one understands the result.
This stage involves:
- Translating technical results into business language
- Creating clear visualizations
- Presenting actionable insights
A good data scientist does not just analyze; they communicate.
Iteration
A project rarely ends on the first attempt.
Based on the results:
- New questions emerge
- Additional data may be needed
- Models can be refined
And the cycle starts again.
In the end, Data Science is much less about tools and much more about process. Whoever masters this cycle can adapt to different problems, technologies, and contexts, and that makes all the difference in practice.
3. Machine Learning
Machine Learning is a subfield of Artificial Intelligence focused on building systems that learn from data. Instead of programming explicit rules to solve a problem, we provide data and let the model identify patterns and make decisions based on them.
Simply put: instead of telling the system how to solve the problem, we show examples and let the algorithm learn the path.
What changes compared to traditional programming?
In traditional programming, the flow is:
Rules + Data → Answer
In Machine Learning:
Data + Answers → Model (that learns the rules)
This completely changes how we build solutions, especially for complex problems where the rules are not so clear, such as image recognition, natural language, or behavior prediction.
Where is Machine Learning applied?
ML is present in many everyday applications:
- Recommendation systems (Netflix, Spotify, e-commerce)
- Fraud detection
- Email classification (spam or not spam)
- Image and voice recognition
- Demand and price forecasting
- Medical diagnostics
Whenever there is enough data and a pattern to be learned, there is potential to apply Machine Learning.
Types of Learning
Machine Learning algorithms can be divided into three major categories, depending on how they learn from data.
1. Supervised Learning
This is the most common type.
Here, the model learns from labeled data, meaning we already know the correct answer for each example.
Example:
Given a set of houses with their prices, the model learns to predict the price of a new house.
Main tasks:
- Classification: categorical output
- Regression: numerical output
Data Split: Train vs. Test
A fundamental practice in supervised learning is splitting the data into two sets:
- Train: used to teach the model
- Test: used to evaluate performance
This prevents the model from merely “memorizing” the data (overfitting) and ensures it can generalize to new cases.
2. Unsupervised Learning
In this case, the data has no labels. The model must find patterns on its own.
The goal is not to predict something directly, but to understand the structure of the data.
Main approaches:
- Clustering: grouping similar data
- Dimensionality Reduction: simplifying data while preserving as much information as possible
This type of learning is very useful in exploratory analysis.
3. Reinforcement Learning
In this model, an agent learns by making decisions in an environment.
It receives:
- Rewards (when it makes the right choice)
- Penalties (when it makes a mistake)
Over time, it learns to maximize its rewards.
Examples:
- Games (chess, Go)
- Robotics
- Dynamic recommendation systems
Important Concepts
Overfitting vs. Underfitting
- Overfitting: the model learns the training data too well and fails to generalize
- Underfitting: the model is too simple and cannot capture patterns
The balance between these two extremes is essential.
Features (Variables)
Features are the information used by the model.
The quality of the features often matters more than the algorithm itself. There is even a saying in the field:
“Garbage in, garbage out.”
Feature Engineering
The process of:
- Creating new variables
- Transforming existing data
- Selecting what really matters
This step can be decisive for model performance.
Model Evaluation
Some common metrics:
- Accuracy
- Precision
- Recall
- F1-score
- Mean error (in regression)
Choosing the correct metric depends on the problem.
Common Models
Some widely used algorithms:
- Linear Regression
- Logistic Regression
- Decision Trees
- Random Forest
- K-Nearest Neighbors (KNN)
- Neural Networks
Each model has its pros and cons, and there is no universal “best” one — everything depends on the problem.
When should you use Machine Learning?
Not every problem needs ML.
Use it when:
- There is a pattern that is difficult to model with fixed rules
- There is a reasonable amount of data
- The problem requires prediction or automation
Avoid it when:
- A simple rule is enough
- The data is scarce
- Interpretability is critical and the model is complex
Machine Learning is a powerful tool, but it is not magic. It depends directly on the quality of the data, the understanding of the problem, and the way the model is built and evaluated.
In the end, ML does not replace reasoning; it enhances it.
4. Linear Regression
Linear regression is one of the simplest, and at the same time one of the most important, models in Machine Learning. It is often the first practical contact people have with the field, precisely because it is easy to understand and highly interpretable.
The goal of linear regression is to find a relationship between variables in order to predict a numerical value. In other words, it tries to answer questions such as:
- “What will be the price of a house based on its characteristics?”
- “What will be the demand for a product next month?”
Intuition behind the model
The core idea is simple: find a line (or straight line) that best represents the relationship between the data.
y = β₀ + β₁x
- y → variable we want to predict
- x → input variable
- β₀ → intercept (where the line crosses the y-axis)
- β₁ → slope of the line (how much y varies with x)
The model basically tries to fit this line as well as possible to the observed data.
How does the model learn?
Linear regression finds the best line by minimizing the error between the real values and the predicted values.
This error is known as the residual.
error = y - ŷ
The most common method for this is least squares, which seeks to minimize the sum of squared errors.
Assumptions of Linear Regression
For the model to work well, some assumptions are important:
- Linear relationship between variables
- Independence of errors
- Homoscedasticity (constant variance of errors)
- Low multicollinearity between variables
In practice, these conditions are not always perfect, but they serve as a guide.
Advantages
- Simple to understand and implement
- Highly interpretable
- Fast to train
- A great starting point
Limitations
- Does not capture non-linear relationships
- Sensitive to outliers
- May perform poorly on complex problems
When should you use it?
Linear regression is an excellent choice when:
- There is an approximately linear relationship
- Interpretability is important
- You want a quick baseline
Although simple, linear regression teaches fundamental concepts that appear in practically all more advanced models. Mastering this model is not just about knowing how to use it, but about understanding the foundation of how machines learn from data.
5. Practical Part
Importing Libraries
We import the main libraries for data manipulation and visualization, as well as the Machine Learning tools we will use in the model.