Main Classes¶
This describes functionalities about API REST.
Logging¶
lightmlrestapi.mlapp.base_logging.BaseLogging
(self, secret, folder = ‘.’, level = 20, encoding = ‘utf-8’, when = ‘d’)
Simplifies logging. Logging is encrypted with module pyjwt if secret is specified.
lightmlrestapi.mlapp.enumerate_parsed_logs
(folder, secret, encoding = ‘utf-8’)
Goes through a list of logged files, reads and decrypts the content.
Storage¶
lightmlrestapi.mlapp.mlstorage.ZipStorage
(self, folder)
Stores and restores zipped files.
lightmlrestapi.mlapp.mlstorage.MLStorage
(self, folder, cache_size = 10)
Stores machine learned models into folders. The storages expects to find at least one python following the specifications described at Implement your predict function. More template for actionable machine learned models through the following template: Templates.
Web Appplication for machine learning (REST API)¶
lightmlrestapi.mlapp.MachineLearningPost
(self, load_function, predict_function, secret = None, folder = ‘.’, log_features = True, log_prediction = True, load_params = None, ccall = ‘single’, version = None)
Implements a simple REST API which handles a post request, no authentification is required. The model ingests a vector X and outputs another one or a number Y. An basic example of an application is given by
dummy_application
.
lightmlrestapi.mlapp.MLStoragePost
(self, secret = None, folder = ‘.’, folder_storage = ‘.’, version = None)