causica.graph.evaluation_metrics

Module Contents

Functions

adjacency_precision_recall(→ tuple[torch.Tensor, ...)

Evaluate the precision and recall of edge existence for two adjacency matrices.

adjacency_f1(→ torch.Tensor)

Evaluate the f1 score of edge existence for two adjacency matrices.

orientation_precision_recall(→ tuple[torch.Tensor, ...)

Evaluate the precision and recall of edge orientation for two adjacency matrices.

orientation_f1(→ torch.Tensor)

Evaluate the f1 score of edge existence for two adjacency matrices.

f1_score(→ torch.Tensor)

Calculate f1 score from precision and recall.

_to_vector(→ torch.Tensor)

Convert an adjacency matrix to a vector of length n(n-1)/2.

causica.graph.evaluation_metrics.adjacency_precision_recall(graph1: torch.Tensor, graph2: torch.Tensor) tuple[torch.Tensor, torch.Tensor][source]

Evaluate the precision and recall of edge existence for two adjacency matrices.

causica.graph.evaluation_metrics.adjacency_f1(graph1: torch.Tensor, graph2: torch.Tensor) torch.Tensor[source]

Evaluate the f1 score of edge existence for two adjacency matrices.

causica.graph.evaluation_metrics.orientation_precision_recall(graph1: torch.Tensor, graph2: torch.Tensor) tuple[torch.Tensor, torch.Tensor][source]

Evaluate the precision and recall of edge orientation for two adjacency matrices.

causica.graph.evaluation_metrics.orientation_f1(graph1: torch.Tensor, graph2: torch.Tensor) torch.Tensor[source]

Evaluate the f1 score of edge existence for two adjacency matrices.

causica.graph.evaluation_metrics.f1_score(precision: torch.Tensor, recall: torch.Tensor) torch.Tensor[source]

Calculate f1 score from precision and recall.

causica.graph.evaluation_metrics._to_vector(graph: torch.Tensor) torch.Tensor[source]

Convert an adjacency matrix to a vector of length n(n-1)/2.

There is a 0 for no edge, -1 or 1 for a single edge and 2 for both edges between a pair of nodes