In this blog post, I show how I incorporated machine learning into my high school chemistry class that I teach in my spare time. The purpose behind this blog is to show that machine learning is applicable to high school students and to thank Kaggle as well as the other developers behind Python and her modules – my students have benefitted from your work!


I began by leading my students through a simple Iodine Sodium Chlorate experiment where the concentration of Iodine was varied and then mixed with a standard concentration of Sodium Chlorate to obtain clarity values. The end result was data that showed the percentage concentration of Iodine against the clarity (absorbance) of the final solution.

Below you will see a print out of the data from a Kaggle notebook. I specifically designed the experiment to take in the Percent Iodine column as the input feature x and the Clarity Score column as the label. In addition, I decided to keep the data set small as well as ensuring that the values did not need any scaling, both for simplicity sake.

Visualizing The Data

I then showed my students how to generate metrics of the data including a scatter plot. Since the R-squared value was 0.94 I could conclude that linear regression should work.

Using The Linear Regression Algorithm

Two models were trained by the small data set. The first one was the simple linear (y=mx+c) hypothesis function and the second was a hypothesis function containing higher-order polynomials. I wanted to do both since it appeared as though an exponential function might fit the data better than a simple linear one and since more models are better for comparison.


The last step of the experiment was to test both models using input values not present in the data set and then to compare the predicted clarity values to experimental data in order to get an idea of how accurate both models are. The first image below shows the prediction by the first linear model and the second image show the prediction by the second model of higher-order polynomials.


The end result of incorporating machine learning into my high school chemistry was better than I anticipated. The students were able to follow along, understanding the concepts to some degree. In addition, both models were able to predict the clarity of the Iodine solution – although I suspect that the second, high order polynomial model fit the data with more accuracy. I must add that incorporating machine learning into my chemistry class was not without its challenges since many students needed a lot of computer assistance. This class showed me that machine learning really is applicable in every area of life, even in a small classroom of 10 students studying high school chemistry at an American school in Taipei.

It is worth noting that more investigation is needed to ensure the best results.

* Since technology is continually developing, by the time you read this blog the products used may have changed.