Skip to content

PMStandardScaler fails when scale = 0 #124

@AtharvaKhare

Description

@AtharvaKhare

A relevant example:

x := PMMatrix rows: #(#(1 0) #(1 0) #(1 1) #(1 1)).
scaler := PMStandardizationScaler new.
scaler fit: x.
scaler scale. "0"
scaler transform: x. "ZeroDivideError"

Possible fix: add a "handleZeroScale" method which changes scale to 1 when it is 0.
Question: Can this be method be added in PMDataTransformer? If we add more scalers in future, all would need this message.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions