It’s been a while since I’ve updated the blog and this year I’m going to better about updating it.
In the meantime I’ve updated the entirety of the blog. Instead of using Jekyll I am now using Hugo and R to power the website. My website is no longer on Github, I have switched over to Netlify. I was having trouble getting the website to run on Github and Netlify proved to be far easier. The use of Hugo templates allows the blog to look alot better and more professional.
I made a iOS app that can detect if an image has a mushroom in it.
I followed Jameson Toole’s tutorial.
I built the model in Python using Turi Create. Unlike Keras or Pytorch, Turi Create does
most of the work for you. This allowed me to create a model quickly, however, I did
not get the control I would have gotten using Keras or the satisfaction of building the
model myself. One advantage of using Turi Create is that it, unlike Keras, allows
me to utilize the GPU of my Mac, however, because the model was so simple, it didn’t
take a long time to train on my CPU. It is also very easy to port the resulting model to Xcode.
I also used Vision and CoreML to convert it into an app.
This project was very simple and I hope to, in the future, build a more complex image classifier.
The app works pretty well and has a 95.7% accuracy.
Images of the app:
thumbnail and header photo by Slawek K on Unsplash
I have converted my Random Forest Algorithm into an iOS app using CoreML.
I used the random forest model and not the autocorrelation model because since I used sklearn
to create the random forest model it was far easier to convert it to the format required for the app.
I followed Brian Advent’s LinkedIn course, iOS App Development: Core ML, to convert my model.
I also followed Matt Mathias’ tutorial.
Using both of the courses it was still fairly difficult to build the app.
I was forced to restart Xcode multiple time because of the numerous bugs that I ran into.
Many times the app failed to run and when I searched the error I could not find any
solutions that didn’t require me to go into the files of the application.
Eventually, I got lucky and the app ran without any other problems. I still don’t know
what caused the initial errors.
This was my first programming in Swift and was difficult at first. Due to the fact that
I had to teach myself Swift from the ground up, the code is very convoluted and
it took me far longer than it should have.
In the end I was able to make a fully functioning app that predicted the weather in Memphis.
I have contemplated revamping the visuals of the app but I think I need to move on from this project.
A screenshot of the app:
I created a new random forest weather prediction model using Sklearn.
I used William Koehrsen’s tutorial to create the model.
The model can predict the maximum temperature in Memphis with a MAE of 4.44 and an accuracy of 92.72%.
I got the data from the National Centers for Environmental Information. I had to clean the data, fix some bugs, replace nans, encode the month and day, and get rid of unneeded columns.
The model requires the maximum temperature, precipitation, and minimum teperature of the previous day.
A random forest is a model that uses many decision trees to make a prediction.
The random forest is a good choice because of the amount of data it uses to come to a conclusion. This means that it is fairly accurate.
For tomorrow, which is June 19th 2018, the model predicts a maximum temperature of 90 degrees Fahrenheit.
My goal in the future is to convert this into an ios app using CoreML.
A smaller version of one the decision trees.
A comparison of my random forest model’s predictions, my autocorrelation model’s predictions, and the real temprature.
As shown in the graph the random forest model is much closer than the autocorrelation model which is predicting temperatures lower than the actual temperatures.
thumbnail and header photo by Asher Ward on Unsplash
I have made a weather prediction algorithm that predicts the maximum temprature in Memphis.
I did this by following Brandon Rohrer’s Udemy course End-to-end data science: Time-series prediction.
To predict the temprature I used the autocorrelation of one day’s temprature to the next to predict three days into the future.
Autocorrelation is when the data at a previous timesteps is useful for predicting at a future timestep.
The data had an Autocorrelation of .9, the data was from 1960 to 2018, and I got the data from www.ncdc.noaa.gov.
I had to prepare the data by getting rid of missing values, seperating the data into maximum temprature and dates, and fixing some other minor bugs.
In the end I achieved a Mean Absolute Error of 8.4. I’m planning to create a random forest model and turn it into an ios app using CoreML.
For the date of June 29, 2018 the algorithm predicts a temprature of 90.01 degrees fahrenheit.
Scatter plot of the autocorrelation
The scatter plot shows that we have a high autocorrelation from the day before to the next.
A plot of the maximum temperatures
This plot show the maximum temperatures from 1960 to 2018
In the future, I plan to improve this model and integrate it into a app.