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

Reduced chi squared #122

Merged
merged 27 commits into from
May 16, 2019
Merged

Reduced chi squared #122

merged 27 commits into from
May 16, 2019

Conversation

Catarina-Alves
Copy link
Collaborator

Solves #120, #91, #85 and part of #107 .

I also updated the docstring to reflect what chisq_over_datapoints is.

@tallamjr
Copy link
Collaborator

It seems the above build failed due to:

E       AttributeError: module 'snmachine.gps' has no attribute 'extract_GP'

in def test_gps_reduced_chi2() of test_gps_reduced_chi2.py.

Would this be fixed with a change from extract_GP --> compute_gps?

@Catarina-Alves
Copy link
Collaborator Author

It seems the above build failed due to:

E       AttributeError: module 'snmachine.gps' has no attribute 'extract_GP'

in def test_gps_reduced_chi2() of test_gps_reduced_chi2.py.

Would this be fixed with a change from extract_GP --> compute_gps?

Yes, I think it is fixed now.

@Catarina-Alves
Copy link
Collaborator Author

I need to raise an error in get_dict_chisq_over_datapoints_per_label if we don't have labels (eg test dataset).

snmachine/analysis.py Show resolved Hide resolved
snmachine/snfeatures.py Outdated Show resolved Hide resolved
snmachine/snfeatures.py Outdated Show resolved Hide resolved
snmachine/snfeatures.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@tallamjr tallamjr left a comment

Choose a reason for hiding this comment

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

Overall very good. I would say just address the comment from Michelle about raising an error for the case of no labels and that's it really.

In other places where I have asked small questions, no changes are actually required now in this PR.

Copy link
Collaborator

@tallamjr tallamjr left a comment

Choose a reason for hiding this comment

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

Looks good. I am re-running the Azure pipeline to ensure the CI tests are OK.

Then we will need to run some git commands to update the branch

@tallamjr
Copy link
Collaborator

tallamjr commented May 16, 2019

@Catarina-Alves Build 72 shows that the following function is expected by several tests in test/snfeatures_test.py for example:

d = <snmachine.sndata.Dataset object at 0x7f5b08bf9978>, sampler = 'leastsq'
use_redshift = False, nprocesses = 1

    def fit_templates(d, sampler='leastsq', use_redshift=False, nprocesses=1):
        temp_featz = snfeatures.TemplateFeatures(sampler=sampler)
        extr_features = temp_featz.extract_features(d, use_redshift=use_redshift,
                                                    nprocesses=nprocesses, seed=42)
        d.set_model(temp_featz.fit_sn, extr_features)
>       gof = temp_featz.goodness_of_fit(d)
E       AttributeError: 'TemplateFeatures' object has no attribute 'goodness_of_fit'
...

Which I guess was changes in 95a6fff.

Perhaps this just needs to call the new reduced chi^2 functionality instead?

@tallamjr tallamjr self-requested a review May 16, 2019 14:35
@tallamjr tallamjr force-pushed the reduced-chi-squared branch from 64c9bda to 31cdafe Compare May 16, 2019 16:25
@tallamjr tallamjr merged commit 6682baf into dev May 16, 2019
@tallamjr tallamjr deleted the reduced-chi-squared branch May 16, 2019 16:38
This was referenced May 20, 2019
tallamjr added a commit that referenced this pull request May 20, 2019
A [MINOR] version bump is required following the recent merged PR of #122
which changed variable names and functionality around use of Chi^2

In addition, PRs #130 and #118 would warrant a [PATCH] bump too.

Therefore, a bump from v1.2.0 to v1.3.2 was carried out
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.

3 participants