question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement scikit-learn compatibility

See original GitHub issue

It would be nice to be able to easily get posterior predictive distributions for arbitrary predictor values. The most obvious way to implement this would be to add a .predict() method to either the Model or ModelResults class. This would also bring the interface one little step closer to being scikit-learn-compatible, which is a separate goal that I think it would be nice to eventually achieve.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
aflaxmancommented, Nov 10, 2017

The recently revamped GaussianProcessRegression module in sklearn could be helpful inspiration. In addition to .predict, this class has a .sample_y method, which takes n_samples and random_state are arguments. https://github.com/scikit-learn/scikit-learn/blob/01e0639b15d515b446cb4589f01097b16fb4994a/sklearn/gaussian_process/gpr.py#L349

So fun to get to see your careful thinking about implementation!

1reaction
jake-westfallcommented, Nov 10, 2017

Just realized that having predict() wrap sample_ppc is exactly what you said you weren’t sure about :p

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scikit-learn compatibility — pyts 0.12.0 documentation
Scikit -learn provides a lot of utilities such as model selection and pipelines. These tools are often used in machine learning. By having...
Read more >
Developing scikit-learn estimators
The main motivation to make a class compatible to the scikit-learn estimator interface might be that you want to use it together with...
Read more >
Installing scikit-learn
Scikit -learn 0.20 was the last version to support Python 2.7 and Python 3.4. Scikit-learn 0.21 supported Python 3.5-3.7. Scikit-learn 0.22 supported Python...
Read more >
Related Projects — scikit-learn 1.2.0 documentation
Compatible with deep learning frameworks and scikit-learn API, it can stream minibatches, use data checkpoints, build funky pipelines, and serialize models ...
Read more >
Frequently Asked Questions — scikit-learn 1.2.0 documentation
You can implement your favorite algorithm in a scikit-learn compatible way, upload it to GitHub and let us know. We will be happy...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found