Machine Learning Basics
- 32Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is the definition of machine learning?
32 questions
- 1
What is the definition of machine learning?
Model answer
Machine learning is an application of artificial intelligence that provides systems the ability to automatically learn and improve from experience without being explicitly programmed.
Explanation
The content defines machine learning as AI that enables systems to learn from data without explicit programming, using algorithms that adjust actions based on patterns.
- 2
What is the difference between traditional programming and machine learning?
Model answer
In traditional programming, data and a program are provided to generate output; in machine learning, data and predicted output are provided so the machine learns patterns and creates a model that can improve with new data.
Explanation
Traditional programming uses explicit rules; machine learning uses data to infer rules and create models that adapt.
- 3
What are the six steps in the machine learning lifecycle?
Model answer
The six steps are: collecting data, data wrangling, analyzing data, training the algorithm, testing the algorithm, and deploying the algorithm.
Explanation
The lifecycle involves data collection, cleaning, analysis, model training, testing, and deployment.
- 4
Why is data wrangling an important step in the machine learning lifecycle?
Model answer
Data wrangling is important because raw data often contains missing values, incorrect values, or inconsistent formats, so cleaning and converting it into a usable format is necessary for model accuracy.
Explanation
Data wrangling ensures the data is clean and properly structured before analysis and model training.
- 5
What is the difference between underfitting and overfitting?
Model answer
Underfitting occurs when a model is too simple and does not approximate the data well, while overfitting occurs when a model learns training data too well, including noise, and fails to generalize to new data.
Explanation
Underfitting means high bias; overfitting means high variance. The goal is to balance both.
- 6
What are the three types of machine learning?
Model answer
The three types are supervised learning, unsupervised learning, and reinforcement learning.
Explanation
These categories are based on the nature of the data and feedback available.
- 7
Give two examples of machine learning applications in daily life.
Model answer
Navigation apps like Google Maps use real-time and historical traffic data to suggest fastest routes, and social media platforms like Facebook use face detection to suggest tagging friends.
Explanation
Google Maps combines user location and speed data; Facebook uses deep face recognition to identify faces.
- 8
How does Netflix use machine learning for personalization?
Model answer
Netflix collects data on user activities (pausing, rewinding, fast-forwarding, ratings, searches, browsing behavior) and uses recommender systems to personalize content and improve customer retention.
Explanation
The algorithm analyzes viewing patterns to suggest relevant shows and movies.
- 9
What is supervised learning?
Model answer
Supervised learning is a type of machine learning where the model learns a mapping function from input variables X to output variables Y using labeled training data.
Explanation
The algorithm is trained with known input-output pairs to predict outputs for new inputs.
- 10
What is the difference between linear regression and logistic regression?
Model answer
Linear regression predicts continuous values (e.g., house prices), while logistic regression predicts discrete binary outcomes (e.g., yes/no) by using a sigmoid function to map the output to a probability between 0 and 1.
Explanation
Linear regression fits a line; logistic regression uses a sigmoid curve for classification.
- 11
What is the equation for a simple linear regression line?
Model answer
The equation is y=a+bx, where y is the dependent variable, a is the y-intercept, b is the slope, and x is the independent variable.
Explanation
The slope represents the change in y per unit change in x; the intercept is the value of y when x=0.
- 12
What is a decision tree and how does it work?
Model answer
A decision tree is a tree-like structure where internal nodes represent tests on attributes, branches represent outcomes of tests, and leaf nodes represent class labels. It splits data based on attribute values to make decisions.
Explanation
Decision trees recursively partition the data to create classification or regression rules.
- 13
What is a random forest and how does it improve upon a decision tree?
Model answer
A random forest is an ensemble of many decision trees. It combines their predictions via majority voting, which usually results in higher accuracy and robustness than a single decision tree.
Explanation
Ensemble methods reduce overfitting and improve generalization by averaging multiple models.
- 14
What is the Naive Bayes classifier and what assumption does it make?
Model answer
Naive Bayes is a classification algorithm based on Bayes' theorem that assumes all features are independent of each other given the class label.
Explanation
Despite the naive assumption, it performs well on many problems, especially text classification.
- 15
State Bayes' theorem in equation form.
Model answer
P(H∣E)=P(E)P(E∣H)⋅P(H) where P(H∣E) is the posterior probability, P(E∣H) is the likelihood, P(H) is the prior, and P(E) is the evidence.
Explanation
Bayes' theorem updates the probability of a hypothesis given observed evidence.
- 16
What is the goal of unsupervised learning?
Model answer
The goal of unsupervised learning is to find hidden patterns or intrinsic groupings in unlabeled data without predefined categories or labels.
Explanation
Unsupervised learning discovers structure in data, such as clusters or associations.
- 17
What is clustering?
Model answer
Clustering is the process of dividing a dataset into groups (clusters) consisting of similar data points based on their features, without using labeled data.
Explanation
Clustering groups objects so that intra-cluster similarity is high and inter-cluster similarity is low.
- 18
What is the k-means clustering algorithm?
Model answer
K-means clustering partitions data into k clusters by iteratively assigning points to the nearest centroid and recalculating centroids until convergence.
Explanation
The algorithm minimizes within-cluster sum of squares.
- 19
What is the elbow method for choosing k in k-means?
Model answer
The elbow method plots the sum of squared errors (SSE) against the number of clusters k and chooses the k where SSE starts to decrease at a slower rate, forming an 'elbow'.
Explanation
This helps find the optimal number of clusters without arbitrary selection.
- 20
What is the difference between k-means (hard clustering) and fuzzy C-means (soft clustering)?
Model answer
In k-means, each data point belongs exclusively to one cluster. In fuzzy C-means, each point can belong to multiple clusters with a degree of membership (0 to 1) that sums to 1.
Explanation
Fuzzy clustering allows partial membership, which is more flexible for overlapping clusters.
- 21
What is hierarchical clustering?
Model answer
Hierarchical clustering builds a tree-like hierarchy of clusters either agglomeratively (bottom-up, merging) or divisively (top-down, splitting) without requiring a predefined number of clusters.
Explanation
It produces a dendrogram that shows the nested structure of clusters.
- 22
What is association rule mining?
Model answer
Association rule mining is a technique that finds relationships between items in large transactional databases, typically expressed as A⇒B meaning if A is bought, then B is likely to be bought.
Explanation
It is used in market basket analysis to identify item co-occurrence patterns.
- 23
Define the three measures used in association rule mining: support, confidence, and lift.
Model answer
Support is the fraction of transactions that contain both A and B. Confidence is the fraction of transactions with A that also contain B. Lift is the ratio of confidence to the base probability of B, indicating the strength of the rule beyond random chance.
Explanation
High lift means the rule is stronger than expected if items were independent.
- 24
What is the Apriori algorithm?
Model answer
The Apriori algorithm generates frequent itemsets by using a bottom-up approach: it first finds all itemsets that meet a minimum support, then uses them to generate larger candidates, pruning those with infrequent subsets.
Explanation
It relies on the property that any subset of a frequent itemset must also be frequent.
- 25
What is reinforcement learning?
Model answer
Reinforcement learning is a type of machine learning where an agent learns to make decisions by interacting with an environment, receiving rewards or penalties for actions, and aims to maximize cumulative reward.
Explanation
The agent learns through trial and error without explicit labeled data.
- 26
Define the terms agent, environment, action, state, reward, and policy in reinforcement learning.
Model answer
Agent: the learning algorithm. Environment: the world the agent interacts with. Action: a move the agent can make. State: the current situation. Reward: immediate feedback from the environment. Policy: the strategy the agent uses to decide actions based on the current state.
Explanation
These are fundamental components of RL systems.
- 27
What is the difference between exploration and exploitation in reinforcement learning?
Model answer
Exploitation uses known information to maximize reward, while exploration tries new actions to discover potentially better long-term rewards.
Explanation
Balancing both is crucial for effective learning.
- 28
What is the epsilon-greedy algorithm?
Model answer
The epsilon-greedy algorithm selects the best-known action with probability 1−ϵ (exploitation) and a random action with probability ϵ (exploration).
Explanation
It is a simple method to balance exploration and exploitation.
- 29
What is a Markov Decision Process (MDP)?
Model answer
An MDP is a mathematical framework for modeling sequential decision-making in reinforcement learning, defined by a set of states S, actions A, transition probabilities T, rewards R, and a discount factor γ.
Explanation
The goal is to find a policy that maximizes the expected cumulative discounted reward.
- 30
What is Q-learning and what is the update formula?
Model answer
Q-learning is a model-free reinforcement learning algorithm that learns the optimal action-value function Q(s,a). The update rule is: Q(s,a)←Q(s,a)+α[r+γmaxa′Q(s′,a′)−Q(s,a)] where α is the learning rate, r is reward, γ is discount factor, and s′ is next state.
Explanation
Q-learning directly approximates the optimal Q-values using temporal difference learning.
- 31
Why are Python libraries like scikit-learn important for machine learning?
Model answer
Scikit-learn provides a wide range of pre-built machine learning algorithms and tools for data preprocessing, model training, evaluation, and deployment, allowing users to apply ML without implementing complex algorithms from scratch.
Explanation
It is a key library for practical ML in Python.
- 32
Name the Python libraries mentioned for machine learning and their main purposes.
Model answer
Matplotlib for visualization, Seaborn for statistical visualizations (e.g., heatmaps), scikit-learn for ML algorithms, pandas for data manipulation, and NumPy for numerical operations on arrays and matrices.
Explanation
These libraries cover data handling, analysis, modeling, and visualization.

Ask anything
We've read this whole study set, so questions about it get the best answers.