Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 How to build linear regression by implementing Gradient Descent using only linear alg
I'm studying this dataset:
These are the features:
- AT: Ambiant Temperature
- V: Exhaust Vacuum
- AP: Ambient Pressure
- RH: Relative Humidity
- PE: Energy Output (the label to predict)

We have many parameters such as:
- m: number of observations in the training set
- n: number of features (without the y offset)
- w: the vector of weights of your model (w0, w1, …., wn)
- x: an observation vector (features and offset x0=1 ) . Dimension : (n+1, 1)
- X: matrix of observations. Dimension : (m, n+1)
- y: label (‘answers’) vector . Dimension : (m, 1)
- cost: the cost function J
- delta: the stop condition
- iterations: max number of iterations of the gradient descent (default value = 1000)
- alpha: learning rate of the gradient descent (default value = 0.03)
So I initialize all the vectors first. However, how will I add values inside these vectors? How to do matrix multiplications and the transposed matrix in Python?

w = array([])
x = array([])
X = array([])
y = array([])
I don't really know what to do next.

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Linear Regression Python3 code giving weird solutions deepsen 0 117 Nov-01-2019, 12:06 PM
Last Post: deepsen
  Regression Event navigates 1 147 Oct-01-2019, 07:27 PM
Last Post: Larz60+
  sklearn regression to excel punksnotdead 1 394 Apr-14-2019, 12:32 PM
Last Post: punksnotdead
  [pandas]How to liner fit time series data and get linear fit equation and r square Sri 5 689 Apr-04-2019, 12:00 PM
Last Post: Sri
  Logistic regression with Tensorflow kiton 1 635 Nov-28-2018, 07:34 PM
Last Post: kiton
  Solve a system of non-linear equations in Python (scipy.optimize.fsolve) drudox 7 10,551 Aug-18-2018, 02:27 AM
Last Post: scidam
  Draw a square-aspect log-linear plot via matplotlib Antonio 4 2,916 Jun-19-2018, 05:57 PM
Last Post: Antonio
  Alternative approach to iterate numerous linear regressions with xlsx data? john_538 0 779 Apr-07-2018, 10:15 PM
Last Post: john_538
  What is wrong with this implementation of the cost function for linear regression? JoeB 1 1,210 Dec-23-2017, 10:05 AM
Last Post: buran
  something that returns a linear function compatible with lognorm.pdf and lognorm.cdf? Afterdarkreader 2 1,043 Dec-19-2017, 10:42 PM
Last Post: Afterdarkreader

Forum Jump:

Users browsing this thread: 1 Guest(s)