{"id":26276505,"url":"https://github.com/danferns/linear-regression-visualizer","last_synced_at":"2026-01-29T09:34:57.524Z","repository":{"id":134814369,"uuid":"559572302","full_name":"danferns/linear-regression-visualizer","owner":"danferns","description":"Visualize Gradient Descent applied on Linear Regression","archived":false,"fork":false,"pushed_at":"2024-04-29T09:36:44.000Z","size":16595,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-12T07:48:11.060Z","etag":null,"topics":["data-visualization","geogebra","linear-regression"],"latest_commit_sha":null,"homepage":"https://danferns.github.io/linear-regression-visualizer/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danferns.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-10-30T14:35:25.000Z","updated_at":"2024-04-30T14:02:19.000Z","dependencies_parsed_at":"2024-04-29T10:46:19.340Z","dependency_job_id":null,"html_url":"https://github.com/danferns/linear-regression-visualizer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danferns/linear-regression-visualizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danferns%2Flinear-regression-visualizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danferns%2Flinear-regression-visualizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danferns%2Flinear-regression-visualizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danferns%2Flinear-regression-visualizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danferns","download_url":"https://codeload.github.com/danferns/linear-regression-visualizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danferns%2Flinear-regression-visualizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28873986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T07:35:32.468Z","status":"ssl_error","status_checked_at":"2026-01-29T07:33:31.463Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-visualization","geogebra","linear-regression"],"created_at":"2025-03-14T11:18:18.339Z","updated_at":"2026-01-29T09:34:57.473Z","avatar_url":"https://github.com/danferns.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linear Regression Visualizer\n\nThis project demonstrates how the Gradient Descent algorithm can find the line of best fit for a given set of points.\n\n![image](https://github.com/danferns/linear-regression-visualizer/assets/57069381/37fcfb9a-7d56-4998-bd87-7ee0495a7986)\n\nEach time you open the page, some points are randomly generated (marked by `×`) which vaguely resemble a line.\nWe also have an actual line (in green) defined by slope `M` and intercept `B`:\n\n```math\ny = Mx + B\n```\n\nThe goal of the algorithm is to get the line to match the points as closely as possible.\n\n## Slope-Intercept Plane\n\nOn the top left view, you can see a plane with the `M` and `B` axes. Since a line can be defined solely by these two values,\nevery point on this plane corresponds to a unique line. You can click and drag the `M`, `B`, and `Line` points in this view\nto see how the line changes as you change these values.\n\n## Error Function\n\nLinear Regression uses a cost/error function to find out how far the line is from the points. The function takes the\nvertical distances from the line to each of the points (indicated by the brown arrows), squares them individually, and then\nsums up the squares:\n\n```math\nError(M, B) = \\sum_{i} (y(x_i) - y_i) ^ 2\n```\n\nIntuitively, we know that if we move the line, we also change the error value. The 3D plot on the bottom left shows us how \nthe cost varies for the lines represented by the points on the Slope-Intercept plane.\n\n## Gradient Descent\n\nWe can see that the cost function has a bowl-like shape to it, and the lowest point of this bowl is where the error value\nis minimum. The `M` and `B` values at this point define the line of best fit (the line with the least error).\n\nThe Gradient Descent algorithm starts out with any values for `M` and `B`, and then adjusts them in the direction in which the\nerror will be reduced the most. It does this adjustment many times, descending down the error function until it reaches close\nenough to the local minima.\n\nIt knows the direction to move towards by finding the\n[Gradient](https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/gradient-and-directional-derivatives/v/gradient)\nof the error function, and moving in the direction that is opposite to the gradient vector at the current point.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanferns%2Flinear-regression-visualizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanferns%2Flinear-regression-visualizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanferns%2Flinear-regression-visualizer/lists"}