https://github.com/amilworks/gradientdescent
Learning about gradient descent.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.1%) to scientific vocabulary
Repository
Learning about gradient descent.
Basic Info
- Host: GitHub
- Owner: amilworks
- Language: Python
- Default Branch: master
- Size: 11.7 KB
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
- Releases: 0
Metadata Files
README.md
Linear Regression using Gradient Descent
For all of you PSTAT 126 students out there, and, well, people who have taken a course on Linear Regression, here is an example of how to start expanding your theoretical knowledge horizon. This example requires you know some basic Python. If you don't know the basics, seriously ask yourself why you are here, why you still exist, and why you think you will learn from someone who sucks at Java.

Plotting Points

Let's say we have some points on a graph and we want to fit a line through them. This is linear regression--modeling some points on a graph with a line. I know I sound redundant, but it is necessary. Forget about the data, I graphed whatever I could in R. We see that we could probably fit a line through these points, but let's make it hard on ourselves and use gradient descent to prove this phenomenon with some random data.
Our Data
The data we will be using is from a dataset with 2 columns and 150 rows. The first column is hours studied, and the second column is grades on that test. The question of significance is, Do students who study more hours receive better test scores?
The Error Function
We will begin by defining an error function that measures how “good” a given line is. Remember, we are trying to fit a line of best fit. Computing this function will return an error value based on how well the line fits our data.

Finding the Minimum
Next, these two equations will give us a helping hand when attempting to find the minimum.

How to Run and Results
The easiest way to show you how to run the code is by showing.

Inspiration and Documentation
Gradient Descent Example * Huge thanks to Matt Nedrich for providing a detailed example of gradient descent for noobs. Check his Github out. I learned a ton with this example alone.
Owner
- Name: Amil Khan
- Login: amilworks
- Kind: user
- Location: UCSB
- Company: UCSB Electrical & Computer Engineering
- Website: amilworks.github.io
- Repositories: 2
- Profile: https://github.com/amilworks
PhD student in Electrical & Computer Engineering @ucsb, Lead Engineer @ BisQue
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: 12 months ago
All Time
- Total issues: 1
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 1.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- amilworks (1)