How ahmetbekir22/wine-quality-prediction works
Main System Components
• Data Layer: Represent the wine data stored in the wine_quality_data directory (red and white wine CSV files plus metadata). This is the source of input features.
• Data Analysis & Preprocessing (Optional): While there's no dedicated directory for data transformation, note that the project incorporates feature engineering and preprocessing steps as described in the README.
• Classification Module: This includes the scripts under the classification directory (prediction.py, red_classification.py, white_classification.py) and the corresponding serialized models (classification_red_model.pkl and classification_white_model.pkl). It is responsible for categorizing wine quality into discrete classes (low, medium, high) using a Random Forest approach.
• Regression Module: This includes Python scripts in the regression directory (regression_prediction.py, red_xgboost_model.py, white_xgboost_model.py) and the XGBoost pickle files (xgboost_red_model.pkl and xgboost_white_model.pkl) that are used to predict the wine quality score on a numerical scale.
• Exploratory Analysis: The Jupyter Notebook (white_wine_analays.ipynb) can be depicted as an analysis/visualization component that helps in understanding the dataset and model performance.
Relationships/Interactions Between These Components
• Model Prediction: Both classification (using Random Forest) and regression (using XGBoost) components receive preprocessed features. Clearly show their separate logic flows.
• Feedback or Evaluation: Optionally include a component for model evaluation where performance metrics (accuracy, F1 score, R², MSE) are computed, as described in the README.
Architectural Patterns and Design Principles
• Separation of Concerns: The project splits its core functionality into independent modules for classification and regression.
• Modular Design: Each module (classification and regression) is self-contained, with their own model files and prediction scripts.
• Reusability: The existence of distinct model files (for red and white wines) implies tailor-made pipelines for different wine types. Represent these as sub-components within each module.
• Extensibility: The notebook and structured code-base suggest that future enhancements (e.g., additional preprocessing steps or new model types) can be added without significant rework.
Relevant Technologies and Frameworks
• Machine Learning Frameworks: Note (e.g., scikit-learn for Random Forest, XGBoost library for gradient boosting) as part of the underlying technology.
• Model Tuning Tools: Although only mentioned in the README (GridSearchCV for Random Forest, Optuna for XGBoost), include a callout indicating hyperparameter tuning.
• Data Formats: CSV files for the raw data and pickle files (.pkl) for the serialized models.
• Use clear labels for each component. For instance, "Wine Quality Data (CSV)" for the data source, "Feature Engineering" for the preprocessing step, "Random Forest Classifier" under Classification, and "XGBoost Regressor" under Regression.