Skip to content

can you please share some simple, but meaningful toy example like pycorels #3

Description

@Sandy4321

can you please share some simple, but meaningful toy example like pycorels
to make sure it works
for example like
https://github.com/fingoldin/pycorels
Toy dataset (See picture example above)
from corels import CorelsClassifier

["loud", "samples"] is the most verbose setting possible
C = CorelsClassifier(max_card=2, c=0.0, verbosity=["loud", "samples"])

4 samples, 3 features
X = [[1, 0, 1], [0, 0, 0], [1, 1, 0], [0, 1, 0]]
y = [1, 0, 0, 1]

Feature names
features = ["Mac User", "Likes Pie", "Age < 20"]

Fit the model
C.fit(X, y, features=features, prediction_name="Has a dirty computer")

Print the resulting rulelist
print(C.rl())

Predict on the training set
print(C.predict(X))

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions