-
Notifications
You must be signed in to change notification settings - Fork 445
Expand file tree
/
Copy pathcoverage.py
More file actions
30 lines (20 loc) · 804 Bytes
/
coverage.py
File metadata and controls
30 lines (20 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from abc import ABC, abstractmethod
class Coverage(ABC):
"""``Coverage`` class measures how well a given test dataset tests the
given model.
This is an abstract base class for other ``Coverage`` classes.
"""
class ExtrinsicCoverage(Coverage):
"""Represents coverage methods that do not access the model that is subject
of testing to measure the quality of test set."""
@abstractmethod
def __call__(self, testset):
raise NotImplementedError()
class IntrinsicCoverage(Coverage):
"""Represents coverage methods that do access the model that is subject of
testing to measure the quality of test set."""
def __init__(self, model):
self.model = model
@abstractmethod
def __call__(self, testset):
raise NotImplementedError()