{"id":26025325,"url":"https://github.com/preethi2805/logistic_regression_gradient_descent","last_synced_at":"2026-04-16T16:33:39.272Z","repository":{"id":278502951,"uuid":"935831741","full_name":"Preethi2805/Logistic_regression_Gradient_Descent","owner":"Preethi2805","description":"This repository implements a logistic regression model from scratch and applies gradient descent to optimize its parameters.","archived":false,"fork":false,"pushed_at":"2025-02-20T05:10:51.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-09T00:24:30.265Z","etag":null,"topics":["gradie","logisti","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/Preethi2805.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}},"created_at":"2025-02-20T05:01:09.000Z","updated_at":"2025-02-20T05:15:01.000Z","dependencies_parsed_at":"2025-02-20T06:22:46.464Z","dependency_job_id":"39f7733a-8b42-4614-916e-4d8c176f8990","html_url":"https://github.com/Preethi2805/Logistic_regression_Gradient_Descent","commit_stats":null,"previous_names":["preethi2805/logistic_regression_gradient_descent"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Preethi2805/Logistic_regression_Gradient_Descent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Preethi2805%2FLogistic_regression_Gradient_Descent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Preethi2805%2FLogistic_regression_Gradient_Descent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Preethi2805%2FLogistic_regression_Gradient_Descent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Preethi2805%2FLogistic_regression_Gradient_Descent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Preethi2805","download_url":"https://codeload.github.com/Preethi2805/Logistic_regression_Gradient_Descent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Preethi2805%2FLogistic_regression_Gradient_Descent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31895174,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T11:36:10.202Z","status":"ssl_error","status_checked_at":"2026-04-16T11:36:09.652Z","response_time":69,"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":["gradie","logisti","python"],"created_at":"2025-03-06T13:35:40.908Z","updated_at":"2026-04-16T16:33:39.231Z","avatar_url":"https://github.com/Preethi2805.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Logistic Regression with Gradient Descent\n\nThis repository implements a logistic regression model from scratch and applies gradient descent to optimize its parameters. The project consists of two main tasks:\n\n1. **Task 1**: Implement logistic regression with a function to compute the gradient of the cross-entropy loss. \n2. **Task 2**: Train a logistic regression model on the heart disease dataset and visualize the training process.\n\n## Task 1: Logistic Regression and Gradient Computation\nIn this task, the following functions are implemented:\n- `predict_prob(w, x)`: Computes the predicted probability of the positive class for a given feature vector `x` and weight vector `w` using the logistic function.\n- `compute_gradient(ys, xs, w)`: Computes the gradient of the cross-entropy loss with respect to the weight vector `w`, using the true labels `ys` and feature vectors `xs`.\n\nTo verify the gradient computation, the model is trained on a synthetic dataset, where the gradient at the true parameters should be close to zero.\n\n## Task 2: Logistic Regression Model Training with Gradient Descent\nIn this task, the heart disease dataset (`heart.csv`) is used to train a logistic regression model using gradient descent. Key steps include:\n- Data preprocessing: Categorical features (\"cp\" and \"restecg\") are one-hot encoded.\n- Gradient descent optimization: The parameter vector is updated iteratively, and convergence is tracked based on the loss function.\n- Training process: The model is trained for 10 epochs, with a learning rate of `1e-4` and a tolerance of `1e-6`. The loss is tracked and plotted over time.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreethi2805%2Flogistic_regression_gradient_descent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpreethi2805%2Flogistic_regression_gradient_descent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreethi2805%2Flogistic_regression_gradient_descent/lists"}