Classification is a supervised machine learning method where the model tries to predict the correct label of a given input data. One of the algorithms used for classification is the “Decision Tree Classifier”.
Here, we use the fish.csv dataset for classification purposes and you can download the dataset from the link on top of this page.
This dataset has 6 features:
“Weight”, “Length1: Vertical Length”, “Length2: Diagonal Length”, “Length3: Cross Length”, “Height” and “Width: Diagonal Width”
And the label for each item in the dataset is the type of Fish, which has 7 values:
“Bream”, “Roach”, “Whitefish”, “Parkki”, “Perch”, “Pike” and “Smelt”.
In the above form, you enter the values of 6 features and the model returns the type of Fish in a pop-up form. Notice that the values and ranges of each feature are as below:
5 < Weight (gram) < 1650
7.5 < Length1: Vertical Length (cm) < 59
8.4 < Length2: Diagonal Length (cm) < 63.4
8.8 < Length3: Cross Length (cm) < 68
1.72 < Height (cm) < 18.95
1.04 < Width: Diagonal Width (cm) < 8.14
The sample code used to train a “Decision Tree” classification model, is provided in the link on top of this page. Each time you run this form and classification predictions happen, the values will store in the database, and with the link “result” on top of this page, you will see the previous results of the model prediction. Your recent run will be added to the end of this list.