Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG + 1] FIX Include PyFuncDistance attributes while pickling. #4362

Merged
merged 3 commits into from May 22, 2015

Conversation

raghavrv
Copy link
Member

@raghavrv raghavrv commented Mar 9, 2015

fixes #4360

  • Include func and kwargs attributes during pickling
  • NRT

Pickle and include the dist_metric function. Not needed!

@raghavrv raghavrv changed the title FIX Include PyFuncDistance attributes while pickling. [WIP] FIX Include PyFuncDistance attributes while pickling. Mar 9, 2015
@GaelVaroquaux
Copy link
Member

The general idea looks good. This will need a test, of course :)

@raghavrv
Copy link
Member Author

raghavrv commented Mar 9, 2015

@GaelVaroquaux Thanks :) Have added the tests! Please take a look now!

Also @jakevdp could you take a look at this too pl?

@raghavrv raghavrv changed the title [WIP] FIX Include PyFuncDistance attributes while pickling. [MRG] FIX Include PyFuncDistance attributes while pickling. Mar 9, 2015

def check_pickle_protocol(protocol):
s = pickle.dumps(bt1, protocol=protocol)
bt2 = pickle.loads(s)

s_pyfunc = pickle.dumps(bt1_pyfunc, protocol=protocol)
bt2_pyfunc = pickle.loads(s_pyfunc)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did that fail on master?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! but this particular line will pass, querying alone will fail. (new line #+242)

@raghavrv raghavrv force-pushed the make_PyFuncDistance_picklable branch from e583cef to 2e982ce Compare March 18, 2015 20:44
@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) to 95.09% when pulling 2e982ce on ragv:make_PyFuncDistance_picklable into c4df19d on scikit-learn:master.

@raghavrv
Copy link
Member Author

@jakevdp @amueller @GaelVaroquaux Any update on this? :)

@raghavrv
Copy link
Member Author

Any news on this? :)

@raghavrv raghavrv force-pushed the make_PyFuncDistance_picklable branch from 2e982ce to dd043be Compare April 27, 2015 10:21
@amueller
Copy link
Member

LGTM

@amueller amueller changed the title [MRG] FIX Include PyFuncDistance attributes while pickling. [MRG + 1] FIX Include PyFuncDistance attributes while pickling. Apr 29, 2015
@raghavrv raghavrv force-pushed the make_PyFuncDistance_picklable branch 2 times, most recently from 0c3ae8c to d9284aa Compare May 3, 2015 19:04
@ogrisel
Copy link
Member

ogrisel commented May 22, 2015

LGTM as well. Merging.

ogrisel added a commit that referenced this pull request May 22, 2015
[MRG + 1] FIX Include PyFuncDistance attributes while pickling.
@ogrisel ogrisel merged commit 3af811e into scikit-learn:master May 22, 2015
@raghavrv raghavrv deleted the make_PyFuncDistance_picklable branch February 11, 2016 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to Serialize and Deserialize Model with customized distance function
5 participants