counter({'medium' 'low' 'high' }counter({'medium' 'low' 'high' }features['fixed acidity''volatile acidity''citric acid''residual sugar''chlorides''free sulfur dioxide''total sulfur dioxide''density''ph''sulphates''alcohol'from the preceding outputit is evident we use the same physicochemical wine features the number of samples in each quality rating class is also depicted it is quite evident we have very few wine samples of high class rating and lot of medium quality wine samples we move on to the next step of feature scaling in [ ]define the scaler wqp_ss standardscaler(fit(wqp_train_xscale the train set wqp_train_sx wqp_ss transform(wqp_train_xscale the test set wqp_test_sx wqp_ss transform(wqp_test_xlet' train tree based model on this data the decision tree classifier is an excellent example of classic tree model this is based on the concept of decision treeswhich focus on using tree-like graph or flowchart to model decisions and their possible outcomes each decision node in the tree represents decision test on specific data attribute edges or branches from each node represent possible outcomes of the decision test each leaf node represents predicted class label to get all the end-to-end classification rulesyou need to consider the paths from the root node to the leaf nodes decision tree models in the context of machine learning are non-parametric supervised learning methodswhich use these decision tree based structures for classification and regression tasks the core objective is to build model such that we can predict the value of target response variable by leveraging decision tree based structures to learn decision rules from the input data features the main advantage of decision tree based models is model interpretabilitysince it is quite easy to understand and interpret the decision rules which led to specific model prediction besides thisother advantages include the model' ability to handle both categorical and numeric data with ease as well as multi-class classification problems trees can be even visualized to understand and interpret decision rules better the following snippet leverages the decisiontreeclassifier estimator to build decision tree model and predict the wine quality ratings of our wine samples in [ ]from sklearn tree import decisiontreeclassifier train the model wqp_dt decisiontreeclassifier(wqp_dt fit(wqp_train_sxwqp_train_ypredict and evaluate performance wqp_dt_predictions wqp_dt predict(wqp_test_sxmeu display_model_performance_metrics(true_labels=wqp_test_ypredicted_labels=wqp_dt_predictionsclasses=wqp_label_namesfigure - model performance metrics for decision tree for wine quality predictive model