1 Linear Regression with One Variable

| 分类 course  | 标签 ml 

Machine learning algorithms:

  1. Supervised learning
  2. Unsupervised learning
  3. others:
    • Reinforcement learning
    • Recommender systems

Practical advice for applying learning algorithms

Supervised learning is the machine learning task of inferring a function from labeled training data. The training data consist of a set of training examples.

supervised learning give the “right answer” for each example in the data.

  • Regression Problem: predict real-valued output(continuous-value)
  • Classification Problem: discrete-valued output

Notation:

  • m = Number of training examles
  • x’s = “input” variable / features
  • y’s = “output” variable /”target” variable
  • (x, y) – one training example
  • (x^i, y^i) – i^th training example

With the training set and learning algorithm, we get hypothesis, which we use to make predictions, is this linear function.

Hypothesis: hθ(x) = θ0 + θ1x

minimize θ0, θ1, J(θ0, θ1) is cost function(squared error function).

Want

Gradient descent to minimize some arbitrary function J.

Outline

  • Start with some θ01
  • Keep changing θ01 to reduce J(θ01) until we hopefully end up at a minimum

Gradient descent algorithm(梯度下降)

Here α is learning rate,it controls how big a step we take when updating parameter theta J. is the derivative(导数) term.

We must update θ0 and θ1 simultaneously.

Correct: Simultaneously update

!Incorrect

Gradient descent alogirthm

repeat until convergence {

}

Unsupervised learning refers to the problem of trying to find hidden structure in unlabeled data.


上一篇     下一篇