{"id":18317699,"url":"https://github.com/datarohit/bentoml-learning","last_synced_at":"2025-04-09T13:49:11.722Z","repository":{"id":189966568,"uuid":"681665569","full_name":"DataRohit/BentoML-Learning","owner":"DataRohit","description":"GitHub repo showcasing a SVM-based Iris flower species classifier. Leveraging BentoML for model deployment and Swagger API integration. Trained on the Iris dataset with 150 instances from 3 species. Ready for collaborative contributions.","archived":false,"fork":false,"pushed_at":"2023-08-22T15:23:07.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T07:47:22.456Z","etag":null,"topics":["bentoml","svm-classifier","swagger"],"latest_commit_sha":null,"homepage":"","language":"Python","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/DataRohit.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}},"created_at":"2023-08-22T13:49:23.000Z","updated_at":"2023-08-30T13:56:18.000Z","dependencies_parsed_at":"2023-08-22T18:21:30.087Z","dependency_job_id":null,"html_url":"https://github.com/DataRohit/BentoML-Learning","commit_stats":null,"previous_names":["datarohit/bentoml-learning"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataRohit%2FBentoML-Learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataRohit%2FBentoML-Learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataRohit%2FBentoML-Learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataRohit%2FBentoML-Learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DataRohit","download_url":"https://codeload.github.com/DataRohit/BentoML-Learning/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054218,"owners_count":21039951,"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":["bentoml","svm-classifier","swagger"],"created_at":"2024-11-05T18:07:09.707Z","updated_at":"2025-04-09T13:49:11.673Z","avatar_url":"https://github.com/DataRohit.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Iris Classification Project using Support Vector Machine (SVM) and BentoML\n\nThis project focuses on the development of a machine learning model using the Iris dataset. We use Support Vector Machine (SVM) as our model of choice which we implemented using sklearn. The model is built, trained, and then served using BentoML which provides an incredible way of handling models in production.\n\n## Project Set Up\n\nThe project setup is simple and straightforward. You need to have [Python](https://www.python.org/downloads/), BentoML and Scikit-Learn installed. To install BentoML and Scikit-learn, run the following command:\n\n```bash\npip install bentoml scikit-learn\n```\n\n## Building the Model\n\nThe model is built using the Iris dataset. SVM is chosen for this multi-class classification problem. The dataset contains 150 instances of iris flowers from three different species.\n\nHere's an overview of how the model was saved:\n\n```python\nimport bentoml\nfrom sklearn import datasets, svm\n\n# Load the dataset\nX, y = datasets.load_iris(return_X_y=True)\n\n# Model Training\nclf = svm.SVC(gamma=\"scale\")\nclf.fit(X, y)\n\n# Create a BentoService\nsaved_model = bentoml.sklearn.save_model(\"iris_svm_clf\", clf)\nprint(f\"Model saved: {saved_model}\") \n```\n\nThe `save_model` function is used to save the trained model instance.\n\n## Loading and Making Predictions with the Model\n\nTo load the model back into memory, following BentoML's `load_model` function is used:\n\n```python\nimport bentoml\n\niris_clf_runner = bentoml.sklearn.get(\"iris_svm_clf:latest\").to_runner()\n\niris_clf_runner.init_local()\n\nprint(iris_clf_runner.predict.run([[5.9, 3.0, 5.1, 1.8]]))\n```\n\nYou can then use this model for predicting unseen examples.\n\n## Deploying the Model with BentoML\n\nBentoML is a fantastic library that simplifies the process of serving and deploying ML models. One of its features is the ability to automatically generate a Swagger API from your PyTorch model.\n\nBy using BentoML, you can easily serve your model as a high-performance API endpoint and consume it from a web frontend, mobile applications or in a microservices architecture.\n\n## Conclusion\n\nThis project is a demonstration of how one can build and deploy models with BentoML. You can access the complete code in this repository.\n\nIf you find it helpful, feel free to clone, download, or contribute to this project.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatarohit%2Fbentoml-learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatarohit%2Fbentoml-learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatarohit%2Fbentoml-learning/lists"}