You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to use this package to derive very basic rules for one feature and one label.
It works well for more than one feature, but using only one feature, the output is empty.
I also tried with the iris dataset and the code looks like this:
from skrules import SkopeRules
dataset = load_iris()
feature_names = ['sepal_length']
clf = SkopeRules(max_depth_duplication=2,
n_estimators=30,
precision_min=0.3,
recall_min=0.1,
feature_names=feature_names)
for idx, species in enumerate(dataset.target_names):
X, y = dataset.data, dataset.target
clf.fit(X[::,0].reshape(-1, 1), y == idx)
rules = clf.rules_[0:3]
print("Rules for iris", species)
for rule in rules:
print(rule)
print()
print(20*'=')
print()```
The text was updated successfully, but these errors were encountered:
TKlerx
changed the title
No rules are generated
No rules are generated using single-feature dataset
Jun 2, 2019
Hey there,
I wanted to use this package to derive very basic rules for one feature and one label.
It works well for more than one feature, but using only one feature, the output is empty.
I also tried with the iris dataset and the code looks like this:
The text was updated successfully, but these errors were encountered: