1. Home
  2. Explore
  3. Computer Science
  4. Machine Learning Basics

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Machine Learning Basics

  • 66Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Introduction to Data Science and ML
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

How much data is generated every day according to the lecture?

Tap to flipClick to flipspace

2.5 quintillion bytes.

Or swipe the card

66 cards

  1. How much data is generated every day according to the lecture?

    2.5 quintillion bytes.

  2. What did the McKinsey report state about the shortage of analytics talent in the US?

    The US faces a shortage of 140,000–190,000 people with deep analytical expertise and 1.5 million managers and analysts with skills to understand and make decisions based on big data analysis.

  3. What is data science?

    Data science is an interdisciplinary field about scientific methods, processes, and systems to extract knowledge or insights from data in various forms, whether structured or unstructured.

  4. What is machine learning according to the lecture?

    Machine learning is an application of artificial intelligence that provides systems the ability to automatically learn and improve from experience without being explicitly programmed.

  5. What are the key features of machine learning?

    It uses data to detect patterns and adjust program actions accordingly; focuses on developing programs that can teach themselves; and enables computers to find hidden insights without being explicitly programmed.

  6. How does traditional programming differ from machine learning?

    In traditional programming, data + program → output. In machine learning, data + predicted output → model → output, and the model is iteratively improved.

  7. What are the three main types of machine learning?

    Supervised learning, unsupervised learning, and reinforcement learning.

  8. How does Google Maps use machine learning for navigation?

    It combines data from current users (location, average speed, route) with historic traffic data to predict traffic and suggest the fastest route.

  9. What machine learning technology does Facebook use for automatic friend tagging?

    Facebook uses DeepFace, a machine learning project for face detection and image recognition, to match faces in photos with its database and suggest tags.

  10. How does Uber apply machine learning in its app?

    Uber provides a personalized app that automatically detects location, offers frequent destinations, and uses historic trip data to make accurate ETA predictions. It also uses surge pricing via a model called geo search.

  11. What machine learning capabilities do virtual personal assistants use?

    They use speech recognition, speech-to-text conversion, natural language processing (NLP), and text-to-speech conversion to assist users via voice or text.

  12. How does product recommendation on Amazon work using machine learning?

    Google tracks search history and recommends ads for items the user viewed across websites. Amazon itself generates 35% of its revenue from product recommendations.

  13. How is machine learning used in self-driving cars like Tesla?

    Tesla uses unsupervised learning algorithms (driven by Nvidia hardware) that learn from data collected from other vehicles and drivers, using many IoT sensors.

  14. How does Google Translate employ machine learning?

    It uses Google Neural Machine Translation (GNMT), a neural machine learning system that works on thousands of languages and employs NLP techniques like POS tagging, named entity recognition, and chunking.

  15. What is dynamic pricing and how does Uber use it?

    Dynamic pricing sets prices based on demand and supply. Uber uses machine learning in its surge pricing model (geo search) to adjust fares in real-time (e.g., higher fares during peak hours or in crowded areas).

  16. How does Netflix leverage machine learning for customer retention?

    Netflix constantly gathers data on user activities (pause, rewind, fast-forward, watch times, ratings, searches, browsing behavior) and uses a recommender system to suggest content, leading to high retention.

  17. What are the six steps of a typical machine learning lifecycle?

    Data collection, data wrangling, data analysis, train algorithm, test algorithm, deployment (operation and optimization).

  18. What is data wrangling in the ML lifecycle?

    Data wrangling is the process of cleaning and converting raw data into a format suitable for machine learning consumption.

  19. What is the main purpose of the matplotlib library in Python?

    Matplotlib enables the creation of visualizations such as bar charts, scatter plots, line charts, and histograms.

  20. What is seaborn used for in Python?

    Seaborn focuses on statistical visualizations, including heat maps and distributions, and is built on matplotlib.

  21. What is scikit-learn and why is it important for machine learning?

    Scikit-learn is a Python library for simple and efficient data mining and data analysis. It is built on NumPy and Matplotlib and is open source.

  22. What is pandas used for in Python?

    Pandas is a tool for data wrangling, designed for quick and easy data manipulation, aggregation, and visualization.

  23. What is NumPy and what is its primary use in machine learning?

    NumPy (Numerical Python) provides features for operations on n-dimensional arrays and matrices, and is used for mathematical computations.

  24. Why did machine learning experience enormous growth around 2016?

    Growth was driven by the increase in big data and the availability of powerful hardware (e.g., GPUs) to run complex models on large datasets.

  25. What is supervised learning?

    Supervised learning is where you have input variable X and output variable Y, and you use an algorithm to learn the mapping function from input to output.

  26. In supervised learning face detection, what kind of training data is used?

    A mixture of labeled faces and labeled non-faces images is used to train the model.

  27. What is linear regression and what does it predict?

    Linear regression estimates real (continuous) values, such as cost of houses or number of calls, based on continuous variables. Its equation is y=a+Bxy = a + Bxy=a+Bx, where yyy is the dependent variable, aaa is the y-intercept, BBB is the slope, and xxx is the independent variable.

  28. What is logistic regression and what type of output does it produce?

    Logistic regression estimates discrete binary values (0/1, yes/no, true/false) based on independent variables. It uses a sigmoid (S-shaped) curve to map any value to a value between 0 and 1, and a threshold (e.g., 0.4) classifies the output.

  29. What is polynomial regression and when is it used?

    Polynomial regression is used for nonlinear data that cannot be accurately modeled with a linear equation. It fits a polynomial equation (e.g., y=3x3+4x2−5x+2y = 3x^3 + 4x^2 - 5x + 2y=3x3+4x2−5x+2) to the data.

  30. What is a decision tree in machine learning?

    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 (decisions). The path from root to leaf gives classification rules.

  31. What is a random forest and how does it compare to a decision tree?

    A random forest is an ensemble classifier made of many decision trees. It combines results from multiple trees (majority voting) and typically gives better prediction accuracy than a single decision tree.

  32. What is Naive Bayes and what assumption does it make?

    Naive Bayes is a classification technique based on Bayes theorem with an assumption of independence among predictors. It assumes that the presence of a particular feature in a class is unrelated to the presence of any other feature.

  33. State Bayes theorem.

    P(H∣E)=P(E∣H)⋅P(H)P(E)P(H|E) = \frac{P(E|H) \cdot P(H)}{P(E)}P(H∣E)=P(E)P(E∣H)⋅P(H)​ where P(H∣E)P(H|E)P(H∣E) is the posterior probability of hypothesis HHH given evidence EEE.

  34. In the Boston housing linear regression demo, what are the main steps performed?

    1. Import libraries (numpy, pandas, matplotlib). 2. Load the Boston housing dataset. 3. Create independent variable X (features) and dependent variable y (price). 4. Plot a correlation heatmap using seaborn. 5. Split data into training (67%) and testing (33%) sets. 6. Import LinearRegression from sklearn, fit the model on training data. 7. Predict on test data. 8. Plot scatter plot of actual vs predicted values.
  35. In the cancer logistic regression demo, what is the goal and what model is used?

    The goal is to predict whether a breast tumor is benign (B) or malignant (M) using features like radius, texture, perimeter, etc. Logistic regression from sklearn is used, along with train-test split (70/30).

  36. In the hurricane/typhoon random forest demo, what was the accuracy achieved?

    Random forest achieved 95.66% accuracy, compared to 95.57% for a decision tree.

  37. In the run/walk Naive Bayes demo, what accuracy was obtained and what other evaluation was done?

    Gaussian Naive Bayes achieved 95.54% accuracy. A confusion matrix and classification report were generated, showing precision, recall, and F1-score for walking and running classes.

  38. What is unsupervised learning?

    Unsupervised learning is a type of machine learning where the model is trained on unlabeled data and must find patterns or groupings on its own.

  39. Give an example of unsupervised learning from the lecture.

    Clustering fruits (apple, banana, mango) based on color and size without providing labels.

  40. What is clustering in machine learning?

    Clustering is the process of dividing a data set into groups consisting of similar data points, without prior knowledge of the groups.

  41. Why is clustering used in industry?

    To discover intrinsic groups in unlabeled data for applications like marketing (customer segments), insurance (risk groups), seismic studies (oil/gas exploration), and recommendation systems (movies, products).

  42. What are the three types of clustering?

    1. Exclusive (hard) clustering: each item belongs to exactly one cluster. 2. Overlapping (soft) clustering: an item can belong to multiple clusters with a degree of association. 3. Hierarchical clustering: clusters have a parent-child relationship forming a tree.
  43. What is k-means clustering?

    K-means is an exclusive (hard) clustering algorithm that partitions data into a predefined number (KKK) of clusters. Each point belongs to the cluster with the nearest centroid. The algorithm iteratively updates centroids to minimize within-cluster variance.

  44. What are the steps of the k-means algorithm?

    1. Define the number of clusters KKK. 2. Initialize KKK centroids (randomly or strategically). 3. Compute Euclidean distance from each point to each centroid. 4. Assign each point to the closest cluster. 5. Recalculate centroids as the mean of points in each cluster. 6. Repeat steps 3–5 until centroids converge or a stopping criterion is met.
  45. How is the optimal number of clusters KKK determined in k-means?

    Using the elbow method: plot the sum of squared errors (SSE) against KKK and choose the KKK where the SSE decreases abruptly (the "elbow" point).

  46. What are the pros and cons of k-means clustering?

    Pros: Simple, understandable, items automatically assigned to clusters. Cons: Need to predefine KKK, forces all items into clusters even if they don't fit well, sensitive to noisy data and outliers.

  47. What is fuzzy c-means clustering?

    Fuzzy c-means is an overlapping (soft) clustering algorithm where each data point can belong to multiple clusters with a degree of membership (0 to 1). The sum of memberships for a point equals 1.

  48. What are the pros and cons of fuzzy c-means?

    Pros: Allows a data point to be in multiple clusters, useful for genes that have multiple functions. Cons: Need to define CCC (number of clusters), requires determining membership cutoff value, sensitive to initial centroid assignment, non-deterministic.

  49. What is hierarchical clustering?

    Hierarchical clustering builds a hierarchy of clusters (dendrogram) either bottom-up (agglomerative) or top-down (divisive). It does not require pre-specifying the number of clusters.

  50. What are the pros and cons of hierarchical clustering?

    Pros: No assumption on number of clusters, corresponds to meaningful taxonomies. Cons: Once two clusters are merged/split, it cannot be undone; becomes very slow for large datasets.

  51. What is market basket analysis?

    Market basket analysis is a technique used by retailers to uncover associations between items that are frequently purchased together in transactions.

  52. Define support, confidence, and lift in association rule mining.

    Support: fraction of transactions containing both items A and B. Confidence: probability that B is purchased given A is purchased (P(B∣A)=support(A∩B)support(A)P(B|A) = \frac{\text{support}(A \cap B)}{\text{support}(A)}P(B∣A)=support(A)support(A∩B)​). Lift: measures how much more likely B is purchased when A is purchased compared to its general likelihood (support(A∩B)support(A)×support(B)\frac{\text{support}(A \cap B)}{\text{support}(A) \times \text{support}(B)}support(A)×support(B)support(A∩B)​).

  53. What is the Apriori algorithm?

    Apriori is an algorithm that uses frequent itemsets to generate association rules. It is based on the concept that a subset of a frequent itemset must also be a frequent itemset.

  54. In the Apriori example with transactions T1–T5 and items 1–5, what was the final frequent itemset of size 3?

    The final frequent itemsets of size 3 were {1,3,5} and {2,3,5}, each with support 2.

  55. How are association rules generated from frequent itemsets?

    For each frequent itemset I, generate all non-empty subsets S. Output a rule S → (I - S) if the confidence (support(I)/support(S)) is at least a minimum confidence threshold.

  56. In the retail store demo, what library was used for association rule mining?

    The mlxtend library (specifically apriori and association_rules from mlxtend.frequent_patterns) was used.

  57. Define the key components of reinforcement learning: agent, environment, action, state, reward, policy, value, action-value (Q).

    Agent: the learning algorithm. Environment: the world the agent interacts with. Action: possible moves or decisions. State: current condition returned by the environment. Reward: immediate feedback from the environment. Policy: strategy that the agent uses to decide the next action based on state. Value: expected long-term return with discount. Action-value (Q): expected long-term return for taking a specific action in a specific state.

  58. What is the goal of a reinforcement learning agent?

    To maximize cumulative reward over time, by selecting actions that lead to the highest long-term return.

  59. What is the discount factor gamma in reinforcement learning?

    Gamma (γ) is a parameter between 0 and 1 that discounts future rewards. A smaller gamma discounts future rewards more heavily, making the agent focus on immediate rewards.

  60. Explain the exploration vs exploitation trade-off in reinforcement learning.

    Exploration involves trying new actions to discover potentially better rewards; exploitation involves using known actions that yield high rewards. The agent must balance both.

  61. What is the epsilon-greedy algorithm?

    In epsilon-greedy, the agent flips a coin: with probability ε, it explores (chooses a random action); with probability 1-ε, it exploits (chooses the action with highest Q-value). Often, the exploration is split (e.g., ε/2 for best known and ε/2 for worst known).

  62. What is a Markov Decision Process (MDP)?

    An MDP is a mathematical framework for modeling decision making in reinforcement learning. It consists of a set of states (S), actions (A), reward function (R), transition probability (T), and discount factor (γ). The goal is to find an optimal policy that maximizes expected cumulative reward.

  63. What is the Q-learning algorithm?

    Q-learning is a model-free reinforcement learning algorithm that learns the value of an action in a particular state. It updates the Q-values using the Bellman equation: Q(s,a)=R(s,a)+γmax⁡a′Q(s′,a′)Q(s,a) = R(s,a) + \gamma \max_{a'} Q(s',a')Q(s,a)=R(s,a)+γmaxa′​Q(s′,a′).

  64. What are the steps of the Q-learning algorithm?

    1. Set the discount factor γ and initialize the reward matrix R. 2. Initialize the Q-matrix to zero. 3. Select a random initial state. 4. Choose an action from the current state (all possible actions). 5. Perform the action and observe the next state. 6. Get the maximum Q-value for the next state. 7. Update Q(s,a) using the formula. 8. Repeat until the goal state is reached. Then start a new episode with a random state until convergence.
  65. In the Q-learning room navigation example, what are the states and actions?

    States are rooms 0–5 (room 5 is outside, the goal). Actions are moving from one room to an adjacent room via doors. The reward is +100 for reaching room 5, 0 for other transitions, and -1 for invalid actions.

  66. In the Q-learning demo, how was the optimal path found?

    After training for 10,000 iterations, the Q-matrix converged. Normalizing by dividing by the maximum Q-value (500) gave percentages. The optimal path from state 2 was 2→3→1→5.

Card 1 of 66
Card 1 of 66

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent