- Hands-On Neural Networks with Keras
- Niloy Purkait
- 297字
- 2025-04-04 14:37:33
Predicting continuous variables
So far, we have performed two classification tasks using neural networks. For our first task, we classified handwritten digits. For our second task, we classified sentiments in movie reviews. But what if we wanted to predict a continuous value instead of a categorical value? What if we wanted to predict how likely an event may occur, or the future price of a given object? For such a task, examples such as predicting prices in a given market may come to mind. Hence, we will conclude this chapter by coding another simple feedforward network by using the Boston Housing Prices dataset.
This dataset resembles most real-world datasets that data scientists and machine learning practitioners would come across. You are given 13 features that refer to a specific geographical area located in Boston. With these features, the task at hand is to predict the median price of houses. The features themselves include various indicators ranging from residential and industrial activity, level of toxic chemicals in the air, property tax, access to education, and other socio-economic indicators that are associated with location. The data was collected during the mid-1970s, and seems to have brought along some bias from the time. You will notice that some features seem very nuanced and perhaps even inappropriate. Features such as feature number 12 can be very controversial to use in machine learning projects. You must always consider the higher-level implications when using a certain source or type of data. It is your duty as a machine learning practitioner to ensure that your model does not introduce or reinforce any sort of societal bias, or contribute in any way to disparities and discomfort for people. Remember, we are in the business of using technology to alleviate human burden, not add to it.