Skip to content

[MRG+2] MAINT Removing more deprecated stuff for v0.18#5528

Merged
jnothman merged 4 commits intoscikit-learn:masterfrom
raghavrv:more_deprecated_stuff
Aug 3, 2016
Merged

[MRG+2] MAINT Removing more deprecated stuff for v0.18#5528
jnothman merged 4 commits intoscikit-learn:masterfrom
raghavrv:more_deprecated_stuff

Conversation

@raghavrv
Copy link
Copy Markdown
Member

@raghavrv raghavrv commented Oct 22, 2015

Fully fixes #5434

  • fixed_vocabulary_
  • Remove support for precompute='auto' in ElasticNet
  • Remove support for loss='l2' in l1_min_c
  • Make all the old/new tests pass

@raghavrv raghavrv force-pushed the more_deprecated_stuff branch from c5f857a to a305c50 Compare October 23, 2015 13:06
@raghavrv raghavrv force-pushed the more_deprecated_stuff branch from a305c50 to f6bc5ca Compare November 12, 2015 14:26
@raghavrv raghavrv force-pushed the more_deprecated_stuff branch from f6bc5ca to c8ccad9 Compare April 12, 2016 14:07
@raghavrv raghavrv changed the title [WIP] MAINT Removing more deprecated stuff for v0.18 [MRG] MAINT Removing more deprecated stuff for v0.18 Apr 13, 2016
@raghavrv raghavrv force-pushed the more_deprecated_stuff branch 3 times, most recently from f95df96 to 656f1d3 Compare April 13, 2016 19:35
@raghavrv
Copy link
Copy Markdown
Member Author

Please review @amueller @ogrisel @MechCoder @TomDLT


@property
@deprecated("Attribute ``X_`` is deprecated in version 0.18 and will be"
" removed in version 0.20.")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

not this? (0.20?)

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.

Woooops. That is a bad blunder.

@raghavrv raghavrv force-pushed the more_deprecated_stuff branch 2 times, most recently from 1882cee to 7474eff Compare April 14, 2016 08:55
@TomDLT TomDLT changed the title [MRG] MAINT Removing more deprecated stuff for v0.18 [MRG+1] MAINT Removing more deprecated stuff for v0.18 Apr 14, 2016
@raghavrv raghavrv force-pushed the more_deprecated_stuff branch from 7474eff to ee6f4fa Compare April 20, 2016 11:59
@raghavrv
Copy link
Copy Markdown
Member Author

raghavrv commented Apr 20, 2016

Could someone confirm if the deletions/movements in the metrics' tests are correct? @larsmans @jnothman @agramfort ?

@raghavrv
Copy link
Copy Markdown
Member Author

@lesteve would you be able to take a look?

"slower even when n_samples > n_features. Hence "
"it will be removed in 0.18.",
DeprecationWarning, stacklevel=2)
raise ValueError("Precompute='auto' is not supported for "
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

precompute='auto' is still mentioned in the ElasticNet docstring above. You can probably remove it.

Copy link
Copy Markdown
Member

@ogrisel ogrisel Apr 20, 2016

Choose a reason for hiding this comment

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

Indeed the docstring of the class needs to be updated.

I think the error message should just be the following:

if (isinstance(self.precompute, six.string_types):
    raise TypeError('Expected precompute=True or precompute=False, got precompute=%r'
                    % precompute)

@raghavrv
Copy link
Copy Markdown
Member Author

@ogrisel @TomDLT @lesteve Have addressed all the comments. One final look at the metrics/tests/* please?

DeprecationWarning, stacklevel=2)
if isinstance(self.precompute, six.string_types):
raise ValueError('precompute should be one of True, False or'
' array-like. Got %s' % self.precompute)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

%r is slightly preferrable in this case because it will quote strings.

@raghavrv raghavrv force-pushed the more_deprecated_stuff branch 3 times, most recently from cecd6e3 to c02d004 Compare April 21, 2016 18:35
"jaccard_similarity_score", "unnormalized_jaccard_similarity_score",
"zero_one_loss", "unnormalized_zero_one_loss",

"precision_score", "recall_score", "f1_score", "f2_score", "f0.5_score",
Copy link
Copy Markdown
Contributor

@tguillemot tguillemot Apr 22, 2016

Choose a reason for hiding this comment

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

Sorry for the misunderstanding but why have you removed this line ?

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.

The precision_score is initiated with the default 'binary' averaging. Previously this was converted to 'weighted' for non-binary targets. Now that we are removing this behavior, this metric is not compatible with multilabel data.

So I'm removing it from this list to prevent it from getting tested with multilabel data.

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.

Ok thx

@raghavrv
Copy link
Copy Markdown
Member Author

I also have to edit this - http://scikit-learn.org/dev/modules/model_evaluation.html#from-binary-to-multiclass-and-multilabel

@raghavrv
Copy link
Copy Markdown
Member Author

@TomDLT I'm retaining your +1 anyway ;)

@tguillemot
Copy link
Copy Markdown
Contributor

LGTM too.

raise ValueError('The average is chosen as binary, but the '
'pos_label parameter is None')

if y_type == 'binary' and pos_label is not None and average is not None:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think what you want here is simply if y_type == 'binary' and average == 'binary' (i.e an else to the above ValueError case)

@jnothman jnothman added this to the 0.18 milestone Aug 3, 2016
@jnothman
Copy link
Copy Markdown
Member

jnothman commented Aug 3, 2016

@raghavrv, can we please split the non-P/R/F stuff out of this PR, so that it can be merged without discussion, then fix the P/R/F stuff with focus?

@raghavrv raghavrv force-pushed the more_deprecated_stuff branch from c02d004 to 2ece9bd Compare August 3, 2016 11:18
@raghavrv
Copy link
Copy Markdown
Member Author

raghavrv commented Aug 3, 2016

Done! review please ;)


# Precompute = 'auto' is not supported for ElasticNet
assert_raises_regex(ValueError, ".*should be.*True.*False.*array-like.*"
"Got 'auto'", ElasticNet(precompute='auto').fit, X, y)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not in the iterated list above?

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.

The error messages differ a bit. The previous case it should say that 'auto' is one of the valid options, in the current case it is not accepted anymore...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

okay.

@jnothman
Copy link
Copy Markdown
Member

jnothman commented Aug 3, 2016

otherwise, LGTM

@jnothman jnothman changed the title [MRG+1] MAINT Removing more deprecated stuff for v0.18 [MRG+2] MAINT Removing more deprecated stuff for v0.18 Aug 3, 2016
@jnothman jnothman merged commit 2a9492b into scikit-learn:master Aug 3, 2016
@jnothman
Copy link
Copy Markdown
Member

jnothman commented Aug 3, 2016

Thanks @raghavrv. Valuable work towards a release.

@raghavrv raghavrv deleted the more_deprecated_stuff branch August 3, 2016 12:16
@raghavrv
Copy link
Copy Markdown
Member Author

raghavrv commented Aug 3, 2016

Thanks for the review and merge!

TomDLT pushed a commit to TomDLT/scikit-learn that referenced this pull request Oct 3, 2016
* MNT Removing more deprecated stuff for v0.18

* MNT+TST Remove support for loss='l2'

* MNT Remove support for precompute='auto' for ElasticNet

* FIX/TST precompute=auto should raise a generic message
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.

Remove deprecated stuff that will no longer be supported by 0.18

6 participants