{"id":13295936,"url":"https://github.com/mikethwolff/ML-FastAPI","last_synced_at":"2025-03-10T08:31:48.986Z","repository":{"id":230230285,"uuid":"752337383","full_name":"mikethwolff/ML-FastAPI","owner":"mikethwolff","description":"This repository lists one of my projects and findings as part of my Machine Learning DevOps Engineer Nanodegree.","archived":false,"fork":false,"pushed_at":"2024-04-27T17:09:11.000Z","size":1978,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-29T17:44:03.989Z","etag":null,"topics":["continuous-deployment","continuous-integration","fastapi","machine-learning-pipeline","model-bias-analysis"],"latest_commit_sha":null,"homepage":"https://www.udacity.com/certificate/e/d6b5b0e2-4d89-11ee-b9c4-93e0b6acb2ad","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/mikethwolff.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-02-03T17:01:19.000Z","updated_at":"2024-04-27T17:09:15.000Z","dependencies_parsed_at":"2024-04-27T18:23:59.204Z","dependency_job_id":"1eb384e2-d011-4da5-ad65-4d70f4cf3cfc","html_url":"https://github.com/mikethwolff/ML-FastAPI","commit_stats":null,"previous_names":["mikethwolff/fastapi","mikethwolff/ml-fastapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikethwolff%2FML-FastAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikethwolff%2FML-FastAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikethwolff%2FML-FastAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikethwolff%2FML-FastAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikethwolff","download_url":"https://codeload.github.com/mikethwolff/ML-FastAPI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242819234,"owners_count":20190398,"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":["continuous-deployment","continuous-integration","fastapi","machine-learning-pipeline","model-bias-analysis"],"created_at":"2024-07-29T17:18:10.283Z","updated_at":"2025-03-10T08:31:48.310Z","avatar_url":"https://github.com/mikethwolff.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Machine Learning Model Deployment with FastAPI and Heroku\n\n\n## Census project starter kit\n\nCensus project: Predict whether income exceeds $50K/yr based on census data. Also known as Adult dataset.\n\nData has been downloaded from the [Udacity nd0821-c3 project starter kit](https://github.com/udacity/nd0821-c3-starter-code/blob/master/starter/data/census.csv)\n\nThe UC Irvine Machine Learning Repository is where you can find information on the [original dataset](https://archive.ics.uci.edu/dataset/20/census+income)\n\n## Environment\n\n- Create your conda environment: \n  ```\n  $ conda create --name \u003cyour environment name\u003e --file requirements.txt\n  $ conda env create --file conda.yaml\n  \n  $ conda activate \u003cyour environment name\u003e\n  ```\n\n## Data cleaning:\n\n  Data cleaning can be performed by using the Jupyter notebook [\"Census_Clean_Data.ipynb\"](Census_Clean_Data.ipynb).\n  The notebook also provides a good overview of the data. \n  Data cleaning will also be provided via Python file: [\"/ml/data_cleaning.py\"](/ml/data_cleaning.py)\n\n## Sanity check: \n  ```\n  $ python -m tests.sanitycheck\n  ```\n  Answer path question with \"tests.api_tests.py\" as test file for a check of functionality to meet course specifications\n\n## Training the model: \n  ```\n  $ python -m ml.train_model\n  ```\n  After the model has been trained successfully, the following files will be saved:\n\n  Metrics will be written to [\"/artifacts/slice_output.txt\"](/artifacts/slice_output.txt)\n\n  Model will be saved to file [\"/artifacts/model.joblib\"](/artifacts/model.joblib)\n\n  Encoder will be saved to [\"/artifacts/encoder.joblib\"](/artifacts/encoder.joblib)\n\n  Label binarizer will be saved to [\"/artifacts/lb.joblib\"](/artifacts/lb.joblib)\n\n  The output will be shown on screen and also be saved in [\"/logs/census.log\"](/logs/census.log)\n\n## Census API tests: \n\n  Start the uvicorn server with:\n  ```\n  $ uvicorn main:app --reload\n  ```\n  The server is then accessible via: [\"http://127.0.0.1:8000\"](http://127.0.0.1:8000)\n\n  Documents can be found here: [\"http://127.0.0.1:8000/docs\"](http://127.0.0.1:8000/docss)\n\n  FastAPI tests can be performed by using the Jupyter notebook [\"Census_Tests_API.ipynb\"](Census_Tests_API.ipynb).\n  \n## Pytest:\n\nPytest will run all tests in the tests folder and can be executed via: \n  ```\n  $ pytest -vv\n  ```\n\n## Model card\n\nFind detailed information in the [\"model_card.md\"](model_card.md)\n\n## GithubActions\n\nIf changes have been made, github actions is called.\n\n## Continuous Deployment to Heroku\n\nThe Heroku app can be tested by using the Jupyter notebook [\"Census_Test_Heroku.ipynb\"](Census_Test_Heroku.ipynb).\n\nThe app deployed on Heroku can be accessed at: [\"https://census-salaries-d3e2956470bf.herokuapp.com/\"](https://census-salaries-d3e2956470bf.herokuapp.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikethwolff%2FML-FastAPI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikethwolff%2FML-FastAPI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikethwolff%2FML-FastAPI/lists"}