Uploading an Estimator

From Web-App

You can easily load an estimator using the web app.

You will first need to select a CatalogTag, Algorithm and Model.

Use the load button in the Algorithm section of the sidebar and the use the control panel to provide a name, model and set any parameter overrides.

The currently selected Algorithm, Model and CatalogTag will be associated with the Estimator.

From python on client side

rail_pz_service.client.load.PZRailLoadClient.estimator(self, **kwargs)

Load a Estimator into the database

Parameters:

**kwargs (Any) – Input parameter. Must match LoadEstimatorQuery

Returns:

Newly created and loaded estimator

Return type:

models.Estimator

Example

client = RZRailClient()
new_estimator = client.load.estimator(
    name='my_gpz_com_cam_estimator',
    model_name='my_gpz_com_cam_model',
)

From client CLI

pz-rail-service-client load estimator

Load CatalogTags from RailEnv

pz-rail-service-client load estimator [OPTIONS]

Options

--name <name>

Name for a particular DB row

--model-name <model_name>

Name of associated model

--config <config>

Estimator configuration parameters

-o, --output <output>

Output format. Summary table if not specified.

Options:

yaml | json

From python on server side

async rail_pz_service.db.cache.Cache.load_estimator(self, session, name, model_name, config=None)

Create a new Estimator

Parameters:
  • session (async_scoped_session) – DB session manager

  • name (str) – Name for new Estimator

  • model_name (str) – Name of associated model

  • config (dict | None) – Extra paraemeters to use when running estimator

Returns:

Newly created Estimator

Return type:

Estimator

Raises:

RAILIntegrityError – Rows already exist in database

Example

from structlog import get_logger
logger = get_logger(__name__)
cache  = pz_rail_service.db.Cache.shared_cache(logger)
new_dataset = await cache.load_dataset_from_file(
    session,
    name='my_com_cam_dataset',
    path='local_version_of_data_file.hdf5',
    catalog_tag_name='com_cam',
)

From server CLI

pz-rail-service-admin load estimator

Load CatalogTags from RailEnv

pz-rail-service-admin load estimator [OPTIONS]

Options

--name <name>

Name for a particular DB row

--model-name <model_name>

Name of associated model

--config <config>

Estimator configuration parameters

-o, --output <output>

Output format. Summary table if not specified.

Options:

yaml | json