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

Adds a getter which returns a copy of the inner model #79

Merged
merged 1 commit into from
Nov 4, 2020

Conversation

Craigacp
Copy link
Member

Description

LibLinear, LibSVM and XGBoost all have internal model representations which Tribuo hides. This PR adds an accessor which returns a deep copy of the trained models allowing users to use them outside of Tribuo.

Motivation

LibSVMModel has exposed the internal models for a while, this change makes it return an unmodifiable copy of the internal models (as the svm_model class is mutable for some reason). It then adds similar methods to LibLinearModel and XGBoostModel as it seems unfair to not allow it everywhere. We could further allow people to load in externally trained LibSVM and LibLinear models, and easily test it using this support, but it's not clear if there is need for such support at the moment.

Fixes #78.

… allow users to get a copy of the internal trained models.
@Craigacp Craigacp mentioned this pull request Nov 1, 2020
@jhalexand jhalexand merged commit f8a0e6c into main Nov 4, 2020
@Craigacp Craigacp deleted the adds-model-getters branch November 5, 2020 03:09
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.

Export Model
2 participants