Skip to content

BUG: Fix MNLogit summary with float values - #5854

Merged
bashtage merged 1 commit into
statsmodels:masterfrom
bashtage:issue-3960
Jun 10, 2019
Merged

bashtage merged 1 commit into
statsmodels:masterfrom
bashtage:issue-3960

Conversation

@bashtage

@bashtage bashtage commented Jun 8, 2019

Copy link
Copy Markdown
Member

Ensure MNLogit summary works with float values

closes #3960

Comment thread statsmodels/discrete/discrete_model.py Outdated
issue_warning = False
msg = 'endog contains values are that not int-like. Uses string ' \
'representation of value.\nUse integer-valued endog to ' \
'suppress this warning.'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd suggest a) not putting the newline in there and letting the user's terminal handle it and b) wrapping the whole thing in parens instead of ending lines with backslashes. The latter is slightly because of personal preference, mostly because this finding this backslash usage is a decent heuristic for identifying code in need of attention.

@@ -4052,12 +4053,23 @@ def __init__(self, model, mlefit):

def _maybe_convert_ynames_int(self, ynames):
# see if they're integers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this method doesn't use self, doesn't need to be a method. could be collected with other name-standardizing utilities.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not going to do a major refactor to fix this one bug.

Ensure MNLogit summary works with float values

closes statsmodels#3960
@codecov

codecov Bot commented Jun 9, 2019

Copy link
Copy Markdown

Codecov Report

Merging #5854 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #5854      +/-   ##
=========================================
+ Coverage   82.45%   82.5%   +0.05%     
=========================================
  Files         597     597              
  Lines       94148   94162      +14     
  Branches     9667   10402     +735     
=========================================
+ Hits        77626   77693      +67     
+ Misses      14095   14053      -42     
+ Partials     2427    2416      -11
Impacted Files Coverage Δ
statsmodels/discrete/tests/test_discrete.py 99.32% <100%> (+0.6%) ⬆️
statsmodels/discrete/discrete_model.py 87.93% <100%> (+0.13%) ⬆️
statsmodels/sandbox/distributions/mv_normal.py 39.21% <0%> (ø) ⬆️
statsmodels/sandbox/stats/multicomp.py 40.6% <0%> (ø) ⬆️
statsmodels/sandbox/bspline.py 0% <0%> (ø) ⬆️
statsmodels/genmod/tests/test_glm.py 99.07% <0%> (+0.16%) ⬆️
statsmodels/regression/mixed_linear_model.py 90% <0%> (+0.17%) ⬆️
statsmodels/sandbox/stats/diagnostic.py 65.5% <0%> (+0.21%) ⬆️
statsmodels/graphics/regressionplots.py 81.62% <0%> (+0.23%) ⬆️
statsmodels/tsa/statespace/mlemodel.py 86.23% <0%> (+0.23%) ⬆️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 551671a...d2c9f46. Read the comment docs.

3 similar comments
@codecov

codecov Bot commented Jun 9, 2019

Copy link
Copy Markdown

Codecov Report

Merging #5854 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #5854      +/-   ##
=========================================
+ Coverage   82.45%   82.5%   +0.05%     
=========================================
  Files         597     597              
  Lines       94148   94162      +14     
  Branches     9667   10402     +735     
=========================================
+ Hits        77626   77693      +67     
+ Misses      14095   14053      -42     
+ Partials     2427    2416      -11
Impacted Files Coverage Δ
statsmodels/discrete/tests/test_discrete.py 99.32% <100%> (+0.6%) ⬆️
statsmodels/discrete/discrete_model.py 87.93% <100%> (+0.13%) ⬆️
statsmodels/sandbox/distributions/mv_normal.py 39.21% <0%> (ø) ⬆️
statsmodels/sandbox/stats/multicomp.py 40.6% <0%> (ø) ⬆️
statsmodels/sandbox/bspline.py 0% <0%> (ø) ⬆️
statsmodels/genmod/tests/test_glm.py 99.07% <0%> (+0.16%) ⬆️
statsmodels/regression/mixed_linear_model.py 90% <0%> (+0.17%) ⬆️
statsmodels/sandbox/stats/diagnostic.py 65.5% <0%> (+0.21%) ⬆️
statsmodels/graphics/regressionplots.py 81.62% <0%> (+0.23%) ⬆️
statsmodels/tsa/statespace/mlemodel.py 86.23% <0%> (+0.23%) ⬆️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 551671a...d2c9f46. Read the comment docs.

@codecov

codecov Bot commented Jun 9, 2019

Copy link
Copy Markdown

Codecov Report

Merging #5854 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #5854      +/-   ##
=========================================
+ Coverage   82.45%   82.5%   +0.05%     
=========================================
  Files         597     597              
  Lines       94148   94162      +14     
  Branches     9667   10402     +735     
=========================================
+ Hits        77626   77693      +67     
+ Misses      14095   14053      -42     
+ Partials     2427    2416      -11
Impacted Files Coverage Δ
statsmodels/discrete/tests/test_discrete.py 99.32% <100%> (+0.6%) ⬆️
statsmodels/discrete/discrete_model.py 87.93% <100%> (+0.13%) ⬆️
statsmodels/sandbox/distributions/mv_normal.py 39.21% <0%> (ø) ⬆️
statsmodels/sandbox/stats/multicomp.py 40.6% <0%> (ø) ⬆️
statsmodels/sandbox/bspline.py 0% <0%> (ø) ⬆️
statsmodels/genmod/tests/test_glm.py 99.07% <0%> (+0.16%) ⬆️
statsmodels/regression/mixed_linear_model.py 90% <0%> (+0.17%) ⬆️
statsmodels/sandbox/stats/diagnostic.py 65.5% <0%> (+0.21%) ⬆️
statsmodels/graphics/regressionplots.py 81.62% <0%> (+0.23%) ⬆️
statsmodels/tsa/statespace/mlemodel.py 86.23% <0%> (+0.23%) ⬆️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 551671a...d2c9f46. Read the comment docs.

@codecov

codecov Bot commented Jun 9, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #5854 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #5854      +/-   ##
=========================================
+ Coverage   82.45%   82.5%   +0.05%     
=========================================
  Files         597     597              
  Lines       94148   94162      +14     
  Branches     9667   10402     +735     
=========================================
+ Hits        77626   77693      +67     
+ Misses      14095   14053      -42     
+ Partials     2427    2416      -11
Impacted Files Coverage Δ
statsmodels/discrete/tests/test_discrete.py 99.32% <100%> (+0.6%) ⬆️
statsmodels/discrete/discrete_model.py 87.93% <100%> (+0.13%) ⬆️
statsmodels/sandbox/distributions/mv_normal.py 39.21% <0%> (ø) ⬆️
statsmodels/sandbox/stats/multicomp.py 40.6% <0%> (ø) ⬆️
statsmodels/sandbox/bspline.py 0% <0%> (ø) ⬆️
statsmodels/genmod/tests/test_glm.py 99.07% <0%> (+0.16%) ⬆️
statsmodels/regression/mixed_linear_model.py 90% <0%> (+0.17%) ⬆️
statsmodels/sandbox/stats/diagnostic.py 65.5% <0%> (+0.21%) ⬆️
statsmodels/graphics/regressionplots.py 81.62% <0%> (+0.23%) ⬆️
statsmodels/tsa/statespace/mlemodel.py 86.23% <0%> (+0.23%) ⬆️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 551671a...d2c9f46. Read the comment docs.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.005%) to 85.044% when pulling d2c9f46 on bashtage:issue-3960 into 551671a on statsmodels:master.

@jbrockmendel

Copy link
Copy Markdown
Contributor

LGTM

@bashtage
bashtage merged commit 45a58b5 into statsmodels:master Jun 10, 2019
@bashtage
bashtage deleted the issue-3960 branch June 10, 2019 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: mnlogit ynames fails with float endog

3 participants