seqgra.comparator.prcomparator module¶
Creates PR curves of different models
- Classes:
PRComparator
: creates PR curves from various grammars and architectures
- class PRComparator(analysis_id: str, output_dir: str, model_labels: Optional[List[str]] = None, silent: bool = False)[source]¶
Bases:
seqgra.comparator.comparator.Comparator
- compare_models(grammar_ids: Optional[List[str]] = None, model_ids: Optional[List[str]] = None, set_names: Optional[List[str]] = None) → None[source]¶
- create_precision_recall_curve(precision: List[List[float]], recall: List[List[float]], pr_auc: List[float], model_labels: List[str], file_name: str) → None[source]¶
- create_single_precision_recall_curve(y_true, y_hat) → None[source]¶
Create precision-recall curve.
Plots PR curves for each class label, including micro-average and iso-F1 curves. Saves plot as PDF in file_name.
- Parameters
y_true (array) – TODO ; shape = [n_samples, n_classes]
y_hat (array) – TODO ; shape = [n_samples, n_classes]
- get_labels(grammar_id: str, model_id: str, set_name: str) → int¶