Class Notes – Introduction to Machine Learning
1. What Is Machine Learning?
Machine Learning (ML) is a subset of Artificial Intelligence (AI) that focuses
on building systems that can learn from and make decisions or predictions
based on data. Instead of being explicitly programmed to perform a task, ML
systems improve their performance through experience.
At its core, machine learning is about identifying patterns in data and using
those patterns to make informed decisions.
2. How Does Machine Learning Work?
A typical machine learning workflow involves:
1 Data Collection – Gathering relevant datasets.
2 Data Preprocessing – Cleaning and formatting the data for consistency
and accuracy.
3 Model Selection – Choosing a suitable algorithm (e.g., decision tree, neural
network).
4 Training – Feeding data into the model to help it "learn."
5 Evaluation – Testing the model's accuracy on unseen data.
6 Prediction/Deployment – Using the model to make real-world decisions or
predictions.
3. Types of Machine Learning
There are three primary types of machine learning:
A. Supervised Learning
• The model learns from labeled data (i.e., input-output pairs).
• Goal: Predict outcomes for new, unseen inputs.
• Common algorithms: Linear Regression, Decision Trees, Support Vector
Machines, Neural Networks.
• Examples:
◦ Spam email detection
◦ Predicting house prices
◦ Diagnosing diseases from medical data
B. Unsupervised Learning
• The model is given data without labels and must find hidden patterns.
• Goal: Discover structure within data.
• Common algorithms: K-Means Clustering, Hierarchical Clustering, Principal
Component Analysis (PCA).
• Examples:
◦ Customer segmentation
◦ Market basket analysis
◦ Dimensionality reduction
C. Reinforcement Learning
• The model learns by interacting with an environment and receiving feedback
(rewards or penalties).
• Goal: Maximize cumulative reward.
• Common in robotics, gaming, and autonomous systems.
• Example:
◦ A robot learning to walk or navigate
◦ AI playing chess or Go
4. Key Concepts and Terminology
• Features: Individual measurable properties or inputs (e.g., age,
temperature).
• Labels: The target variable or outcome in supervised learning.
• Training Set: Data used to teach the model.
• Test Set: New data used to evaluate model performance.
• Overfitting: When a model performs well on training data but poorly on new
data.
• Underfitting: When a model is too simple to capture the underlying trend.
5. Common Machine Learning Algorithms
Algorithm Type Use Cases
Predicting continuous
Linear Regression Supervised
values
Logistic Regression Supervised Binary classification
Classification and
Decision Trees Supervised
regression
K-Nearest Neighbors Supervised Pattern recognition
Customer
K-Means Clustering Unsupervised
segmentation
Text classification,
Naive Bayes Supervised
spam detection
Support Vector Machine Supervised Complex classification
Ensemble learning for
Random Forest Supervised
better accuracy
Image recognition,
Neural Networks Supervised/Deep
speech processing
6. Applications of Machine Learning
Machine learning is used in a wide range of industries:
• Healthcare: Disease prediction, drug discovery, personalized medicine
• Finance: Credit scoring, fraud detection, algorithmic trading
• Retail: Product recommendations, inventory forecasting
• Transportation: Route optimization, self-driving cars
• Marketing: Customer targeting, sentiment analysis
• Agriculture: Crop yield prediction, soil analysis
• Entertainment: Streaming recommendations, game AI
7. Tools and Programming Languages
Popular programming languages and tools used in ML include:
• Python – Most popular language with libraries like scikit-learn, TensorFlow,
PyTorch, pandas, and NumPy
• R – Great for statistical modeling
• Jupyter Notebooks – Interactive environment for running code and
visualizing results
• Google Colab – Free, cloud-based Jupyter notebooks with GPU access
8. Ethical Concerns in Machine Learning
As machine learning becomes more influential, ethical concerns are gaining
attention:
• Bias and Fairness: Algorithms may inherit biases from the data.
• Privacy: Handling personal and sensitive data responsibly.
• Transparency: The “black box” problem—understanding how models make
decisions.
• Job Displacement: Automation may impact employment in various sectors.
Solutions include ethical guidelines, transparent models, and fairness audits.
9. The Future of Machine Learning
Machine learning continues to evolve, with emerging trends such as:
• Explainable AI (XAI) – Making AI decisions more transparent.
• Federated Learning – Training models across multiple devices without
centralizing data.
• AutoML – Tools that automate model selection and tuning.
• Generative AI – Creating new content (e.g., ChatGPT, image generation).
• Edge AI – Deploying models directly on devices like smartphones and IoT
hardware.
10. Conclusion
Machine learning is transforming the way we interact with technology, make
decisions, and solve problems. With applications across nearly every
industry, a foundational understanding of machine learning is increasingly
valuable—not just for engineers, but for professionals in every field.