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.

pycaret object oriented interface and contraction

See original GitHub issue

@ngupta23, after playing around with pycaret a bit, I would suggest we adopt an object oriented interface between the two packages. Let me know what you think.

Currently, pycaret can use sktime estimators, but what would be really great if:

  • it can export fitted and “blueprint” estimators after the “easy user workflow” is run
  • it can reference “stock” estimators like detrend/deseaslonalize/something which is currently used as a list of defaults

What I would find useful here is work on two things:

  • the described export functionality
  • a “contraction” operation: this is a function contraction where you pass a composite estimator, e.g., Pipeline(("step1", Deseasonalize(sp=12)), ("step2", ARIMA(p=4, d=3, q=2))). The output is a class which behaves like an sktime forecaster (or estimator of the same type). Paramters of the contracted composite are mapped onto parameters of the class. In contract you can choose which parameters are visible/exposed, and which are not. Defaults are set to the settings of the argument.

For instance,

contraction(
    Pipeline(("step1", Deseasonalize(sp=12)), ("step2", ARIMA(p=4, d=3, q=2))),
    param_expose = ["step2__p", "step2__d"]
    )

would give an estimator class which has parameters sp and q, their defaults being 12 and 2. The parameters p and d are not visible in that class, but the internal behaviour has these set to 4 and 3.

This way, you can define your pycaret default forecasters as shorthands PycaretForecaster1, PycaretForecaster2 or whatever you like, and plugging them as defaults into the workflow should be much more convenient.

With the sktime machinery, we can also easily adopt this for scikit-learn native estimators, so it would not just be restricted to forecasting.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ngupta23commented, Jul 5, 2021

Actually, I mean this for the hard-coded pipelines that come with pycaret. That would give you an easy option to “fix” the pycaret curated pipelines to easily usable shorthands.

But the idea also extends to users, if they have their “favourite” pipelines for their deployment use cases.

Yes, I was thinking more of the lines of what @mloning did for the M4 benchmarking where he created various combinations of pipelines. There is no way we can include all possible combinations of model pipelines in pycaret. So we need to provide additional flexibility for users to provide their own pipeline.

We will eventually also move these internal model pipelines into its own dedicated package so that after deployment, the exported models can be used without installing the heavy pycaret package (would just need sktime and the lightweight model package).

Let’s discuss in the combined design session.

@Yard1 @pycaret

0reactions
fkiralycommented, Jul 5, 2021

We will eventually also move these internal model pipelines into its own dedicated package so that after deployment, the exported models can be used without installing the heavy pycaret package (would just need sktime and the lightweight model package).

Excellent idea!

I think mlr and mlj follow similar models, but not sure how precisely this would look like for sktime, so looking forward to the discussion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Announcing PyCaret's New Time Series Module | by Moez Ali
It is an end-to-end machine learning and model management tool that speeds up the experiment cycle exponentially and makes you more productive.
Read more >
PyCaret: Home
PyCaret is a simple, easy to learn, low-code machine learning library in Python. With PyCaret, you spend less time coding and more time...
Read more >
tests refactor: move default parameter settings into concrete ...
Now, all there is to do is to move the defaults from the tests/_config file into the individual estimator's get_testing_params . PRs are ......
Read more >
A Complete Guide to PyCaret!!!. What is PyCaret ... - INSAID
PyCaret is an open-source low-code machine learning library in Python that aims to reduce the time needed for experimenting with different machine learning ......
Read more >
Machine learning of microvolt-level 12-lead electrocardiogram ...
The diagnosis of TTS was based on Mayo's criteria,1 and other diseases ... Eleven ML models were built using PyCaret, an open-source wrapper ......
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