Đề tài 8: Nghiên cứu và cài đặt chương trình phần mềm sử dụng kỹ thuật cây quyết định CART để dự đoán chất lượng (quality) của các loại rượu theo các biến còn lại. Từ kết quả phân lớp và dữ liệu trong tập test, hãy đánh giá hiệu quả của mô hình dự đoán.
CART (Classification and Regression Trees) is a decision tree algorithm used for both classification and regression tasks. It works by splitting the dataset into subsets based on feature values, creating a tree structure where each node represents a decision rule.
- load data: Import the dataset containing wine quality and its physicochemical properties.
- Visualize: Display feature distributions and correlations to understand the dataset.
- Train model: Use the training set to train the CART model.
- Predict: Predict wine quality using the trained model.
- Compare Result: Check predictions against actual values and display a detailed comparison table.
- Evaluate: Display accuracy and other evaluation metrics to assess model performance.
- User prediction: Allow users to input their own data and predict wine quality using the trained model.
Language: Python Libs: Scikit-learn: For implementing CART and evaluating the model. Pandas: For data manipulation. Matplotlib/Seaborn: For visualizations. StreamLit: For creating a web app interface.
Target variable: quality (1-10) Features: fixed acidity, volatile acidity, citric acid, residual sugar, chlorides, free sulfur dioxide, total sulfur dioxide, density, pH, sulphates, alcohol.
- Clone the repository.
- Install the required libraries using
pip install -r requirements.txt
. - Run
streamlit run main.py
- Streamlit Documentation
- Pandas Documentation
- Matplotlib Documentation
- Seaborn Documentation
- Scikit-learn Documentation
- CART Algorithm
- Wine Quality Dataset from NEU LMS