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

Use fit options from base fitter #960

Conversation

bluemoo
Copy link
Contributor

@bluemoo bluemoo commented Feb 23, 2020

The MixtureCureFitter did not use the fit options of the base fitter. It should do so, so that it can take advantage of any necessary settings. The most obvious example of this is when the base_fitter=WeibullFitter - see new test for the rest.

@@ -4946,3 +4946,25 @@ def test_should_raise_exception_if_cure_parameter_is_already_in_list_of_paramete
" Try something else instead.",
):
MixtureCureFitter(MixtureCureFitter(base_fitter=ExponentialFitter()))

def test_should_get_same_values_as_custom_weibull_on_kidney_transplant_data_set(self):
Copy link
Owner

Choose a reason for hiding this comment

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

nice test!

@@ -82,6 +82,7 @@ def __init__(self, base_fitter, *args, **kwargs):

self._fitted_parameter_names = [self._CURED_FRACTION_PARAMETER_NAME] + base_fitter._fitted_parameter_names
self._bounds = [(0, 1)] + base_fitter._bounds
self._scipy_fit_options = base_fitter._scipy_fit_options
Copy link
Owner

Choose a reason for hiding this comment

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

make sense!

@CamDavidsonPilon
Copy link
Owner

CamDavidsonPilon commented Feb 23, 2020

Ignore the failing test, it's a config problem. Your test passes 👍

@CamDavidsonPilon CamDavidsonPilon merged commit c1b9c10 into CamDavidsonPilon:master Feb 23, 2020
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.

2 participants