Intro to Machine Learning

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

In traditional programming, what does the equation determine?

  • The inputs to be used
  • The programming language to be used
  • The outputs based on the inputs (correct)
  • The data type of the variables

Machine learning always requires explicit programming for every possible scenario.

False (B)

What is the primary goal of machine learning, in terms of inputs, outputs, and the relationship between them?

To determine the equation that maps inputs to outputs.

In machine learning, if the output takes continuous values, like predicting prices, it falls under the category of ______.

<p>Regression</p> Signup and view all the answers

Match the following machine learning types with their descriptions:

<p>Supervised Learning = Learning with labeled data to predict outcomes. Unsupervised Learning = Discovering patterns in data without labeled outcomes. Regression = Predicting continuous numerical values. Classification = Assigning data points to predefined categories.</p> Signup and view all the answers

What does the equation $y = x + 5$ represent in traditional programming?

<p>An equation (D)</p> Signup and view all the answers

In machine learning, the output is fixed and cannot be adjusted based on the input data.

<p>False (B)</p> Signup and view all the answers

What type of problem is breast cancer detection (malignant or benign) considered in machine learning?

<p>Classification</p> Signup and view all the answers

The learning rate ($\alpha$) determines the ______ of steps taken to reach a minimum in gradient descent.

<p>Size</p> Signup and view all the answers

Match the following linear regression terms with their representations:

<p>Hypothesis Function = $h_\theta(x) = \theta_0 + \theta_1x$ Cost Function = $J(\theta_0, \theta_1)$ Parameters = $\theta_0, \theta_1$ Goal = Minimize $J(\theta_0, \theta_1)$</p> Signup and view all the answers

What is the purpose of the Cost Function, $J(\theta_0, \theta_1)$, in linear regression?

<p>To minimize the error between predicted and actual values. (D)</p> Signup and view all the answers

In linear regression, having a smaller training set always results in a more accurate model.

<p>False (B)</p> Signup and view all the answers

Explain the concept of 'Mean Normalization' in feature scaling.

<p>It involves scaling features by subtracting the mean and dividing by the range.</p> Signup and view all the answers

In logistic regression, the ______ function is used to map predicted values between 0 and 1.

<p>Sigmoid</p> Signup and view all the answers

Match the components with respect to Logistic Regression:

<p>Z = $\theta_0 + \theta_1X$ H = $\frac{1}{1 + e^{-z}}$ Threshold = Used to classify outcomes based on H Cost Function = Used to computes the error</p> Signup and view all the answers

In Logistic Regression, what is the purpose of the 'Threshold'?

<p>To classify outcomes based on the value of H. (A)</p> Signup and view all the answers

Feature Engineering involves selecting random features from a dataset to improve model performance.

<p>False (B)</p> Signup and view all the answers

How does KNN (K-Nearest Neighbors) classify a new data point?

<p>By looking at the majority class among its nearest neighbors.</p> Signup and view all the answers

In Naive Bayes, it calculates the ______ of a sample belonging to a certain class based on its Data Points.

<p>probability</p> Signup and view all the answers

Match each Algorithm to scenario that matches it:

<p>Linear Regression = Predicting Housing Prices Logistic Regression = Classifying Medical patients KNN = Classifying nearest objects Naive Bayes = Classifying emails</p> Signup and view all the answers

Which scenerio best fits using the mean normalization?

<p>Used when one value is to far from another (D)</p> Signup and view all the answers

One example of K mean Neighbors is weather forcasting.

<p>False (B)</p> Signup and view all the answers

If an Data Point that is entered into one is KNN 2/3 points Bad, what would the third say?

<p>Bad</p> Signup and view all the answers

Supervised Learning “right answers" or ______ given

<p>Labeled data</p> Signup and view all the answers

Match Machine learning and type of programming

<p>Traditional = Requires all parameters Machine Learning = Parameters are derrived based on the Data they are trained on</p> Signup and view all the answers

If a linear line is not on all points in the Data Set, is it still possible to predict the value?

<p>Yes it is a possible to predict (A)</p> Signup and view all the answers

With 2 features in the data set, you can determine the point when the decision boundary is

<p>True (A)</p> Signup and view all the answers

Why is Sigmoid Fucntion so important?

<p>Because if converts the data into a value a bitween 0 and 1</p> Signup and view all the answers

With the linear line being drawn, is called the [Blank] Hypothsis

<p>Funmction</p> Signup and view all the answers

Match term to symbol relating to Decision Boundary's

<p>Z = \theta_0+ \theta_1X + \theta_2 \vdots Treshold = \frac{In h}{1-In h}</p> Signup and view all the answers

Where are parameters (\theta_0) and (\theta_1) found?

<p>Hypothesis Function (C)</p> Signup and view all the answers

If there are not the same point on each feature, that can be bad

<p>True (A)</p> Signup and view all the answers

What is KNN?

<p>Algorithm</p> Signup and view all the answers

Regression and ______ can be used for a wide range

<p>Classifaction</p> Signup and view all the answers

Can each of the following classify

<p>KNN = No Naive Bayes = Yes</p> Signup and view all the answers

How can KNN detemine what it needs to be?

<p>Classify values that's is closest to (C)</p> Signup and view all the answers

In Regression each value is continuous

<p>True (A)</p> Signup and view all the answers

If there is nothing near it , would KNN work?

<p>No</p> Signup and view all the answers

The more [Blank] KNN has in that section, the more likely what you're looking for is that section

<p>Values</p> Signup and view all the answers

How do you test machine learning

<p>Train an Algorithm = Yes Data = Yes Classify new groups into the algorithm = Yes</p> Signup and view all the answers

Why is the data value needed in machine learning

<p>To learn the relationships and make predictions (D)</p> Signup and view all the answers

Flashcards

Traditional vs. Machine Learning?

Traditional: inputs + equation = outputs; Machine learning: inputs + outputs = equation.

Machine Learning?

A field of study that gives computers the ability to learn without explicit programming.

Regression?

Where the output takes continuous value.

Classification?

Where the output takes discrete values (0 or 1).

Signup and view all the flashcards

Unsupervised Learning?

A type of ML where the algorithm learns patterns without labeled outputs.

Signup and view all the flashcards

Clustering?

Grouping similar data points together without predefined categories.

Signup and view all the flashcards

Linear Regression?

An algorithm applied with data containing both inputs and outputs to predict values.

Signup and view all the flashcards

Training Set

A collection of data used to train a machine learning model.

Signup and view all the flashcards

Error?

The difference between predicted and actual values.

Signup and view all the flashcards

Cost Function?

A function that quantifies the error of a machine learning model.

Signup and view all the flashcards

Gradient Descent?

An optimization algorithm used to minimize the cost function.

Signup and view all the flashcards

Learning Rate?

The rate at which a model learns during training.

Signup and view all the flashcards

Overshooting?

Where the next value exceeds optimal value.

Signup and view all the flashcards

Logistic Regression?

Used when the output variable is categorical (0 or 1).

Signup and view all the flashcards

Feature Scaling?

A process to bring the values of all features into a comparable range.

Signup and view all the flashcards

Min-Max Scaling?

A feature scaling technique that scales values between 0 and 1.

Signup and view all the flashcards

Feature Engineering?

The process of creating new features from existing features.

Signup and view all the flashcards

Threshold?

A value set to make the value be 0 or 1.

Signup and view all the flashcards

Sigmoid Function?

Function that estimates binary classification.

Signup and view all the flashcards

Decision Boundary?

Separates classes in algorithms.

Signup and view all the flashcards

KNN?

A simple algorithm that classifies data points based on their nearest neighbors.

Signup and view all the flashcards

Distance?

Euclidean distance; it measures point distances.

Signup and view all the flashcards

Category?

The frequency of a category amongst the nearest neighbors.

Signup and view all the flashcards

Naive Bayes?

Algorithm that estimates probability across data.

Signup and view all the flashcards

Feature

A characteristic used for analysis.

Signup and view all the flashcards

Instance?

A row of combined features. A sample.

Signup and view all the flashcards

Class?

What class a item belongs to. Like good or bad.

Signup and view all the flashcards

Probability

The calculation on a value of a condition.

Signup and view all the flashcards

Study Notes

  • Machine Learning teaches computers to learn without explicit programming.

Traditional Programming

  • Traditional programming inputs data and an equation to get an output, using a predefined equation.
  • For example, with the equation y = x + 5, inputting x = 5 would produce an output of y = 10.

Machine Learning

  • Instead provides input and output, and learns the equation.
  • For example, if the input is 1 and the output is 2, the machine learns that y = 2x.
  • Abbreviated as ML.
  • It provides computers the ability to learn without being explicitly programmed.
  • This definition was given by Arthur Samuel.

Types of Machine Learning

  • Supervised Learning uses labeled input and output data to learn a function.
  • Supervised learning has applications in regression and classification.
  • Regression handles continuous output, such as predicting prices.
  • It predicts continuous valued output and can have many possible outputs
  • Classifications deals with discrete valued output (0 or 1).
  • An example is predicitng Breast cancer, where tumor size can be used to predict whether the tumor is malignant or benign
  • Values for y are particular.

Unsupervised Learning

  • Unsupervised learning uses unlabeled input data and identifies common features to form groups.
  • This is also known as Clustering.

Linear Regression With One Variable

  • Finds the line of best fit for a data set.
  • The data set includes the inputs (x) and outputs (y.)
  • Both are continuous
  • The input has only 1 variable.
  • Training Set: a set of data used to train the model.
  • Number of training set examples is M.
  • One of training set: a single point of data.
  • The goal is to find the best fit, but small errors are made.
  • Equations are used to minimize Hypothsis errors.
  • The Hypothesis Function is: h = θ0 + θ1x
  • θ0 is the Y-intercept
  • θ1 is the slope
  • Goal is to select θ0 and θ1 so that the difference actual y is minimized
  • The Mean Squared Error (MSE) is used
  • Generaly it can be said that The training set is put into the learning algorythm and produces the estimated output

Minimizing Error

  • Goal is to minimize the cost function to find the best fit line.
  • An optimization algorithm, such as Gradient Descent, achieves this.
  • Gradient Descent adjusts parameters to find the minimum cost.
  • The formulas include θ0 new (for y intercept) and θ1 new (for the slope).
  • Steps are repeated until the minimum error is found.
  • The learning rate (a) sets the step size when trying to find the most efficient optimization strategy
  • A to low and the process takes to long to optimize
  • A to high and the process fluctuates to far
  • When using MSE the function is convex

Multiple and Logistic Regression

  • Regression can be extended to use multiple features (inputs), x1, x2 etc, instead of just one.
  • The hypothesis function will include additional coefficients to factor in multiple inputs.
  • Used of Cost function to evaluate performance for linear regression.

Normalization

  • Feature Scaling aims to ensure all Features operate on the same range of values.
  • Normalization scales values to a standard range.
  • Mean Normalization subtracts the mean and Divides by (max- min.)
  • Normalization values should equate from 0 to 1
  • Normalization also aims to fit linear regression for more unique data features

Logistic Regression and Sigmoid Functions

  • Logistic Regression is used for binary classification problems (0 or 1).
  • Calculates to see if each output can be classified in classes.
  • A threshold is set to determine whether the output is 0 or 1.
  • The sigmoid function helps predict outputs restricted to 0 and 1 by converting outputs from Logistic regression
  • The threshold is used again following conversion to determine wether the outpus can be classified by 0 or 1

Cost Functions for Logistic Regression

  • Defined using log loss to penalize incorrect predictions.
  • Cost functions are defined on whether the value does equate as anticipated
  • A threshold for H values also exists to support in identifying

Decision Boundary

  • The desicion boundary is a threshold line to determine output classes based on known values.
  • In Logistic regression, this process uses sigmond functions and the defined threshold.
  • In one dimention the desicion boundary is one the line, in two dimentions it is a straight.

Example

  • Use the functions, determine values of the sigmoid function, and cost values based on what is known

KNN (K-Nearest Neighbors) and Naive Bayes

  • KNN is a simple algorithm that classifies data based on the majority class of its nearest neighbors.
  • It works by calculating the distance between data points and classifying new points based on a majority vote of the closest points.

KNN Steps

  • Calculate the distance between the new point and all existing data points.
  • Select the K nearest neighbors based on the calculated distances.
  • Assign the new data point to the class that is most common among its K nearest neighbors.

Distance Calculation

  • Euclidean Distance is a common metric: d=√(y2−y1)2+(x2−x1)2.
  • KNN can be used for both classification and regression. For regression, the average of the neighbors is calculated instead of majority class.
  • Features are used to predict bad or good circumstances. Evaluate data using the above Euclidian function

Naive Bayes

  • A classification algorithm based on applying Bayes' theorem with naive assumptions of independence between features.
  • The assumption for calculating outcomes is also independent, therefore has to be manually assessed
  • Computes P(A|B) to classify each case.
  • Compute probabilities and identify best potential ouctomes

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Supervised vs Unsupervised Learning in AI & ML
48 questions
Intro to AI and ML
10 questions

Intro to AI and ML

ArtisticCatSEye1912 avatar
ArtisticCatSEye1912
Use Quizgecko on...
Browser
Browser