The best approach is to create your data set with all the functions, and in most cases itβs just fine to fill in the columns with zeros that are not available.
Using your example, this will be something like:
Total area Number of rooms Garage area 100 2 0 300 2 5 125 1 1.5
Often, the training algorithm that you have chosen would be powerful enough to use these zeros to correctly classify this record. In the end, the lack of value is more information for the algorithm. This can be a problem if your data is distorted, but in this case you still need to eliminate the asymmetry.
EDIT:
I just understand that there is another answer with a comment saying that you are afraid to use zeros, given the fact that it can be confused with small garages. Although I still do not see a problem with this (there should be enough difference between a small garage and zero), you can still use the same structure as a garage with non-viability with a negative number (let them say -1).
The solution indicated in another answer is also quite plausible, with an additional sign indicating whether the garage will be in the garage or not, will work fine (especially in decision tree-based algorithms). I just prefer to keep the data dimension as low as possible, but in the end it's more of a preference, but rather a technical solution.
Pedrom
source share