{"id":18171336,"url":"https://github.com/saurav-navdhare/bayesianclassifier","last_synced_at":"2025-09-13T05:41:28.167Z","repository":{"id":260269453,"uuid":"880822775","full_name":"Saurav-Navdhare/BayesianClassifier","owner":"Saurav-Navdhare","description":"This repository contains golang code of Bayesian Learning on a diabetes dataset","archived":false,"fork":false,"pushed_at":"2025-05-30T18:23:52.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-18T16:04:00.651Z","etag":null,"topics":["bayesian-learning","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Saurav-Navdhare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-30T12:31:26.000Z","updated_at":"2025-05-30T18:23:55.000Z","dependencies_parsed_at":"2024-10-30T13:35:01.322Z","dependency_job_id":"ef6ea218-9e7f-4db6-84ff-d97a1c7dab77","html_url":"https://github.com/Saurav-Navdhare/BayesianClassifier","commit_stats":null,"previous_names":["saurav-navdhare/bayesianclassifier"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Saurav-Navdhare/BayesianClassifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saurav-Navdhare%2FBayesianClassifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saurav-Navdhare%2FBayesianClassifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saurav-Navdhare%2FBayesianClassifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saurav-Navdhare%2FBayesianClassifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Saurav-Navdhare","download_url":"https://codeload.github.com/Saurav-Navdhare/BayesianClassifier/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saurav-Navdhare%2FBayesianClassifier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274921356,"owners_count":25374252,"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","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bayesian-learning","go","golang"],"created_at":"2024-11-02T15:08:42.945Z","updated_at":"2025-09-13T05:41:28.100Z","avatar_url":"https://github.com/Saurav-Navdhare.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project Title\n\nThis project implements a machine learning model in Go, focusing on data preprocessing, training, and evaluation. The model handles binary classification tasks and includes functions for splitting data, calculating probabilities, and saving/loading model parameters.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Functions](#functions)\n    - [Data Preprocessing](#data-preprocessing)\n    - [Model Training](#model-training)\n    - [Model Saving and Loading](#model-saving-and-loading)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Installation\n\n1. Clone the repository:\n    ```sh\n    git clone https://github.com/Saurav-Navdhare/BayesianClassifier.git\n    cd BayesianClassifier\n    ```\n\n2. Install dependencies:\n    ```sh\n    go mod tidy\n    ```\n\n## Usage\n\n1. **Data Preprocessing**: Convert raw data into a format suitable for training.\n    ```go\n    import \"BayesianClassifier/utils\"\n\n    data := [][]string{\n        {\"Yes\", \"No\", \"Male\"},\n        {\"No\", \"Yes\", \"Female\"},\n    }\n    headers := []string{\"Feature1\", \"Feature2\", \"Gender\"}\n\n    binaryData := utils.BinaryLabelling(data)\n    df := utils.ConvertToDF(binaryData, headers)\n    ```\n\n2. **Train-Test Split**: Split the data into training and test sets.\n    ```go\n    import \"BayesianClassifier/model\"\n\n    trainSet, testSet := model.TrainTestSplit(df, 0.2)\n    ```\n\n3. **Model Training**: Train the model using the training set.\n    ```go\n    classProbabilities, featureStats := model.CalculateProbabilities(trainSet)\n    ```\n\n4. **Save Model**: Save the trained model to a file.\n    ```go\n    model := model.Model{\n        ClassProbabilities: classProbabilities,\n        FeatureStats:       featureStats,\n    }\n    model.SaveModel(\"model.json\", model)\n    ```\n\n5. **Load Model**: Load the model from a file and print the parameters.\n    ```go\n    loadedModel, err := model.LoadModel(\"model.json\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    ```\n\n## Functions\n\n### Data Preprocessing\n\n- `BinaryLabelling`: Converts categorical data into binary labels.\n- `ConvertToDF`: Converts a 2D slice of integers into a DataFrame-like map.\n\n### Model Training\n\n- `TrainTestSplit`: Splits the dataset into training and test sets.\n- `CalculateProbabilities`: Calculates class probabilities and feature statistics.\n\n### Model Saving and Loading\n\n- `SaveModel`: Saves the model parameters to a JSON file.\n- `LoadModel`: Loads the model parameters from a JSON file and prints them.\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaurav-navdhare%2Fbayesianclassifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaurav-navdhare%2Fbayesianclassifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaurav-navdhare%2Fbayesianclassifier/lists"}