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={}
        )
print(model)

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

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.46.0.tar.gz (4.4 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: PyModelManager-0.46.0.tar.gz
  • Upload date:
  • Size: 4.4 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.46.0.tar.gz
Algorithm Hash digest
SHA256 ea34c153c6f6748c416cca93d17d4085445189a1f1da93ed506a1150daac2e36
MD5 0d08a40bf2e4405b26effb1ef4cc3046
BLAKE2b-256 f14579298bfcaf38cccf40e967615099069616bfbb665e6fd29148c22ab67b1f

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