amiepsa's website

the learning problem

#The 3 essence of ML (when can you apply ML to solve a problem)

  1. A pattern exists
  2. We cannot pin it down mathematically (we couldn't write down how the system works on our own, so we're going to depend on data to help us find the system)
  3. We have to have data on it.

Now back to the example of how a viewer will rate a movie. We are going to describe a viewer as a vector of factors, a profile. Vector 1 contains user-related data: factor 1 : do they like comedy? factor 2 : do they like action? factor 3 : do they prefer blockbusters? and so on...

Vector 2 contains movie-related data: factor 1 : does the movie contain comedy? factor 2 : does the movie contain action? factor 3: is the movie a blockbuster?

Now compare the 2 vectors (vector with user factors vs vector with movie factors) and if a lot of the factors match, then the chances of a user liking a movie is high

Match movie and viewer vectors >> Add contributions from each factor >> and then arrive at the predicted rating

This is not ML cause we have to watch the movie, analyze the content, interview the viewer and ask them about their preferences and then arrive at the prediction.

#The learning approach We have 2 sets of vectors with the same factors for the viewer and the movie. But here, since we're taking an ML approach we will reverse-engineer the process. We will assign a random value to the predicted rating and then try to find out what factors (viewer + movie) will be consistent with the predicted rating. Again, we will assign random numbers for both viewer+movie factors. And since we're taking random factors and assigning a random prediction, when we join the 2 sets of factors (viewer+movie), we will get a prediction that does not match with the initial predicted rating we had randomly assigned in the beginning.

So you take a rating that actually happened and slightly nudge these randomly assigned factors towards the actual rating. Do the same for say over a million ratings, not just for one rating. Soon we will reach a point where the factors actually give us a meaningful prediction.

Now if we get a viewer that has not watched a movie (viewer factors), and have the factors of a movie that the user is watching, we can take the vectors that resulted from our learning process above and arrive at the predicted rating that is consistent with the actual viewer's rating. = That's the idea!

#Components of learning Metaphor - credit approval Here banks will rely on past data about customers, whether customers were able to repay the credit borrowed, did they default etc. and apply the same learnings to a future customer

  1. Applicant information (age, gender, annual salary etc. = credit worthiness. Similar to our example earlier, where we assigned random user factors, here we get the applicant information and we are confident that these are somehow related to the creditworthiness of the applicant.

  2. Formalization:

Here each vector would contain a list of numbers, for eg: [ 23, 5, 90] and this is a 3 dimensional vector If there are 4 features (factors as we learnt earlier) then it would look like this: [23, 5, 90, 4] - this is a 4 dimensional vector. For now we take, a d dimensional vector where d is the number of features or factors.

In ML, the target function is always unknown to us. If it were known, we wouldn't need learning, cause we can go ahead and implement it.

So if for eg if (x9,y9) was approved, the bank would want an applicant with similar input ie. x9.

the hypothesis should approximate the target function well, so g(hypothesis) should be similar to f(target function) = that's the goal of learning.

The learning algorithm takes the training examples and produces the final hypothesis. It takes in input from the hypothesis set (the set of all the functions that can potentially be the target function.

Unknown target function + training examples - not under our control

#Solution components:

  1. Hypothesis g is the final hypo that belongs to set H
  2. Learning algorithm

The hypothesis set and the learning algo - together they are referred to as the learning model H/Learning algo = perceptron / perceptron algorithm, NeuralNetwork / Back propogation, SVM / quadratic programming.

#Perceptron model It takes different attributes and assigns different weights to each attribute. You add each of them in a linear form (that's what makes it a perceptron) No idea waht the weights and attributes are.

Your weights and threshold are the parameters that define one hypothesis value from the other

The hypothesis set gives you the resources that you can work with.

#Perceptron learning algorithm It takes the training data and tries to make the w(weight) correct. When the w is incorrect, it updates the w.

#Iterations of the PLA For each iteration, pick a misclassified point and run the PLA iteration on it. this is the simplest learning model.

#Types of learning Basic premise of learning - using a set of observations (data) to uncover an underlying process (the target function).

  1. Supervised learning Data with the output explicitly given (data with labels) = (input+correct output)

  2. Unsupervised learning only data / only input. In USL, the number of clusters is ambiguous. a.k.a getting a higher level of representation in the input, than just raw or crude input

  3. Reinforcement learning Input is given + some output + grade/prize/reward for this output

#study-notes