{"id":14958204,"url":"https://github.com/melikaas/lda_classification","last_synced_at":"2025-10-25T05:06:37.880Z","repository":{"id":254695107,"uuid":"847286328","full_name":"MelikaaS/LDA_Classification","owner":"MelikaaS","description":"This repository focuses on implementing Linear Discriminant Analysis (LDA) as a classifier on embedded scikit-learn datasets. The goal is to improve the model's performance on these datasets.","archived":false,"fork":false,"pushed_at":"2024-08-26T09:06:08.000Z","size":963,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T00:25:13.591Z","etag":null,"topics":["classification","machine-learning-algorithms","scatterplot","scikit-learn"],"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/MelikaaS.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-08-25T11:48:02.000Z","updated_at":"2024-08-27T11:01:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"7fb4e50a-1978-4a58-b94e-cb0f98e77d27","html_url":"https://github.com/MelikaaS/LDA_Classification","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"58fa5127edc4025e5aacfd64b99cf3e72d3bd643"},"previous_names":["melikaas/lda_classification"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MelikaaS%2FLDA_Classification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MelikaaS%2FLDA_Classification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MelikaaS%2FLDA_Classification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MelikaaS%2FLDA_Classification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MelikaaS","download_url":"https://codeload.github.com/MelikaaS/LDA_Classification/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237926611,"owners_count":19388577,"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":["classification","machine-learning-algorithms","scatterplot","scikit-learn"],"created_at":"2024-09-24T13:16:28.245Z","updated_at":"2025-10-25T05:06:32.857Z","avatar_url":"https://github.com/MelikaaS.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LDA_Classification\nThis repository focuses on implementing Linear Discriminant Analysis (LDA) as a classifier on embedded scikit-learn datasets. The goal is to improve the model's performance on these datasets.\n\n## Dataset Overview\nThis repository utilizes two small embedded scikit-learn datasets: **`load_wine`** and **`load_digits`**.\n- **`load_wine`**: A small dataset containing 178 data points with 13 features serving as predictors and three target classes.\n- **`load_digits`**: A larger dataset with 1,797 data points, each having 64 features and 10 target classes.\n\n## Operations\n### On the `load_wine` Dataset:\n1. Fitted the LDA model on the `load_wine` dataset.\n2. Extracted the `explained_variance_ratio_` to analyze the contribution of each LDA component.\n3. Evaluated the model by calculating the accuracy using **`accuracy_score`**.\n4. Conducted a visual analysis using a scatter plot of the LDA components.\n\n### On the `load_digits` Dataset:\n1. Fitted the LDA model on the `load_digits` dataset.\n2. Extracted the `explained_variance_ratio_` to understand the significance of each LDA component.\n3. Evaluated the model's accuracy using **`accuracy_score`**.\n4. Conducted a visual analysis using scatter plots of the LDA components.\n5. Standardized the data using **`StandardScaler`**.\n6. Re-fitted the LDA model on the standardized data to assess the impact of standardization.\n7. Recalculated the accuracy using **`accuracy_score`**.\n8. Made additional visual observations based on the standardized data.\n9. Implemented a pipeline to streamline data standardization and feature selection before fitting the LDA model.\n10. Used cross-validation to evaluate the models' performance.\n11. Calculated accuracy scores for the pipelined data.\n12. Made further visual observations.\n\n## Results\nThe `load_wine` dataset is relatively small, allowing the LDA model to achieve perfect classification, with an accuracy score of **1.0**. This indicates that the data was perfectly separated into three groups, as demonstrated in the scatter plot of LDA Component 0 against LDA Component 1.\n\n![LDA classification on **`load_wine`** dataset](https://github.com/MelikaaS/LDA_Classification/blob/main/Screenshot%20from%202024-08-26%2011-58-36.jpg)\n\n\n----\nThe `load-digits` dataset contains 1797 datapoints, 64 predictors and 10 target classes. Below table shows the result of implementing LDA on `load_digits` dataset:\n\n| Step                                              | Description                                               | Accuracy Score          |\n|---------------------------------------------------|-----------------------------------------------------------|-------------------------|\n| LDA model fitted on `load_digits` dataset         | Initial model without any preprocessing                    | 0.9638                  |\n| Data standardized with `StandardScaler()`         | Data was standardized before fitting the LDA model         | 0.9638                  |\n| Pipeline: Standardization and feature selection   | Standardization and PCA applied before LDA through pipeline| 0.9638                  |\n\n---\n## Conclusion\nThe `**load_digits**` dataset in scikit-learn is a well-known dataset used for classification tasks. \nThe similarity in accuracy scores across the different methods (direct LDA, LDA after standardization, and LDA in a pipeline) suggests that the features are already quite effective for classification and that the transformations are not significantly altering the feature space in a way that impacts classification performance.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelikaas%2Flda_classification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelikaas%2Flda_classification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelikaas%2Flda_classification/lists"}