Machine Learning: Difference between revisions

From Leo's Notes
This page was last edited on 2 September 2017, at 23:56.
No edit summary
Line 8: Line 8:


=== Multivariate Linear Regression ===
=== Multivariate Linear Regression ===
Multivariate linear regression is a 3 step algorithm that takes in a set of data (ie. the training data) with a solution and applies weights to a number of properties in order to get as close to the answer as possible.
Multivariate linear regression is a 3 step algorithm that converts a training data set into a set of weights that most closely reproduces the answer in the training data set.


The 3 steps are:
The 3 steps are:
# For each parameter, set its weight to 1.0
# For each parameter, set its weight to an arbitrary value, say 1.0
# For every piece of data, see how far off the function using the given weights are off by. The average error amount is the cost of the function.
# For every piece of data, see how far off the function using the given weights are off by. The average error amount is the cost of the function.
# Repeat step 2 with different weights to minimize the cost (ie. the error)
# Repeat step 2 with different weights to minimize the cost (ie. the error)


Step 3 requires picking new weights that reduces the cost. This can be done by something called a batch gradient descent which picks values that 'walks' down the gradient. Because of this, the data that can be handled with this approach has to be linear.
Step 2 requires determining how 'wrong' the prediction is from the answer. This typically is done by:
Cost = (ans1 - pred1)^2 + (ans2 - pred2)^2 + ... + (ansn - predn)^2 / n


By squaring each difference, we penalize larger errors more.
Step 3 requires picking new weights that reduces the cost. This can be done by something called a batch gradient descent. A gradient descent is an iterative optimization algorithm that can be used to minimize the cost function and to find the best weights. However, the data that can be handled with this approach has to be linear.


== Other Topics ==
== Other Topics ==

Revision as of 23:56, 2 September 2017

Introduction

Machine learning algorithms is an umbrella term that covers a range of generic algorithms. There are other branches of machine learning such as supervised learning, unsupervised learning, and reinforcement learning. Supervised learning is the most commonly used.

Supervised learning requires training a model with labeled training data (data with parameters and a solution). The supervised learning algorithm then generates a solution that is as close to the solution as possible. This solution can then be applied to any other problem of the same type.

Unsupervised learning is basically what data mining is: it attempts to look for hidden patterns in the data.

Multivariate Linear Regression

Multivariate linear regression is a 3 step algorithm that converts a training data set into a set of weights that most closely reproduces the answer in the training data set.

The 3 steps are:

  1. For each parameter, set its weight to an arbitrary value, say 1.0
  2. For every piece of data, see how far off the function using the given weights are off by. The average error amount is the cost of the function.
  3. Repeat step 2 with different weights to minimize the cost (ie. the error)

Step 2 requires determining how 'wrong' the prediction is from the answer. This typically is done by:

Cost = (ans1 - pred1)^2 + (ans2 - pred2)^2 + ... + (ansn - predn)^2 / n

By squaring each difference, we penalize larger errors more.

Step 3 requires picking new weights that reduces the cost. This can be done by something called a batch gradient descent. A gradient descent is an iterative optimization algorithm that can be used to minimize the cost function and to find the best weights. However, the data that can be handled with this approach has to be linear.

Other Topics


See Also