Introduction to Machine Learning
- 121Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What is machine learning?
Machine learning gives a computer data or patterns to learn from instead of explicit instructions for performing a task.
Or swipe the card
121 cards
What is machine learning?
Machine learning gives a computer data or patterns to learn from instead of explicit instructions for performing a task.
What is the general goal of machine learning?
To learn patterns from data so a computer can perform tasks or make predictions on its own.
What are the three major categories of machine learning discussed?
Supervised learning, reinforcement learning, and unsupervised learning.
What is the difference between traditional AI search and machine learning?
Traditional AI is given instructions for searching or satisfying constraints, while machine learning infers patterns from data.
What is supervised learning?
A type of learning in which the computer receives data consisting of input-output pairs and learns a function mapping inputs to outputs.
What is the role of labeled data in supervised learning?
Labels identify the correct output associated with each input, allowing the computer to learn the input-output relationship.
What is the difference between a function f and a hypothesis function h in supervised learning?
The function f is the unknown relationship in the real world, while h is a learned approximation of f.
Why can multiple machine-learning algorithms be useful for the same problem?
Different algorithms have different trade-offs and may perform better or worse depending on the data and the function being modeled.
What is classification?
A supervised-learning task that maps inputs to discrete categories or classes.
What is a class in classification?
A discrete category assigned to an input, such as rainy, not rainy, authentic, or counterfeit.
What are the inputs and output in the weather classification example?
Humidity and air pressure are inputs; the output is a label indicating rain or no rain.
Why is historical weather data suitable for supervised learning?
It contains input measurements such as humidity and pressure together with human-provided labels indicating whether it rained.
How can two-variable classification data be represented graphically?
Each data point can be plotted on a two-dimensional graph, with one input on each axis and different classes shown using different colors or symbols.
How does a classifier predict the class of a new unlabeled point?
It applies a learned model to the point's input values and assigns the class predicted by that model.
What is nearest-neighbor classification?
An algorithm that assigns a new input the class of the closest labeled data point.
Why might nearest-neighbor classification make a reasonable prediction?
A new point is often likely to resemble nearby training points, so the class of the closest point can provide a useful estimate.
What is the main limitation of using only one nearest neighbor?
The closest point may be an outlier or may disagree with the broader pattern of nearby points.
What is k-nearest-neighbor classification?
An algorithm that assigns an input the most common class among its k closest labeled data points.
How does k-nearest-neighbor classification determine the predicted class?
It counts the classes among the k nearest points and chooses the class with the most votes.
What does the parameter k control in k-nearest-neighbor classification?
It controls how many neighboring data points are considered when making a prediction.
What is a drawback of a naive nearest-neighbor implementation?
It may be slow because it measures the distance from a new point to every stored data point.
What is a decision boundary?
A boundary that separates different predicted classes in the input space.
What does linearly separable mean?
A data set is linearly separable if a line, or higher-dimensional linear boundary, can perfectly separate its classes.
How does a linear approach classify data?
It computes a weighted linear combination of the inputs and classifies the point according to which side of a boundary the result falls on.
What do weights represent in a linear hypothesis?
Weights indicate how strongly each input contributes to the prediction.
What is the general linear expression used for the two-input example?
The expression is w0+w1x1+w2x2, where x1 and x2 are inputs and the wi are weights.
How does the threshold hypothesis classify an input numerically?
It outputs 1 if w0+w1x1+w2x2≥0 and outputs 0 otherwise.
What is the purpose of the weight w0?
It provides a constant term that can shift the value of the linear expression and therefore shift the decision boundary.
How are the weight and input vectors defined in the two-input example?
The weight vector is w=(w0,w1,w2) and the input vector is x=(1,x1,x2).
What is the dot product of the weight and input vectors?
It is w⋅x=w0+w1x1+w2x2.
Why must vectors have the same length to calculate a dot product?
Each component in one vector must have a corresponding component in the other vector to be multiplied.
What does it mean that a hypothesis is parameterized by its weights?
The particular weights determine which hypothesis function and decision boundary the model represents.
What is the perceptron learning rule used for?
It updates the model's weights using labeled examples so that the hypothesis becomes better at predicting their classes.
What happens to the perceptron weights when a data point is classified correctly?
The weights remain unchanged for that data point.
Why are perceptron weights changed after an incorrect prediction?
They are adjusted so that similar inputs are more likely to receive the correct output in the future.
What is the conceptual form of a perceptron weight update?
Each weight is updated by adding a correction based on the difference between the actual output and the predicted output.
What happens when the actual output is greater than the predicted output in the perceptron update?
The correction is positive, so the relevant weight is increased.
What happens when the actual output is less than the predicted output?
The correction is negative, so the relevant weight is decreased.
What is the learning rate α in the perceptron update?
It is a parameter controlling how much the weights change in response to new training information.
What is the result of repeatedly applying the perceptron learning rule?
The algorithm may converge to a set of weights that predicts the training categories reasonably well.
What is a hard threshold function?
A function that produces only discrete outputs, switching from 0 to 1 when its input crosses a threshold.
What is a limitation of a hard threshold?
It cannot express degrees of confidence; it only returns one of the allowed class values.
What is logistic regression used for in this context?
It replaces a hard threshold with a soft logistic function that produces values between 0 and 1.
What is a soft threshold?
A smooth function whose output changes gradually rather than switching abruptly between two values.
How can a logistic-regression output of 0.7 be interpreted?
It may indicate that the model estimates a relatively high likelihood of the positive class, while retaining some uncertainty.
What is an advantage of logistic regression over a hard threshold?
It provides graded outputs between 0 and 1, allowing the model to represent prediction confidence or likelihood.
What is the purpose of a support vector machine?
To find a decision boundary that separates classes while maximizing the margin between the boundary and the closest data points.
Why might a perfectly separating line still be a poor model?
If it lies very close to training points, small changes in unseen data may cause incorrect classifications.
What is the maximum-margin separator?
A decision boundary chosen to maximize the distance between the boundary and the closest points from the classes.
What are support vectors?
The data points closest to the decision boundary in a support vector machine.
What is a hyperplane?
A decision boundary that generalizes a line to higher-dimensional spaces.
How can support vector machines handle nonlinearly separable data?
They can operate in higher-dimensional spaces where a different boundary, such as a curve or circle in the original space, may separate the classes.
What is regression in supervised learning?
A supervised-learning task that learns a function mapping inputs to continuous numerical outputs.
How does regression differ from classification?
Classification predicts discrete classes, whereas regression predicts continuous real-number values.
What is an example of a regression problem?
Predicting sales from the amount of money spent on advertising.
How can a line be used in a regression problem?
A line can approximate the relationship between an input, such as advertising spending, and a continuous output, such as sales.
What is a loss function?
A function that numerically estimates how poorly a model's predictions perform.
How is evaluating a hypothesis related to optimization?
The model can be evaluated by minimizing a cost or loss function, analogous to finding a minimum in an optimization problem.
What is the 0-1 loss function?
A loss function that assigns 0 to a correct prediction and 1 to an incorrect prediction.
What is empirical loss?
The total loss obtained by summing the individual losses over the available data points.
What is L1 loss?
A loss based on the absolute difference between actual and predicted values, commonly summed over the data points.
What is L2 loss?
A loss based on the squared difference between actual and predicted values, commonly summed over the data points.
How does L2 loss treat large errors compared with L1 loss?
L2 loss penalizes large errors more heavily because it squares the difference.
When might L1 loss be preferred over L2 loss?
L1 loss may be preferred when the data contains outliers that should not dominate the model.
What is overfitting?
Overfitting occurs when a model fits the training data too closely and consequently fails to generalize well to unseen data.
Why is a model with zero training loss not necessarily good?
It may have memorized the training data instead of learning a pattern that generalizes to new inputs.
What is generalization in machine learning?
The ability of a trained model to make accurate predictions on data it has not previously seen.
What is regularization?
Regularization penalizes complex hypotheses in order to favor simpler models that are more likely to generalize.
How can a regularized cost function be conceptualized?
It combines empirical loss with a complexity penalty, often weighted by a parameter such as λ.
What does a larger value of λ do in regularization?
It penalizes model complexity more strongly.
What is holdout cross-validation?
A validation method that splits data into a training set and a separate testing set.
What is the purpose of a testing set?
To measure how well a trained model generalizes to previously unseen data.
What is k-fold cross-validation?
A method that divides data into k subsets and performs k experiments, using one subset for testing and the others for training each time.
How is the final result often obtained in k-fold cross-validation?
The results from the k experiments are often averaged to estimate overall model performance.
Why should training and testing data be different?
Testing on different data reveals whether the model learned a general pattern rather than memorizing its training examples.
What is reinforcement learning?
A learning approach in which an agent learns from experience by receiving rewards or punishments for its actions.
How does reinforcement learning differ from supervised learning?
Supervised learning begins with labeled input-output pairs, whereas reinforcement learning learns through actions and reward or punishment signals.
What are the main components of a reinforcement-learning interaction?
An agent observes a state, chooses an action, receives a new state, and receives a numerical reward or punishment.
What is an agent in reinforcement learning?
The decision-making entity that acts in an environment, such as a robot or a software program.
What is the role of rewards and punishments in reinforcement learning?
They provide numerical feedback indicating whether an action was beneficial or harmful.
What is a Markov decision process?
A model for decision-making that represents states, available actions, transition probabilities, and rewards.
How does a Markov decision process extend a Markov chain?
A Markov chain transitions between states probabilistically, while a Markov decision process also lets an agent choose actions that affect those transitions and rewards.
What does a transition model represent in a Markov decision process?
It represents the probability of reaching a next state given the current state and chosen action.
What does the reward function represent in a Markov decision process?
It specifies the reward received for taking an action in a state and transitioning to a resulting state.
What is Q-learning?
A reinforcement-learning method that learns a function Q(s,a) estimating the value of taking action a in state s.
How is the Q table initialized in the described approach?
Initially, Q(s,a)=0 for every state s and action a.
What information is used to update Q(s,a)?
The immediate reward and the estimated future reward available after the transition.
Why should future rewards be considered in Q-learning?
An action with no immediate reward may lead to a later sequence of actions that produces substantial rewards.
What does the learning rate α control in Q-learning?
It controls how strongly a new value estimate changes the existing estimate.
What does α=1 mean in the Q-learning update?
The new estimate completely replaces the old estimate.
What does α=0 mean in the Q-learning update?
The new information is ignored and the existing Q value remains unchanged.
How is a greedy policy defined using Q values?
In each state, the agent chooses the action with the highest estimated Q(s,a) value.
What is the exploration-exploitation trade-off?
Exploitation uses actions already believed to be good, while exploration tries less-known actions that might be better.
What is the epsilon-greedy algorithm?
A policy that chooses a random action with probability ϵ and the estimated best action with probability 1−ϵ.
Why might epsilon be decreased over time?
After the agent has explored more possibilities, it can exploit its learned knowledge more often.
How can reinforcement learning be applied to game playing?
An agent can play many games and receive rewards for winning and punishments for losing, learning which actions lead to success.
What are the rules of Nim described in the content?
Players remove one or more objects from exactly one pile per turn; the player who removes the last object loses.
Why is Nim relatively suitable for basic reinforcement learning?
Its states can be represented compactly by the numbers of objects in a small number of piles.
What is function approximation in reinforcement learning?
It estimates action values using a function based on features instead of storing an exact value for every state-action pair.
Why is function approximation useful in games with large state spaces?
It allows the agent to generalize from learned features and patterns without visiting every possible state.
What is unsupervised learning?
Learning from data without labeled outputs or additional feedback.
How does unsupervised learning differ from supervised learning?
Unsupervised learning has no provided labels, whereas supervised learning uses labeled input-output pairs.
What is clustering?
The task of organizing objects into groups whose members are similar to one another.
What are examples of applications for clustering?
Clustering can group similar genes, pixels belonging to image regions, or consumers for market research.
What is k-means clustering?
An unsupervised algorithm that divides data points into k clusters by repeatedly assigning points to the nearest center and moving the centers.
What must be chosen before running k-means clustering?
The desired number of clusters, k.
How does k-means initialize clusters?
It begins by selecting initial cluster centers, often at random.
How are points initially assigned in k-means?
Each point is assigned to the cluster whose center is closest to it.
How are cluster centers updated in k-means?
Each center is moved to the mean, or average position, of the points currently assigned to its cluster.
What are the two repeating steps of k-means clustering?
Assign points to their nearest centers, then recenter each cluster at the mean of its assigned points.
When does k-means clustering stop?
It stops when reassignment no longer changes which clusters contain the points, indicating an equilibrium.
Why is k-means an unsupervised method?
It forms clusters using distances and data structure without requiring labels that identify the correct groups.
What is scikit-learn?
A Python library containing implementations of many machine-learning algorithms.
What are the basic steps for using a labeled banknote data set?
Read the data, separate input measurements from labels, split it into training and testing sets, fit a model, make predictions, and compare them with the true labels.
What do the labels 0 and 1 represent in the banknote example?
0 represents an authentic banknote and 1 represents a counterfeit banknote.
What are the evidence and labels in the banknote data?
The first four values of each row are measurements used as evidence; the final value is the authentic-or-counterfeit label.
What does
model.fitdo in scikit-learn?It trains the selected model using the input training data and their corresponding labels.
What does a model's prediction process do?
It uses the trained model and the input vectors from the testing set to generate predicted labels.
How is classification accuracy calculated?
Count the predictions that match the true labels and compare that count with the total number of test examples.
What does
train_test_splitprovide?It automatically divides data into training and testing groups according to a chosen proportion.
Why can repeatedly running a randomized experiment be useful?
Random shuffling creates different training and testing splits, helping assess whether performance is stable rather than dependent on one split.

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