title: Gradient Boosting with Sklearn
body: <p>I want to use Sklearn's GradientBoostingRegressor class to predict values for a target variable in a regression problem. The features I have are of mixed type - some are continuous numeric, some are boolean, two are categorical, and one is a vector of continuous numbers. I am choosing gradient boosting trees specifically because the data is of mixed data types. An example of a feature vector would be:</p>
  
  <p>['Category1', 41.93655, -87.642079, 0, 0, &lt;1x822 sparse matrix of type '' with 4 stored elements in Compressed Sparse Row format>, 'mobile_app', 'NA']</p>
  
  <p>However, when I try to train the GradientBoostingRegressor with fit(), I get an error saying:</p>
  
  <p>ValueError: could not convert string to float: Category1</p>
  
  <p>This feature's values are implemented with an enum. I just have a method:</p>
  
  <pre><code>def enum(self, **enums):
      return type('Enum', (), enums)
  </code></pre>
  
  <p>Then when I create my categories, I do it like this:</p>
  
  <pre><code>categories = self.enum(Category1='Category1', Category2='Category2', ...)
  </code></pre>
  
  <p>I guess the problem is that it is still returning the actual value as a string. But if I change the values to 0, 1, 2, etc, that would make some categories "closer" to others when they should be equidistant from all the other categories. </p>
  
  <p>So does this object <em>actually</em> handle data of mixed type or does it all have to be done numerically? If it has to be all numeric, has anyone who has handled categorical data with this object shed light on the best way to represent the categories? Any help is appreciated</p>