Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deal with feature vector of variable length?

Say you're trying to classify houses based on certain features:

  • Total area
  • Number of rooms
  • Garage area

But not all houses have garages. But when they do, their total area makes for a very discriminating feature. What's a good approach to leverage the information contained in this feature?

like image 629
jessems Avatar asked Mar 18 '13 10:03

jessems


1 Answers

You could incorporate a zero/one dummy variable indicating whether there is a garage, as well as the cross-product of the garage area with the dummy (for houses with no garage, set the area to zero).

like image 132
NPE Avatar answered Sep 28 '22 09:09

NPE