Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions Improvements.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,6 @@ remain open as of this writing.

## 2. Code duplication

- **`ontolearn/quality_funcs.py:31-56`** duplicates the tp/tn/fp/fn and
precision/recall math already implemented in `ontolearn/metrics.py:67-92`'s
`F1`/`Accuracy` classes. Have `quality_funcs.py` delegate to those classes
instead of reimplementing the arithmetic.
- **`ontolearn/learners/tree_learner_refinement_inherit.py` vs
`tree_learner.py`** — `TDL_refinement(TDL)` is ~70% copy-pasted rather than
extended. `fit()` (tree_learner_refinement_inherit.py:604-761) duplicates
`TDL.fit()` (tree_learner.py:661-736) almost line-for-line (grid search,
classifier training, `report_classification`, plotting) with only the
refinement loop spliced in; `extract_expressions_from_owl_individuals`,
`create_training_data`, and `_extract_data_property_features` are likewise
wholesale overrides. A template-method refactor — pulling
`_train_classifier`/`_report`/`_plot` into the base `TDL` as hooks — would
remove on the order of 300 duplicated lines. (`OCEL(CELOE)` in
`ontolearn/learners/celoe.py`/`ocel.py` is a good counter-example of doing
this inheritance correctly — worth using as the template.)
- **`ontolearn/knowledge_base.py:191-262`** — `abox()` repeats the same
triple-traversal ~70 lines of near-identical branching, once per
`mode in {"native", "iri", "axiom"}`, differing only in output formatting.
Expand Down
Loading