1) In Laurence Maroney’s video, What is ML, he compares traditional programming with machine learning and argues that the main difference between the two is a reorientation of the rules, data and answers. According to Maroney, what is the difference between traditional programming and machine learning?
- According to Maroney, in traditional programming, we make the rules and provide the data. We then feed those rules and the data to the code that we have written, and then we receive an answer. For example, say we want to convert the Celsius temperature to Fahrenheit temperature and vice versa. In traditional programming, we would write two functions that convert the temperature from Celsius to Fahrenheit. Then, we would take what the known temperature is in Celsius, pass that data to the function, and it returns an answer in degrees Fahrenheit. Say, however, that we have some temperature, but we do not know whether it is in Celsius or Fahrenheit. Well, here Maroney argues that we can use machine learning to identify the given degrees (Celsius or Fahrenheit), and with a certain degree of accuracy, predict the conversion. In a nutshell, instead of providing our code with the rules and the data as we would in traditional programming, in machine learning, we provide the program with answers and data, and our code actually identifies the rules.
2) With the first basic script that Maroney used to predict a value output from the model he estimated (he initially started with 10 that predicted ~31. Modify the predict function to produce the output for the value 7. Do this twice and provide both answers. Are they the same? Are they different? Why is this so?
- The first prediction is 22.000977 and the second prediction – after rerunning the model.fit(xs, ys, epochs = 500) code – is 22.000013. These answers are very close, but they are not the same. Considering that our model is given data that is in a straight line, using the equation y=3x+1, we would expect that our answer to be 22. Our neural network is able to pick up on this and recognize that there is a high degree of probability our data will continue in a straight line. However, the key word here is probability. Machine learning works in probability. While the likelihood our output will be 22 is very high, there is no way of knowing if the data will continue linearly. They are different answers because the model applies its best guess as to how the data will continue, but there remains some uncertainty. The different answers based on the same prediction reflect the characteristic of machine learning working based on probability.
3) Using the script you produced to predict housing price, take the provided six houses and train a neural net model that estimates the relationship between them. Based on this model, which of the six homes present a good deal? Which one is the worst deal? Justify your answer.
- Based on our model, we can determine the homes that offer a good deal by subtracting the actual cost from the predicted cost. In our interpretation of those results, we can suggest the if the difference is negative, that house costs less than the predicted cost, and therefore it would be a good deal. The homes that offered good deals by this definition are Hudgins, Mathews, Mobjack, and New Point Comfort. Out of these homes, the actual cost is most below the predicted cost for the Hudgins house. Therefore, when considering only the number of bedrooms in a house, compared to the six other houses we looked at, the Hudgins house offers the best deal. The houses whose actual cost was greater than the predicted cost were Moon and Church. The Church house was overpriced by nearly $100,000 US dollars, making it the worst deal based on its number of rooms when compared to these six other houses.