Skip to content

Commit

Permalink
test: calculate AP using marco average
Browse files Browse the repository at this point in the history
  • Loading branch information
xyg123 committed Mar 3, 2025
1 parent e25dedd commit d7a65f7
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/gentropy/method/l2g/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
roc_auc_score,
)
from sklearn.model_selection import GroupKFold, GroupShuffleSplit

from gentropy.dataset.l2g_feature_matrix import L2GFeatureMatrix
from gentropy.method.l2g.model import LocusToGeneModel
from wandb.data_types import Image, Table
from wandb.errors.term import termlog as wandb_termlog
from wandb.sdk.wandb_init import init as wandb_init
Expand All @@ -28,12 +31,10 @@
from wandb.sklearn import plot_classifier
from wandb.wandb_agent import agent as wandb_agent

from gentropy.dataset.l2g_feature_matrix import L2GFeatureMatrix
from gentropy.method.l2g.model import LocusToGeneModel

if TYPE_CHECKING:
from matplotlib.axes._axes import Axes
from shap._explanation import Explanation

from wandb.sdk.wandb_run import Run


Expand Down Expand Up @@ -236,11 +237,7 @@ def log_to_wandb(
}
)
self.run.log(
{
"averagePrecision": average_precision_score(
self.y_test, y_predicted, average="weighted"
)
}
{"averagePrecision": average_precision_score(self.y_test, y_predicted)}
)
self.run.log(
{
Expand Down

0 comments on commit d7a65f7

Please sign in to comment.