Skip to main content

ModelManager API

Project description

PyModelManager

PyModelManager это Python библиотека для взаимодействия с ModelManager API.

Установка

$ pip install PyModelManager

Пример использования

from modelmanager import ModelManager

# Сначала создаем экземпляр ModelManager
mm = ModelManager(base_url='http://{hostname}/api', login='{login}', password='{password}')

# Получим список проектов
projects = mm.get_projects()

# Получим все существующие версии моделей всех проектов
models = [project.get_models() for project in projects]

# Выводим в stdout все модели
for model in models:
    print(model)

# Получим реестр признаков
registry = mm.get_feature_registry()

# Получим список всех признаков
features = registry.all()

# Выводим в stdout все признаки
for feature in features:
    print('Feature: %s, %s' % (feature.name, feature.description))
    
# Создадим в реестре новый признак
feature = registry.create('birthday', "Дата рождения в формате 'yyyy-mm-dd'")

# Изменим признак
feature.description = "Дата рождения в формате 'yyyy.mm.dd"
feature.update()

# Удалим признак
registry.delete(feature)

# Создадим модель описание модели
model = project.create_model(
            author='RAffghi',
            name='Africa Economic, Banking and Systemic Crisis',
            title='Africa Economic, Banking and Systemic Crisis',
            description='Africa Economic, Banking and Systemic Crisis : A Logistic Regression Model Approch',
            algorithm='LogisticRegression',
            label='no_crisis',
            features=[feature(name) for name in ['case', 'cc3', 'country', 'year', 'systemic_crisis', 'exch_usd',
             'domestic_debt_in_default', 'sovereign_external_debt_default',
             'gdp_weighted_default', 'inflation_annual_cpi', 'independence',
             'currency_crises', 'inflation_crises', 'banking_crisis']],
            characteristics={}
        )

# Удаление модели
model.delete()

# Загрузка бинарного файла модели
file = '/your/model/file/path'
model.upload(file)

# Скачивание бинарного фала модели
bytes = model.download()

Документация

TBD

Как собрать пакет

python3 setup.py sdist
python3 -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyModelManager-0.47.0.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file PyModelManager-0.47.0.tar.gz.

File metadata

  • Download URL: PyModelManager-0.47.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

File hashes

Hashes for PyModelManager-0.47.0.tar.gz
Algorithm Hash digest
SHA256 4fedfb5a456dc98d90550cbd50dc3b24b9cbf24a6e983c67ce254229575e674a
MD5 173748ec9d1436dcd6603a7668b742ed
BLAKE2b-256 9c503061c253dbb27c2675119d2b2645448a93db633fab5a12d3c43a813a8b01

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page