{"id":16520223,"url":"https://github.com/khadkarajesh/wine-prediction","last_synced_at":"2026-04-08T20:03:30.469Z","repository":{"id":43379249,"uuid":"424741147","full_name":"khadkarajesh/wine-prediction","owner":"khadkarajesh","description":"White and Red Wine classification using logistic regression","archived":false,"fork":false,"pushed_at":"2021-12-24T14:04:10.000Z","size":2872,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-04T00:14:48.331Z","etag":null,"topics":["airflow","airflow-dags","classification","classification-algorithm","data-science","dataingestion","evidently","flask","logistic-regression","logistic-regression-algorithm","machine-learning","machine-learning-pipeline","mlflow","numpy","pandas","pipeline","postgresql","python","scikit-learn","supervised-learning"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/khadkarajesh.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}},"created_at":"2021-11-04T21:10:23.000Z","updated_at":"2021-12-25T11:25:09.000Z","dependencies_parsed_at":"2022-08-29T19:12:13.695Z","dependency_job_id":null,"html_url":"https://github.com/khadkarajesh/wine-prediction","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/khadkarajesh/wine-prediction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khadkarajesh%2Fwine-prediction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khadkarajesh%2Fwine-prediction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khadkarajesh%2Fwine-prediction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khadkarajesh%2Fwine-prediction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khadkarajesh","download_url":"https://codeload.github.com/khadkarajesh/wine-prediction/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khadkarajesh%2Fwine-prediction/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31571601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["airflow","airflow-dags","classification","classification-algorithm","data-science","dataingestion","evidently","flask","logistic-regression","logistic-regression-algorithm","machine-learning","machine-learning-pipeline","mlflow","numpy","pandas","pipeline","postgresql","python","scikit-learn","supervised-learning"],"created_at":"2024-10-11T16:50:05.087Z","updated_at":"2026-04-08T20:03:30.450Z","avatar_url":"https://github.com/khadkarajesh.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wine-prediction\nWine-Prediction classifies the wine label based upon following features:\n- fixed acidity\n- volatile acidity\n- citric acid\n- residual sugar\n- chlorides\n- free sulfur dioxide\n- total sulfur dioxide\n- density\n- pH\n- sulphates\n- alcohol\n- quality\n- label\n\nThis application is built to demonstrate the machine learning pipeline using widely used technologies. \n\n# Dataset\nDataset is extracted from the [UCI](https://archive.ics.uci.edu/ml/datasets/wine).\n\n## Architecture Diagram\n\n![airflow_diagram](/media/architecture.png)\n\n## Used Technologies\n\n* Flask\n* Python\n* Streamlit\n* Postgresql\n* AirFlow 2.2\n* Grafana\n\n## Steps to Run Application\n\n1. [Install Dependencies](#install-dependencies)\n2. [Run API](#run-api)\n3. [Run Airflow](#run-airflow)\n4. [Run Frontend](#run-frontend)\n\n### Install Dependencies\n\n1. Create a virtual environment with python3\n   ```shell\n   python3 -m venv wine_prediction\n   ```\n2. Activate the virtual environment:\n   ```shell\n   cd wine_prediction\n   source /bin/activate\n   ```\n2. Install dependencies\n   ```shell\n   pip install -r requirements.txt\n   ```\n\n### Run API\n\n1. Create database and add .env file in ```api/.env```. template of ```.env``` is as follows:\n   ```shell\n   DATABASE_NAME = YOUR_DATABASE\n   DATABASE_PORT = 5432\n   USER_NAME = YOUR_DATABASE_USER\n   USER_PASSWORD = YOUR_DATABASE_USER_PASSWORD\n   ```\n2. Navigate to root of the project\n3. Set environment variables\n   ```bash\n   export FLASK_APP=app:create_app\n   export APP_SETTINGS=\"api.config.DevelopmentConfig\"\n   ```\n4. Run Flask\n   ```bash\n   flask run\n   ```\n\n### Run Frontend\n\n1. Navigate to the ```/frontend``` directory of application\n2. Run streamlit application as:\n\n```bash\n   streamlit run run.py\n```\n\n### Run Airflow\n\n1. Create database user and grant all permission to that user which will be used to store the logs of airflow\n\n   Create user using psql shell.\n   ```psql\n   CREATE DATABASE wine_airflow;\n   CREATE USER airflow_user WITH ENCRYPTED PASSWORD 'airflow_pass';\n   GRANT ALL PRIVILEGES ON DATABASE wine_airflow TO airflow_user;\n   ```\n\n2. Go to root directory of project and set env variable ```AIRFLOW_HOME``` as:\n   ```bash\n   export AIRFLOW_HOME=$PWD/airflow\n   ```\n3. Initialize database\n   ```bash\n   airflow db init\n   ```\n4. Create User (username:admin, password:admin) to access the airflow web application which will be run\n   on ```http://localhost:8080```\n   ```bash\n   airflow users create --username admin --firstname admin --lastname admin --role Admin --email admin@gmail.com --password admin\n   ```\n5. Start Airflow Scheduler\n   ```bash\n   # Set Environment variable to use postgresql as database to store airflow log\n   export AIRFLOW__CORE__SQL_ALCHEMY_CONN=postgresql+psycopg2://airflow_user:airflow_pass@localhost/wine_airflow\n   \n   airflow scheduler\n   ```\n6. Start Web Server\n   ```bash\n   # Set Environment variable to use postgresql as database to store airflow log\n   export AIRFLOW__CORE__SQL_ALCHEMY_CONN=postgresql+psycopg2://airflow_user:airflow_pass@localhost/wine_airflow\n   \n   airflow webserver\n   ```\n\nOnce you run the webserver you can access airflow dashboard on ```http://localhost:8080```.\n\nAirflow has the following data ingestion pipeline:\n\n![airflow_diagram](/media/airflow.png)\n\nWhen the data validation fails, airflow sends email to the respective member which can be configured by adding following\nvariables in airflow. To check this scenario we can enable ```mimic_validation_fail``` in airflow variable.\n\n![airflow_diagram](/media/airflow_variable.png)\n\n## Data Drift Report\n\nData Drift report can be generated by running the jupyter notebook available in the\ndirectory `/notebooks/data_drift_report.ipynb`. If there is drift in data reporting will be of the following format.\n\n![airflow_diagram](/media/data_drift_report.png)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhadkarajesh%2Fwine-prediction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhadkarajesh%2Fwine-prediction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhadkarajesh%2Fwine-prediction/lists"}