{
  "id": 4273,
  "title": "get_params for the FeatureMapper",
  "url": "/competitions/cause-effect-pairs/discussion/4273",
  "author_name": "",
  "post_date": "2013-04-11T19:15:20.097Z",
  "votes": null,
  "comment_count": 4,
  "views": 1913,
  "content": "<p>This one is for the Hammer.</p>\r\n<p>I'm trying to setup GridSearchCV for the classifier pipeline that Ben has in his code. It's breaking when it tries to run a get_params method on the features.FeatureMapper class. I'm still pretty new to Python, so I'm not sure how get_params normally works\r\n as it's not explicit in the code for other things. How can I get FeatureMapper to pass nothing so that GridSearchCV ignores it?</p>",
  "messages": [
    {
      "id": "22649",
      "postDate": "04/11/2013 19:15:20",
      "content": "<p>This one is for the Hammer.</p>\r\n<p>I'm trying to setup GridSearchCV for the classifier pipeline that Ben has in his code. It's breaking when it tries to run a get_params method on the features.FeatureMapper class. I'm still pretty new to Python, so I'm not sure how get_params normally works\r\n as it's not explicit in the code for other things. How can I get FeatureMapper to pass nothing so that GridSearchCV ignores it?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "22674",
      "postDate": "04/12/2013 03:37:03",
      "content": "<p>Every pipeline stage must have get_params() method. Try defining this in features.py in FeatureMapper class.</p>\r\n<pre>def get_params(self, deep=True):\r\n   return dict()\r\n</pre>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "22714",
      "postDate": "04/12/2013 20:48:22",
      "content": "<p>Awesome, thanks!</p>\r\n<p>I had a method, and tried a half-dozen different things to return, but not a dict....</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "22851",
      "postDate": "04/15/2013 17:12:15",
      "content": "<p>One more thing. The default empty directory works when your constructor does not take any additional arguments. The default FeatureMapper class takes an extra 'features' argument and will fail while cloning the Pipeline. A solution will be to reture a dict()\r\n containing a 'features' key. Something like:</p>\r\n<pre>def get_params(self, deep=True):\r\n   return dict(features=self.features)\r\n</pre>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "26181",
      "postDate": "06/24/2013 17:00:16",
      "content": "<p>Hi, can you hint at a way I can use to view the selected features, please? I find it hard to view the actual computed features</p>\r\n<p>Thanks.</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 22674,
      "author_name": "sjuvekar",
      "author_url": "",
      "post_date": "04/12/2013 03:37:03",
      "content": "<p>Every pipeline stage must have get_params() method. Try defining this in features.py in FeatureMapper class.</p>\r\n<pre>def get_params(self, deep=True):\r\n   return dict()\r\n</pre>",
      "votes": null,
      "replies": []
    },
    {
      "id": 22714,
      "author_name": "kylecampbell",
      "author_url": "",
      "post_date": "04/12/2013 20:48:22",
      "content": "<p>Awesome, thanks!</p>\r\n<p>I had a method, and tried a half-dozen different things to return, but not a dict....</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 22851,
      "author_name": "sjuvekar",
      "author_url": "",
      "post_date": "04/15/2013 17:12:15",
      "content": "<p>One more thing. The default empty directory works when your constructor does not take any additional arguments. The default FeatureMapper class takes an extra 'features' argument and will fail while cloning the Pipeline. A solution will be to reture a dict()\r\n containing a 'features' key. Something like:</p>\r\n<pre>def get_params(self, deep=True):\r\n   return dict(features=self.features)\r\n</pre>",
      "votes": null,
      "replies": []
    },
    {
      "id": 26181,
      "author_name": "davminer",
      "author_url": "",
      "post_date": "06/24/2013 17:00:16",
      "content": "<p>Hi, can you hint at a way I can use to view the selected features, please? I find it hard to view the actual computed features</p>\r\n<p>Thanks.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "22649": "",
    "22674": "",
    "22714": "",
    "22851": "",
    "26181": ""
  },
  "source": "meta"
}