{"action":"closed","issue":{"url":"https://api.github.com/repos/jpmml/sklearn2pmml/issues/70","repository_url":"https://api.github.com/repos/jpmml/sklearn2pmml","labels_url":"https://api.github.com/repos/jpmml/sklearn2pmml/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/jpmml/sklearn2pmml/issues/70/comments","events_url":"https://api.github.com/repos/jpmml/sklearn2pmml/issues/70/events","html_url":"https://github.com/jpmml/sklearn2pmml/issues/70","id":279830955,"number":70,"title":"Saving a Table Lookup Transformer in a PMML file","user":{"login":"pmontu33","id":8033248,"avatar_url":"https://avatars2.githubusercontent.com/u/8033248?v=4","gravatar_id":"","url":"https://api.github.com/users/pmontu33","html_url":"https://github.com/pmontu33","followers_url":"https://api.github.com/users/pmontu33/followers","following_url":"https://api.github.com/users/pmontu33/following{/other_user}","gists_url":"https://api.github.com/users/pmontu33/gists{/gist_id}","starred_url":"https://api.github.com/users/pmontu33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmontu33/subscriptions","organizations_url":"https://api.github.com/users/pmontu33/orgs","repos_url":"https://api.github.com/users/pmontu33/repos","events_url":"https://api.github.com/users/pmontu33/events{/privacy}","received_events_url":"https://api.github.com/users/pmontu33/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-12-06T17:01:27Z","updated_at":"2017-12-11T15:56:53Z","closed_at":"2017-12-11T15:56:53Z","author_association":"NONE","body":"I wish to save a custom transformer defined:\r\n\r\n```Python\r\nclass LookupTransformer(TransformerMixin):\r\n\r\n    def __init__(self, lookupfile, default_value=0.):\r\n        self.dict = defaultdict(\r\n            lambda: default_value,\r\n            pd.read_csv(lookupfile).set_index('A').to_dict()['B']\r\n        )\r\n\r\n    def fit(self, X, y=None):\r\n        return self\r\n\r\n    def transform(self, X):\r\n        return np.array(X.apply(lambda x: self.dict[x]))\r\n```\r\n\r\nIs it currently possible to do this?"}}
{"actor":{"display_login":"vruusmann"}}