Glass Classification using Machine Learning
We are using Classification techniques like ID3,CART, Logistic Regression, Random Forest,Neural networks to classify the different types of glass.
Modules involved:
- Loading Data , pre-processing our data
- Splitting the data into training samples and testing samples
- Using classification techniques and finding the accuracy of the model
- Analyzing different classification metrics like MSE, RMSE , Precision , Recall , Accuracy etc.
- Concluding the best model.
DATASET
Details
Dimensions: 214 rows x 10 columns
Attribute Information:
- Id number: 1 to 214 (removed from CSV file)
- RI: refractive index
- Na: Sodium (unit measurement: weight percent in corresponding oxide, as are attributes 4–10)
- Mg: Magnesium
- Al: Aluminum
- Si: Silicon
- K: Potassium
- Ca: Calcium
- Ba: Barium
- Fe: Iron
- Type of glass: (class attribute) — 1 building_windows_float_processed — 2 building_windows_non_float_processed — 3 vehicle_windows_float_processed — 4 vehicle_windows_non_float_processed (none in this database) — 5 containers — 6 tableware — 7 headlamps
Our target attribute is “Type”, we need to classify the glass in 7 types as mentioned above based on the features.
1.Loading & pre-processing our dataset
As all the values are numeric, we can proceed to normalize the values
2.Splitting the data into training samples and testing samples
Divided the given dataset into train and test data with a 7:3 ratio using Sklearn’s train_test_split function.
3.Using classification techniques and finding the accuracy of the model
ID3
CART
Logistic Regression
Random Forest
Neural Network
4. Analyzing different classification metrics like MSE, RMSE , Precision , Recall , Accuracy etc.
we already analyzed them in the previous steps.
5. Concluding the best model.
Among all the classifiers we choose CART as it has the highest accuracy later we choose Random forest and ID3 decision tree.