Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 1
    $\begingroup$ What is the function of the abs in the code above? Won't the flipping of the labels be equally as random without abs? $\endgroup$ Commented May 18, 2020 at 11:56
  • 1
    $\begingroup$ @MatthewBrett in this case I think the idea is to precisely control which data points lie on which side of 0. My intuition is that if you randomly flip the signs but the signs aren't already evenly distributed, you might not get as good of a result. $\endgroup$ Commented Sep 2, 2022 at 14:36