Skip to content

RuleList says prediction=True but predict() function returns False #18

Description

@wolpl

I came across some weird bug making the predict() function return wrong predictions while the rule list is learned correctly. Why does this happen?

Code to reproduce

from corels import CorelsClassifier
import pandas as pd

x=pd.DataFrame([[1,0,0,0]]*200+[[0,1,0,0]]*200)
y=pd.Series([True]*390+[False]*10)

model=CorelsClassifier(verbosity=[])
model.fit(x,y)

print(model.rl())
print()
print(pd.value_counts(model.predict(x)))

Tested on Windows with pandas 1.0.5 (installed via conda) and corels 1.1.29 (installed via pip), and python 3.

Actual result

The code prints:

RULELIST:
prediction = True

False 400
dtype: int64

Apparently all predictions are False.

Expected result

The rule list is created as expected. The predictions are expected to be all True, just like the rule list states. The expected output consequently is:

RULELIST:
prediction = True

True 400
dtype: int64

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions