compileml.select

make_partitions

def make_partitions(y, *, method: str = 'stratified', fractions=(0.6, 0.2, 0.2), date=None, group=None, explicit: dict | None = None, seed: int = 42) -> compileml.select.Partitions

from compileml.select import make_partitions

Split rows into Fit, Select and Report.

- method="stratified" (default): stratified on the label. - date: Report is the latest slice by date; Fit and Select are split within the earlier period. - group: split by group so one applicant lands in one partition. Not stratified, which the method name records. - explicit: {"fit": idx, "select": idx, "report": idx}, checked for disjointness.

Parameters#

NameTypeDefaultKind
y—requiredpositional
methodstr'stratified'keyword-only
fractions—(0.6, 0.2, 0.2)keyword-only
date—Nonekeyword-only
group—Nonekeyword-only
explicitdict | NoneNonekeyword-only
seedint42keyword-only

Returns#

compileml.select.Partitions

Raises#

  • ValueError

Read from the function body and the private helpers it calls, not inferred. A function that raises nothing has no section here.