Skip to content

[Question] restriction of y_max #1657

Closed
@ftmtas212

Description

@ftmtas212

Short Question Description

A clear single sentence question we can try to help with?

In the predict() of Class SimpleRegressionPipeline, there are restrictions on the min/max values of y.

def predict(self, X, batch_size=None):
    y = super().predict(X, batch_size=batch_size)
    y[y > (2 * self.y_max_)] = 2 * self.y_max_
    if self.y_min_ < 0:
        y[y < (2 * self.y_min_)] = 2 * self.y_min_
    elif self.y_min_ > 0:
        y[y < (0.5 * self.y_min_)] = 0.5 * self.y_min_
    return y

My question is should we also consider y_max < 0 like y_min?

def predict(self, X, batch_size=None):
    y = super().predict(X, batch_size=batch_size)
    if self.y_max > 0:
        y[y > (2 * self.y_max_)] = 2 * self.y_max_
    elif self.y_max < 0:
        y[y > (0.5 * self.y_max_)] = 0.5 * self.y_max_
    if self.y_min_ < 0:
        y[y < (2 * self.y_min_)] = 2 * self.y_min_
    elif self.y_min_ > 0:
        y[y < (0.5 * self.y_min_)] = 0.5 * self.y_min_
    return y

If I have missed anything, please let me know.
Many thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions