Bottom Page

• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
 How to build linear regression by implementing Gradient Descent using only linear alg PythonSpeaker Programmer named Tim Posts: 5 Threads: 3 Joined: Nov 2019 Reputation: 0 Likes received: 0 #1 Dec-01-2019, 04:39 PM I'm studying this dataset: https://archive.ics.uci.edu/ml/datasets/...ower+Plant 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. Larz60+ aetate et sapientia Posts: 8,367 Threads: 307 Joined: Sep 2016 Reputation: 346 Likes received: 1132 #2 Dec-01-2019, 05:35 PM see: https://towardsdatascience.com/linear-re...a6c8700931 « Next Oldest | Next Newest »

Top Page

 Possibly Related Threads... Thread Author Replies Views Last Post prediction using linear regression (extrapolation?) in a loop karlito 0 234 Feb-05-2020, 10:56 AM Last Post: karlito Linear Regression on Time Series karlito 5 179 Jan-28-2020, 10:02 AM Last Post: buran Linear Regression Python3 code giving weird solutions deepsen 0 188 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 816 Apr-04-2019, 12:00 PM Last Post: Sri Solve a system of non-linear equations in Python (scipy.optimize.fsolve) drudox 7 11,951 Aug-18-2018, 02:27 AM Last Post: scidam Draw a square-aspect log-linear plot via matplotlib Antonio 4 3,450 Jun-19-2018, 05:57 PM Last Post: Antonio Alternative approach to iterate numerous linear regressions with xlsx data? john_538 0 850 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,273 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,092 Dec-19-2017, 10:42 PM Last Post: Afterdarkreader Why is my gradient descent algorithm requiring such a small alpha? JoeB 1 859 Dec-08-2017, 05:15 PM Last Post: JoeB

Forum Jump:

Users browsing this thread: 1 Guest(s)