mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
parent
f7f3c02585
commit
57e2de2077
@ -82,6 +82,8 @@ class TestResult(dict):
|
|||||||
_quantiles = df[feedback_cols].quantile(
|
_quantiles = df[feedback_cols].quantile(
|
||||||
quantiles or [0.25, 0.5, 0.75], numeric_only=True
|
quantiles or [0.25, 0.5, 0.75], numeric_only=True
|
||||||
)
|
)
|
||||||
|
_quantiles.loc["mean"] = df[feedback_cols].mean()
|
||||||
|
_quantiles.loc["mode"] = df[feedback_cols].mode().iloc[0]
|
||||||
return _quantiles.transpose()
|
return _quantiles.transpose()
|
||||||
|
|
||||||
def to_dataframe(self) -> pd.DataFrame:
|
def to_dataframe(self) -> pd.DataFrame:
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Generic utility functions."""
|
"""Generic utility functions."""
|
||||||
import contextlib
|
import contextlib
|
||||||
import datetime
|
import datetime
|
||||||
|
import functools
|
||||||
import importlib
|
import importlib
|
||||||
import warnings
|
import warnings
|
||||||
from importlib.metadata import version
|
from importlib.metadata import version
|
||||||
@ -14,7 +15,8 @@ def xor_args(*arg_groups: Tuple[str, ...]) -> Callable:
|
|||||||
"""Validate specified keyword args are mutually exclusive."""
|
"""Validate specified keyword args are mutually exclusive."""
|
||||||
|
|
||||||
def decorator(func: Callable) -> Callable:
|
def decorator(func: Callable) -> Callable:
|
||||||
def wrapper(*args: Any, **kwargs: Any) -> Callable:
|
@functools.wraps(func)
|
||||||
|
def wrapper(*args: Any, **kwargs: Any) -> Any:
|
||||||
"""Validate exactly one arg in each group is not None."""
|
"""Validate exactly one arg in each group is not None."""
|
||||||
counts = [
|
counts = [
|
||||||
sum(1 for arg in arg_group if kwargs.get(arg) is not None)
|
sum(1 for arg in arg_group if kwargs.get(arg) is not None)
|
||||||
|
Loading…
Reference in New Issue
Block a user