Feb 3 Informal Exercise Response:

Jacinta Das

Question 1: In Laurence Moroney’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 Moroney, what is the difference between traditional programming and machine learning?

Moroney thinks of programming as a configuration of data, rules, and answers. He describes traditional programming as the inputting of data and rules and the output is the answers. In traditional programming, programmers are generally responsible for determining the rules through the code, which output answers based on the data. Machine learning is relevant when there are lots of data and answers but no rules. Machine learning takes in the data and answers and outputs the rules, so that people can better understand and predict.

Question 2: With the first basic script that Moroney 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?

When using a model to predict an output for the value 7, I get the same output (21.997128) both times I ran the line of code. However, if I rerun the model although the predictions for 7 are still equal to each other for this model, they are different (although very close to) from the predictions from before. This is interesting to note. Perhaps once the neural network model is compiled, it will give the same output for every input. However, every time a new neural network is created, although it may be trained on the exact same data set, it will give a slightly different output when given the same input as another model because the rules it has defined for the given data are slightly different.

Question 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?

The model that prediced price based on number of rooms predicted that a 2-bedroom house would cost about 180k, a 3-bedroom house would cost about 240k, a 4-bedroom house would cost about 298k, and a 5-bedroom house would cost about 360k. According to this model, the house on Holly Point Road (97k) is a great deal, especially when compared with 4403 New Point Comfort Highway, which also has 3 bedrooms but costs 229k. The house at 228 Church Street would also be considered expensive, costing 399k compared to the model’s prediction of 298k for a 3-bedroom house. The 5-bedroom house at 760 New Point Comfort Road, which costs nearly 350k, is actually not overpriced according to the model, which predicts a 5-bedroom house’s cost as 358k. The 2-bedroom house (Moon) appears to be overpriced, costing 229k compared with the 180k predicted by the model as an appropriate price.

The model that predicted price based on the number of bathrooms predicted that a 3-bathroom house would cost 400k, a 2-bathroom house would cost 290k, and a 1-bathroom house would cost 170k. According to this model, 760 New Point Comfort Highway is expensive, costing 347.5k compared with the 290k the model prices 2-bathroom houses at. The house at Holly Point Road would once again be considered a good deal, costing significantly less than the price of 170k.

The model that predicted price based on square footage predicted that a house with about 3700 square feet would cost about 360k, a house with 1300 square feet would cost about 155k, a house with 3100 square feet would cost about 307k, a house with 3500 square feet would cost about 341k, a house with about 1500 square feet would cost about 172k, and a house with about 2800 square feet would cost about 282k. According to these numbers, the house on Church Street is once again considered expensive, costing nearly 400k despite the model’s prediction for its square footage equaling about 358k. The Holly Point Road house is a great deal, costing 97k, significantly less than the model prediction of 155k for 1300 square feet. The house at 4403 New Point Comfort Highway, which costs about 229k, is also a good deal compared to the model’s predicted price of 282k. The houses at 760 New Point Comfort Highway, 6138 East River Road, and the Moon house are expensive compared with model prediction prices.

Overall, it seems that the house at Holly Point Road is a great deal with respect to number of bedrooms and bathrooms as well as square footage. The house at Church Street is probably the worst deal, except when taking into account the number of bathrooms.