{"id":20101750,"url":"https://github.com/bluegob/linear-regression-go","last_synced_at":"2025-07-10T13:34:12.175Z","repository":{"id":256009468,"uuid":"853881353","full_name":"BlueGob/Linear-regression-Go","owner":"BlueGob","description":"simple linear regression with Go from a csv file","archived":false,"fork":false,"pushed_at":"2024-09-08T13:05:22.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T17:16:17.961Z","etag":null,"topics":["go","linear-regression"],"latest_commit_sha":null,"homepage":"","language":"Go","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/BlueGob.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":"2024-09-07T19:45:56.000Z","updated_at":"2024-09-08T14:34:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"95ca7374-c427-4090-a6ce-957ed9bc88d6","html_url":"https://github.com/BlueGob/Linear-regression-Go","commit_stats":null,"previous_names":["bluegob/linear-regression-go"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/BlueGob/Linear-regression-Go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueGob%2FLinear-regression-Go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueGob%2FLinear-regression-Go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueGob%2FLinear-regression-Go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueGob%2FLinear-regression-Go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlueGob","download_url":"https://codeload.github.com/BlueGob/Linear-regression-Go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueGob%2FLinear-regression-Go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264585372,"owners_count":23632647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["go","linear-regression"],"created_at":"2024-11-13T17:26:35.448Z","updated_at":"2025-07-10T13:34:12.121Z","avatar_url":"https://github.com/BlueGob.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Linear Regression with Go\r\nThis project provides an implementation of linear regression with two variables in Go.\r\nIt includes various evaluation metrics such as R² (R-squared), Mean Squared Error (MSE),and Mean Absolute Error (MAE).\r\n## Features\r\n-  Load data from a CSV file\r\n- Fit a linear regression model\r\n- Calculate MAE, MSE, and R²\r\n- Make predictions based on the model\r\n## Getting Started\r\n\r\n### Usage\r\n1. ```bash\r\n   go get github.com/BlueGob/Linear-regression-Go\r\n   ``` \r\n2. Create a Go file (`main.go`) with the following content:\r\n\r\n    ```go\r\n    package main\r\n\r\n    import (\r\n        \"fmt\"\r\n        \"github.com/BlueGob/Linear-regression-Go/regression\"\r\n    )\r\n\r\n    func main() {\r\n        lr := regression.NewLinearRegression(\"employee_salary.csv\", \"Salary\", 0.2)\r\n        lr.Fit()\r\n        fmt.Println(\"Prediction for input 2:\", lr.Predict(2))\r\n        fmt.Println(\"Mean Absolute Error (MAE):\", lr.Mae())\r\n        fmt.Println(\"Mean Squared Error (MSE):\", lr.Mse())\r\n        fmt.Println(\"R-squared (R²):\", lr.R2())\r\n    }\r\n    ```\r\n\r\n2. Run the program:\r\n\r\n    ```bash\r\n    go run main.go\r\n    ```\r\n### Dataset\r\nThe dataset used for this project can be found on [Kaggle](https://www.kaggle.com/datasets/hassanmustafa01/employee-salary-dataset)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluegob%2Flinear-regression-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluegob%2Flinear-regression-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluegob%2Flinear-regression-go/lists"}