sklearn-pandas icon indicating copy to clipboard operation
sklearn-pandas copied to clipboard

Add `feature_indices_` attribute to mapper

Open dukebody opened this issue 9 years ago • 0 comments

The attribute indicatesthe mapping between input and ouptut variables (see added docs). I'd like someone to give +1 before merging. :) @asford ?

Differences with implementation in https://github.com/paulgb/sklearn-pandas/pull/54:

  • Instead of storing self.feature_widths_ and calculating the self.feature_indices_ property on the fly, here I store self.feature_widths_ directly
  • The attribute is generated after the first transform, not after fitting. @asford implementation does fit and transform during the mapper fit. Since there is no reliable way to calculate the feature weights before applying the full transform, I prefer to leave the attribute unavailable until then. I don't know if it would be interesting to turn the attribute into a property to be able to raise a custom informative exception when some tries to access the attribute before transformation.

Thoughts?

dukebody avatar Mar 20 '16 12:03 dukebody