pycorels icon indicating copy to clipboard operation
pycorels copied to clipboard

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

Open wolpl opened this issue 4 years ago • 0 comments

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

wolpl avatar Aug 28 '20 07:08 wolpl