SIENTIAPDE-1255: Integrate sientia-mlops-library into model-manager, adding model serving, reporting, and updated model definitions.

This commit is contained in:
Bruno Domingues
2025-10-20 16:55:52 -03:00
parent 9e31ab679b
commit 56a21a16da
12 changed files with 998 additions and 22 deletions

View File

@@ -0,0 +1,36 @@
from typing import Any
from numpy.typing import ArrayLike
from sklearn.model_selection import train_test_split
def split_train_test(
*data: Any,
test_size: float | None = None,
train_size: float | None = None,
random_state: int | None = None,
shuffle: bool = True,
stratify: ArrayLike | None = None,
) -> tuple[Any, Any, Any, Any]:
"""
Split arrays or matrices into random train and test subsets.
Args:
*data: data to be splitted.
test_size: size of test subset.
train_size: size of train subset.
random_state: Seed applied to the data before applying the split.
shuffle: Whether or not to shuffle the data before splitting.
stratify: If not None, data is split in a stratified fashion, using this as the class labels.
Returns:
X_train, X_test, y_train, y_test
"""
X_train, X_test, y_train, y_test = train_test_split(
*data,
test_size=test_size,
train_size=train_size,
random_state=random_state,
shuffle=shuffle,
stratify=stratify,
)
return X_train, X_test, y_train, y_test