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
  Doubt in Linear Reg by 'MLE' method kumarants 2 180 May-08-2020, 12:52 PM
Last Post: kumarants
  Doubt in Linear Reg - "random_state" kumarants 1 253 May-05-2020, 06:42 PM
Last Post: buran
  Linear regression doubt - Urgent kumarants 6 387 May-05-2020, 04:11 PM
Last Post: kumarants
  How come afer some iterations of gradient descent, the error starts growing? Corpac 0 208 Mar-20-2020, 05:20 PM
Last Post: Corpac
  Problem implementing .iloc slicing in a custom function amjass12 2 263 Mar-03-2020, 08:51 PM
Last Post: amjass12
  prediction using linear regression (extrapolation?) in a loop karlito 0 448 Feb-05-2020, 10:56 AM
Last Post: karlito
  Linear Regression on Time Series karlito 5 380 Jan-28-2020, 10:02 AM
Last Post: buran
  Linear Regression Python3 code giving weird solutions deepsen 0 292 Nov-01-2019, 12:06 PM
Last Post: deepsen
  [pandas]How to liner fit time series data and get linear fit equation and r square Sri 5 1,036 Apr-04-2019, 12:00 PM
Last Post: Sri
  Solve a system of non-linear equations in Python (scipy.optimize.fsolve) drudox 7 14,150 Aug-18-2018, 02:27 AM
Last Post: scidam

Forum Jump:

Users browsing this thread: 1 Guest(s)