Uploaded by 1750645714

machine learning

advertisement
Artificial Intelligence III: Artificial Intelligence and Deep Learning
Glass type prediction
Introduction
In this task, we are going to predict the type of glass base on their oxide content. There are nine
features. They are refractive index, Sodium, Magnesium, Aluminum, Silicon, Potassium, Calcium,
Barium, Iron. And we should use these features to classify them into seven types.
Method
Obviously, it is a kind of classification problem in machine learning. There are many methods we
can use, such as Random Forest, Neural Network, Support vector and so on. But we finally choose
to use Random Forest classification as it has the best accuracy and robustness.
Experiment
Settings
We use FOR loop to find the best max_feature and n_estimator and draw the graph. We let the
test size be 0.41. After that, we make the prediction and draw the Scatter plot. Finally we draw the
significance level analysis graph of characteristic variables.
Results and Discussion
We first find the best max_feature. From the following graph, we can easily realize that the
max_feature is four. Actually, from the significance level analysis graph of characteristic variables,
we find that the first four features, namely Al, Mg, RI, Ca take on nearly 60% of the weights.
Let max_feature equals to 4, we continue to find the best n_estimator. From this graph, we find
that the best n_estimator is 174 while after the n_estimator becomes greater than 230, the
accuracy doesn’t change much more, but it is still minor than the accuracy when n_estimator is
174.
Then we use the best max_feature and n_estimator to predict the x_test, and we finally get the
following Scatter plot of x_test and y_test.
The score of accuracy is nearly 70.4%.
Conclusion
It seems that the score isn’t very high but it is better than other classifications. Maybe the noise is
a little bit more in this database.
After the prediction, I try to find the max_feature and n_estimator at the same time. The result
seems to be the same as what I have got before.
Download