Skip to content

FLYAI4/mlops-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MLOps Utils

mlops-utils is a collection of tools for managing MLOps infrastructure.


Installation

Install using via PyPi

pip install mlops-utils

Requirements

Python 3.10 or higher is required. For automatic tracking in PyTorch logging, versions between 1.9.0 and 2.1.1 (inclusive) are supported


Documentation

Documentation will be added soon. Stay tuned for updates!

Example

import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline
from mlops_utils.mlflow_logger.sklearn import Sklearn

# URL 주소 변경
sklearn = Sklearn("{url}", 5000)
experiment_name = "minjun_researcher"
run_name = "20240116-sklearn"


@sklearn.logger(experiment_name, run_name)
def ml_run():
    noise = np.random.rand(100, 1)
    X = sorted(10 * np.random.rand(100, 1)) + noise
    y = sorted(10 * np.random.rand(100))

    X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.1)
    pipe = Pipeline([("scaler", StandardScaler()), ("lr", LinearRegression())])
    pipe.fit(X_train, y_train)
    preds = pipe.predict(X_test)
    print(preds)

    sklearn.post_board(y_test, preds)

ml_run()

About

mlops-utils : MLFlow, Airflow 등 mlops 인프라 활용을 위한 utils 모듈

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages