Base¶
Provides the most basic view into the model. This view will
simply apply the model to the provided data and return the
model-output
along with the model-output
-
class
gordo.server.views.base.
BaseModelView
(api=None, *args, **kwargs)[source]¶ Bases:
flask_restplus.resource.Resource
The base model view.
-
X
: pandas.core.frame.DataFrame = None¶
-
endpoint
= 'base_model_view'¶
-
property
frequency
¶ The frequency the model was trained with in the dataset
-
mediatypes
()¶
-
methods
= ['POST']¶
-
post
()[source]¶ Process a POST request by using provided user data
A typical response might look like this
{ 'data': [ { 'end': ['2016-01-01T00:10:00+00:00'], 'model-output': [0.0005317790200933814, -0.0001525811239844188, 0.0008310950361192226, 0.0015755111817270517], 'original-input': [0.9135588550070414, 0.3472517774179448, 0.8994921857179736, 0.11982773108991263], 'start': ['2016-01-01T00:00:00+00:00'], }, ... ], 'tags': [ {'asset': None, 'name': 'tag-0'}, {'asset': None, 'name': 'tag-1'}, {'asset': None, 'name': 'tag-2'}, {'asset': None, 'name': 'tag-3'} ], 'time-seconds': '0.1937' }
The input tags for this model
- Returns
- Return type
typing.List[SensorTag]
The target tags for this model
- Returns
- Return type
typing.List[SensorTag]
-
y
: pandas.core.frame.DataFrame = None¶
-
-
class
gordo.server.views.base.
DownloadModel
(api=None, *args, **kwargs)[source]¶ Bases:
flask_restplus.resource.Resource
Download the trained model
suitable for reloading via
gordo.serializer.serializer.loads()
-
endpoint
= 'download_model'¶
-
get
()[source]¶ Responds with a serialized copy of the current model being served.
- Returns
Results from
gordo.serializer.dumps()
- Return type
bytes
-
mediatypes
()¶
-
methods
= {'GET'}¶
-
-
class
gordo.server.views.base.
ExpectedModels
(api=None, *args, **kwargs)[source]¶ Bases:
flask_restplus.resource.Resource
-
endpoint
= 'expected_models'¶
-
mediatypes
()¶
-
methods
= {'GET'}¶
-
-
class
gordo.server.views.base.
MetaDataView
(api=None, *args, **kwargs)[source]¶ Bases:
flask_restplus.resource.Resource
Serve model / server metadata
-
endpoint
= 'meta_data_view'¶
-
mediatypes
()¶
-
methods
= {'GET'}¶
-