Skip to content

[MRG] fix offset value in docstring of IsolationForest#10621

Merged
jnothman merged 1 commit intoscikit-learn:masterfrom
albertcthomas:offset_docstring
Feb 11, 2018
Merged

[MRG] fix offset value in docstring of IsolationForest#10621
jnothman merged 1 commit intoscikit-learn:masterfrom
albertcthomas:offset_docstring

Conversation

@albertcthomas
Copy link
Copy Markdown
Contributor

What does this implement/fix? Explain your changes.

When contamination is set to 'auto', offset_ is equal to -0.5 and not 0.5. The code is correct

        if self.contamination == "auto":
            # 0.5 plays a special role as described in the original paper.
            # we take the opposite as we consider the opposite of their score.
            self.offset_ = -0.5

but not the docstring

    offset_ : float
        Offset used to define the decision function from the raw scores.
        We have the relation: decision_function = score_samples - offset_.
        The offset is set to 0.5 as in the original paper

@agramfort
Copy link
Copy Markdown
Member

@ngoix ok for you?

@ngoix
Copy link
Copy Markdown
Contributor

ngoix commented Feb 11, 2018

Yes!

@ngoix
Copy link
Copy Markdown
Contributor

ngoix commented Feb 11, 2018

Thanks @albertcthomas

@jnothman jnothman merged commit da3ee54 into scikit-learn:master Feb 11, 2018
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.

4 participants