Skip to content
Snippets Groups Projects
Commit 2a187771 authored by AjUm-HEIDI's avatar AjUm-HEIDI
Browse files

Update with penalty values

parent 465963cf
No related branches found
No related tags found
No related merge requests found
......@@ -8,4 +8,3 @@ torchGeometricDatasets
tests/generatedGraphs
visualizations
evaluation_results
.env
\ No newline at end of file
......@@ -18,14 +18,14 @@ The script allows for running experiments on two types of datasets: structured a
First, create and activate a virtual environment:
```bash
# Create virtual environment
python -m venv venv
# Create virtual environment with .venv directory
python -m venv .venv
# Activate virtual environment
# On Windows
venv\Scripts\activate
.venv\Scripts\activate
# On Unix or MacOS
source venv/bin/activate
source .venv/bin/activate
```
### 2. Install Dependencies
......
......@@ -31,3 +31,4 @@ urllib3==2.2.2
yarl==1.9.4
python-dotenv==1.0.1
pytest==8.3.3
tabulate==0.9.0
\ No newline at end of file
......@@ -14,7 +14,7 @@ from ontolearn.metrics import Accuracy, Precision, Recall, F1
from pathlib import Path
def explain_gnn(model, dataset, datasetName, run_dir, add_node_type, high_level_concepts=None, create_high_level_concepts_as_boolean=True, selected_labels=None):
def explain_gnn(model, dataset, datasetName, run_dir, add_node_type, high_level_concepts=None, create_high_level_concepts_as_boolean=True, selected_labels=None, penalty=1):
"""Explain GNN predictions and store results in a CSV file."""
renderer = DLSyntaxObjectRenderer()
fileName = datasetName
......@@ -42,7 +42,7 @@ def explain_gnn(model, dataset, datasetName, run_dir, add_node_type, high_level_
for label in labels_to_evaluate:
# Generate explanations
hypotheses, explainer_model = explainer.explain(label, 5, max_runtime=90, num_generations=1000)
hypotheses, explainer_model = explainer.explain(label, 5, max_runtime=90, num_generations=1000, penalty=penalty)
# Best hypothesis
best_hypothesis = hypotheses[0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment