Skip to content

DownsamplingModel leaves DataFrame in sorted order by class label #18

Description

@jconwell

When the primary and secondary DataFrames get union'd together, the output DataFrame's rows are grouped together by class label.

Before you build any models you want to make sure the rows get randomly shuffled so as to not introduce any artificial bias into the model.

You can address this in the DownsamplingModel by doing an orderBy function after the union operation, like so:

primary.union(secondary).orderBy(rand(42))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions