Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
629 changes: 629 additions & 0 deletions notebooks/how_to/log_metrics_over_time.ipynb

Large diffs are not rendered by default.

Binary file added notebooks/images/add_metric_over_time_block.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/images/log_metric_accuracy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/images/log_metric_auc_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/images/log_metric_auc_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/images/log_metric_auc_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/images/log_metric_auc_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/images/log_metric_f1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/images/log_metric_precision.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/images/log_metric_recall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description = "ValidMind Library"
license = "Commercial License"
name = "validmind"
readme = "README.pypi.md"
version = "2.7.6"
version = "2.7.7"

[tool.poetry.dependencies]
aiohttp = {extras = ["speedups"], version = "*"}
Expand Down
2 changes: 1 addition & 1 deletion validmind/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.7.6"
__version__ = "2.7.7"
9 changes: 8 additions & 1 deletion validmind/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ async def alog_metric(
inputs: Optional[List[str]] = None,
params: Optional[Dict[str, Any]] = None,
recorded_at: Optional[str] = None,
thresholds: Optional[Dict[str, Any]] = None,
):
"""See log_metric for details"""
if not key or not isinstance(key, str):
Expand All @@ -421,6 +422,9 @@ async def alog_metric(
except (ValueError, TypeError):
raise ValueError("`value` must be a scalar (int or float)")

if thresholds is not None and not isinstance(thresholds, dict):
raise ValueError("`thresholds` must be a dictionary or None")

try:
return await _post(
"log_unit_metric",
Expand All @@ -431,6 +435,7 @@ async def alog_metric(
"inputs": inputs or [],
"params": params or {},
"recorded_at": recorded_at,
"thresholds": thresholds or {},
},
cls=NumpyEncoder,
allow_nan=False,
Expand All @@ -447,6 +452,7 @@ def log_metric(
inputs: Optional[List[str]] = None,
params: Optional[Dict[str, Any]] = None,
recorded_at: Optional[str] = None,
thresholds: Optional[Dict[str, Any]] = None,
):
"""Logs a unit metric

Expand All @@ -463,8 +469,9 @@ def log_metric(
params (dict, optional): Dictionary of parameters used to compute the metric.
recorded_at (str, optional): The timestamp of the metric. Server will use
current time if not provided.
thresholds (dict, optional): Dictionary of thresholds for the metric.
"""
run_async(alog_metric, key, value, inputs, params, recorded_at)
run_async(alog_metric, key, value, inputs, params, recorded_at, thresholds)


def get_ai_key() -> Dict[str, Any]:
Expand Down
Loading