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
Sorry for missing this issue, somehow I had my notification turned off! The problem is indeed my mistake of forgetting to update the README.md. I now replaced the example inside of the README.md with the example from the docs and this should work. Could you test that? Let me know if there are any remaining problems!
The new example should be:
fromgroot.modelimportGrootTreeClassifierfromgroot.toolboximportModelfromsklearn.datasetsimportmake_moons# Load the datasetX, y=make_moons(noise=0.3, random_state=0)
X_test, y_test=make_moons(noise=0.3, random_state=1)
# Define the attacker's capabilities (L-inf norm radius 0.3)epsilon=0.3attack_model= [epsilon, epsilon]
# Create and fit a GROOT treetree=GrootTreeClassifier(
attack_model=attack_model,
random_state=0
)
tree.fit(X, y)
# Determine the accuracy and accuracy against attackersaccuracy=tree.score(X_test, y_test)
model=Model.from_groot(tree)
adversarial_accuracy=model.adversarial_accuracy(X_test, y_test, attack="tree", epsilon=0.3)
print("Accuracy:", accuracy)
print("Adversarial Accuracy:", adversarial_accuracy)
Running the example code on the make moons data in the README I get:
Leaving out the argument and having this line instead:
tree = GrootTreeClassifier(attack_model=attack_model, random_state=0)
results in this error:
I'm guessing the code got an update, but the readme didn't. Or I made a stupid mistake, also very possible.
The text was updated successfully, but these errors were encountered: