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

Add VAMP, CKTests (MSM and VAMP) #25

Merged
merged 31 commits into from Sep 24, 2019
Merged

Conversation

marscher
Copy link
Collaborator

@marscher marscher commented Sep 10, 2019

This adds VAMP estimator/model and the infrastructure for lagged model validation (cktests).

During the path of getting the stuff to work, I noticed that calling fit on an estimator has unexpected side effects. That is why we need to take a copy of it in LaggedModelValidator. The factory pattern however should make the need for this copy unnecessary, but because we encapsulate the current model instance, we can not work around this.
@clonker do you think it would be sane to call _create_model upon fit() to avoid this kind of hassle? How would we enforce this behavior without interfering with overridden fit methods?

@marscher
Copy link
Collaborator Author

https://stackoverflow.com/a/34225828/3086470 there are some patterns, as well as design considerations.

@marscher
Copy link
Collaborator Author

the test failure in kmeans is totally unrelated and surprising!

@clonker
Copy link
Member

clonker commented Sep 14, 2019

well it is a randomized test 🤷‍♂️ and it just checks whether the callback was invoked twice.. couldve converged after one iteration?

@clonker
Copy link
Member

clonker commented Sep 14, 2019

Would it help to always yield a copy when calling fetch_model?

@marscher
Copy link
Collaborator Author

marscher commented Sep 16, 2019 via email

@clonker
Copy link
Member

clonker commented Sep 16, 2019

It would cure the symptoms, but I thought we decided against it in the beginning, since copying is a heavy (memory) operation and unexpected at this point.

Symptoms implying there is a deeper underlying issue? To be fair I don't think it is very heavy in terms of memory since there is no data attached to models, just statistics. Also isn't it rather unexpected that a factory returns references?

@marscher
Copy link
Collaborator Author

I'll add the default copy then, but it also involves enforcing implementations of fetch_model to do the copy. I think it would be much clearer, that a fit() should produce a new instance.

@marscher
Copy link
Collaborator Author

Creating the instance prior invocations of fit is rather easy to do, minimal invasive, because people should derive from Estimator in any case. There is a note in the doc string quoting this behavior and we can also put it in the developer docs at some point.

@clonker
Copy link
Member

clonker commented Sep 17, 2019

Sounds good to me in principle, but is that compatible with partial fit? I just suggested fetch_model because of that.

@marscher
Copy link
Collaborator Author

The default Estimator constructor checks for this case and creates the model if partial_fit is implemented.

Copy link
Member

@clonker clonker left a comment

Choose a reason for hiding this comment

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

very nitpicky probably 😇

sktime/base.py Show resolved Hide resolved
sktime/base.py Show resolved Hide resolved
sktime/decomposition/tica.py Show resolved Hide resolved
sktime/decomposition/vamp.py Show resolved Hide resolved
sktime/lagged_model_validator.py Outdated Show resolved Hide resolved
sktime/lagged_model_validator.py Show resolved Hide resolved
sktime/lagged_model_validator.py Outdated Show resolved Hide resolved
sktime/lagged_model_validator.py Outdated Show resolved Hide resolved
sktime/lagged_model_validator.py Outdated Show resolved Hide resolved
sktime/numeric/__init__.py Outdated Show resolved Hide resolved
@clonker: I'd be happy, if you could explain the deviation in msm cktest... I couldn't spot it :(
@marscher marscher changed the title Add vamp Add VAMP, CKTests (MSM and VAMP) Sep 24, 2019
@marscher
Copy link
Collaborator Author

@clonker figured it out by myself. Thanks for the rigorous review, it was very helpful!

@marscher marscher merged commit 071108c into deeptime-ml:master Sep 24, 2019
@marscher marscher deleted the add_vamp branch September 24, 2019 16:37
@clonker
Copy link
Member

clonker commented Sep 24, 2019

sweet! what was it in the end?

@marscher
Copy link
Collaborator Author

marscher commented Sep 24, 2019 via email

@clonker
Copy link
Member

clonker commented Sep 24, 2019

yeah indexing issues are nasty.. nice!

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.

None yet

2 participants