Skip to content

Commit 976cefa

Browse files
Update detector_api
1 parent dee7949 commit 976cefa

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

detector_api/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM python:3.10-slim
2-
LABEL author="Jaime Céspedes Sisniega <cespedes@ifca.unican.es>"
2+
LABEL author="Jaime Céspedes Sisniega <jaime.cespedes@alumnos.unican.es>"
33

44
ARG DATASET
55
ARG PARENT_DIR
@@ -15,7 +15,7 @@ RUN apt-get -y update && \
1515
rm requirements.txt
1616

1717
COPY ${PARENT_DIR}/app ./
18-
COPY ./ml/${DATASET}/detector.pkl ./objects/detector.pkl
18+
COPY ./ml/objects/${DATASET}/detector.pkl ./objects/detector.pkl
1919

2020
USER app
2121

detector_api/app/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
status_code=HTTP_200_OK,
2626
)
2727
async def check_drift(data: DetectorInputData) -> DistanceBasedResponse:
28-
"""Check if drift is present.
28+
"""Check if covariate drift is present.
2929
3030
:param data: input data
3131
:type data: DetectorInputData
32-
:return: drift data information
32+
:return: covariate drift data information
3333
:rtype: DistanceBasedResponse
3434
"""
35-
logging.info("Checking drift...")
35+
logging.info("Checking covariate drift...")
3636
check_drift_result = detector.check_drift(
3737
values=data.values,
3838
alpha=data.alpha,

detector_api/app/detector.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ class Detector(metaclass=SingletonMeta):
1818

1919
def __init__(self: "Detector", settings: DetectorSettings) -> None:
2020
"""Init method."""
21-
logging.info("Loading drift detector...")
21+
logging.info("Loading covariate drift detector...")
2222
self.detector = self.load(
2323
settings=settings,
2424
)
25-
logging.info("Drift detector loaded.")
25+
logging.info("Covariate drift detector loaded.")
2626

2727
def load(self: "Detector", settings: DetectorSettings) -> BaseDetector:
28-
"""Load drift detector.
28+
"""Load covariate drift detector.
2929
3030
:return detector
3131
:rtype: BaseDetector
@@ -46,13 +46,13 @@ def check_drift(
4646
values: np.ndarray,
4747
alpha: float = 0.05,
4848
) -> dict[str, Any]:
49-
"""Check if drift is present.
49+
"""Check if covariate drift is present.
5050
5151
:param values: input sample
5252
:type values: numpy.ndarray
5353
:param alpha: significance level, defaults to 0.05
5454
:type alpha: float, optional
55-
:return: drift data information
55+
:return: covariate drift data information
5656
:rtype: dict[str, Any]
5757
"""
5858
distance, callback_logs = self.detector.compare(

detector_api/app/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class APISettings(BaseSettings):
1212
"""
1313

1414
API_V1_STR: str = "/api/v1"
15-
PROJECT_NAME: str = "Data drift detection service"
15+
PROJECT_NAME: str = "Covariate drift detection service"
1616
VERSION: str = "1.0.0"
1717

1818

0 commit comments

Comments
 (0)