diff --git a/.gitignore b/.gitignore index d4551a9..a640b8a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ learning_orchestra_client/transform/__pycache__ learning_orchestra_client/main.py learning_orchestra_client/explore/__pycache__ learning_orchestra_client/builder/__pycache__ -docs sentiment_analysis_output.py mnist_output.py mnist_treatment.py \ No newline at end of file diff --git a/html/learning_orchestra_client/builder/builder.html b/docs/builder/builder.html similarity index 100% rename from html/learning_orchestra_client/builder/builder.html rename to docs/builder/builder.html diff --git a/html/learning_orchestra_client/builder/builder_horovod.html b/docs/builder/builder_horovod.html similarity index 100% rename from html/learning_orchestra_client/builder/builder_horovod.html rename to docs/builder/builder_horovod.html diff --git a/html/learning_orchestra_client/builder/index.html b/docs/builder/index.html similarity index 100% rename from html/learning_orchestra_client/builder/index.html rename to docs/builder/index.html diff --git a/html/learning_orchestra_client/dataset/csv.html b/docs/dataset/csv.html similarity index 100% rename from html/learning_orchestra_client/dataset/csv.html rename to docs/dataset/csv.html diff --git a/html/learning_orchestra_client/dataset/generic.html b/docs/dataset/generic.html similarity index 100% rename from html/learning_orchestra_client/dataset/generic.html rename to docs/dataset/generic.html diff --git a/html/learning_orchestra_client/dataset/index.html b/docs/dataset/index.html similarity index 100% rename from html/learning_orchestra_client/dataset/index.html rename to docs/dataset/index.html diff --git a/html/learning_orchestra_client/evaluate/index.html b/docs/evaluate/index.html similarity index 100% rename from html/learning_orchestra_client/evaluate/index.html rename to docs/evaluate/index.html diff --git a/html/learning_orchestra_client/evaluate/scikitlearn.html b/docs/evaluate/scikitlearn.html similarity index 100% rename from html/learning_orchestra_client/evaluate/scikitlearn.html rename to docs/evaluate/scikitlearn.html diff --git a/html/learning_orchestra_client/evaluate/tensorflow.html b/docs/evaluate/tensorflow.html similarity index 100% rename from html/learning_orchestra_client/evaluate/tensorflow.html rename to docs/evaluate/tensorflow.html diff --git a/html/learning_orchestra_client/explore/histogram.html b/docs/explore/histogram.html similarity index 100% rename from html/learning_orchestra_client/explore/histogram.html rename to docs/explore/histogram.html diff --git a/html/learning_orchestra_client/explore/index.html b/docs/explore/index.html similarity index 100% rename from html/learning_orchestra_client/explore/index.html rename to docs/explore/index.html diff --git a/html/learning_orchestra_client/explore/scikitlearn.html b/docs/explore/scikitlearn.html similarity index 100% rename from html/learning_orchestra_client/explore/scikitlearn.html rename to docs/explore/scikitlearn.html diff --git a/html/learning_orchestra_client/explore/tensorflow.html b/docs/explore/tensorflow.html similarity index 100% rename from html/learning_orchestra_client/explore/tensorflow.html rename to docs/explore/tensorflow.html diff --git a/html/learning_orchestra_client/function/index.html b/docs/function/index.html similarity index 100% rename from html/learning_orchestra_client/function/index.html rename to docs/function/index.html diff --git a/html/learning_orchestra_client/function/python.html b/docs/function/python.html similarity index 100% rename from html/learning_orchestra_client/function/python.html rename to docs/function/python.html diff --git a/html/learning_orchestra_client/index.html b/docs/index.html similarity index 100% rename from html/learning_orchestra_client/index.html rename to docs/index.html diff --git a/html/learning_orchestra_client/model/index.html b/docs/model/index.html similarity index 100% rename from html/learning_orchestra_client/model/index.html rename to docs/model/index.html diff --git a/html/learning_orchestra_client/model/scikitlearn.html b/docs/model/scikitlearn.html similarity index 100% rename from html/learning_orchestra_client/model/scikitlearn.html rename to docs/model/scikitlearn.html diff --git a/html/learning_orchestra_client/model/tensorflow.html b/docs/model/tensorflow.html similarity index 100% rename from html/learning_orchestra_client/model/tensorflow.html rename to docs/model/tensorflow.html diff --git a/html/learning_orchestra_client/observe/index.html b/docs/observe/index.html similarity index 100% rename from html/learning_orchestra_client/observe/index.html rename to docs/observe/index.html diff --git a/html/learning_orchestra_client/observe/observe.html b/docs/observe/observe.html similarity index 100% rename from html/learning_orchestra_client/observe/observe.html rename to docs/observe/observe.html diff --git a/docs/old/.nojekyll b/docs/old/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/docs/old/index.html b/docs/old/index.html new file mode 100644 index 0000000..0b7bc20 --- /dev/null +++ b/docs/old/index.html @@ -0,0 +1,279 @@ + + + + + + + Module List – pdoc 7.0.0 + + + + + + + + + + +
+ + pdoc logo + + +
+
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client.html b/docs/old/learning_orchestra_client.html new file mode 100644 index 0000000..e442689 --- /dev/null +++ b/docs/old/learning_orchestra_client.html @@ -0,0 +1,254 @@ + + + + + + + learning_orchestra_client API documentation + + + + + + + + +
+
+

+learning_orchestra_client

+ + + +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/_util.html b/docs/old/learning_orchestra_client/_util.html new file mode 100644 index 0000000..6f4bac2 --- /dev/null +++ b/docs/old/learning_orchestra_client/_util.html @@ -0,0 +1,239 @@ + + + + + + + learning_orchestra_client._util API documentation + + + + + + + + +
+
+

+learning_orchestra_client._util

+ + + +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/_util/_entity_reader.html b/docs/old/learning_orchestra_client/_util/_entity_reader.html new file mode 100644 index 0000000..99ef256 --- /dev/null +++ b/docs/old/learning_orchestra_client/_util/_entity_reader.html @@ -0,0 +1,466 @@ + + + + + + + learning_orchestra_client._util._entity_reader API documentation + + + + + + + + +
+
+

+learning_orchestra_client._util._entity_reader

+ + +
+ View Source +
from ._response_treat import ResponseTreat
+import requests
+from requests import Response
+
+
+class EntityReader:
+    def __init__(self, entity_url: str):
+        self.__response_treat = ResponseTreat()
+        self.__entity_url = entity_url
+
+    def read_all_instances_from_entity(self) -> Response:
+        request_url = self.__entity_url
+
+        response = requests.get(request_url)
+        return response
+
+    def read_entity_content(self,
+                            name: str,
+                            query: dict = {},
+                            limit: int = 10,
+                            skip: int = 0) \
+            -> Response:
+        request_url = f'{self.__entity_url}/{name}' \
+                      f'?query={query}&limit={limit}&skip={skip}'
+
+        response = requests.get(request_url)
+        return response
+
+    def read_explore_image_metadata(self,
+                                    name: str,
+                                    query: dict = {},
+                                    limit: int = 10,
+                                    skip: int = 0
+                                    ) -> Response:
+        request_url = f'{self.__entity_url}/{name}/metadata' \
+                      f'?query={query}&limit={limit}&skip={skip}'
+
+        response = requests.get(request_url)
+        return response
+
+ +
+ +
+
+
+ #   + + + class + EntityReader: +
+ +
+ View Source +
class EntityReader:
+    def __init__(self, entity_url: str):
+        self.__response_treat = ResponseTreat()
+        self.__entity_url = entity_url
+
+    def read_all_instances_from_entity(self) -> Response:
+        request_url = self.__entity_url
+
+        response = requests.get(request_url)
+        return response
+
+    def read_entity_content(self,
+                            name: str,
+                            query: dict = {},
+                            limit: int = 10,
+                            skip: int = 0) \
+            -> Response:
+        request_url = f'{self.__entity_url}/{name}' \
+                      f'?query={query}&limit={limit}&skip={skip}'
+
+        response = requests.get(request_url)
+        return response
+
+    def read_explore_image_metadata(self,
+                                    name: str,
+                                    query: dict = {},
+                                    limit: int = 10,
+                                    skip: int = 0
+                                    ) -> Response:
+        request_url = f'{self.__entity_url}/{name}/metadata' \
+                      f'?query={query}&limit={limit}&skip={skip}'
+
+        response = requests.get(request_url)
+        return response
+
+ +
+ + + +
+
#   + + + EntityReader(entity_url: str) +
+ +
+ View Source +
    def __init__(self, entity_url: str):
+        self.__response_treat = ResponseTreat()
+        self.__entity_url = entity_url
+
+ +
+ + + +
+
+
#   + + + def + read_all_instances_from_entity(self) -> requests.models.Response: +
+ +
+ View Source +
    def read_all_instances_from_entity(self) -> Response:
+        request_url = self.__entity_url
+
+        response = requests.get(request_url)
+        return response
+
+ +
+ + + +
+
+
#   + + + def + read_entity_content( + self, + name: str, + query: dict = {}, + limit: int = 10, + skip: int = 0 +) -> requests.models.Response: +
+ +
+ View Source +
    def read_entity_content(self,
+                            name: str,
+                            query: dict = {},
+                            limit: int = 10,
+                            skip: int = 0) \
+            -> Response:
+        request_url = f'{self.__entity_url}/{name}' \
+                      f'?query={query}&limit={limit}&skip={skip}'
+
+        response = requests.get(request_url)
+        return response
+
+ +
+ + + +
+
+
#   + + + def + read_explore_image_metadata( + self, + name: str, + query: dict = {}, + limit: int = 10, + skip: int = 0 +) -> requests.models.Response: +
+ +
+ View Source +
    def read_explore_image_metadata(self,
+                                    name: str,
+                                    query: dict = {},
+                                    limit: int = 10,
+                                    skip: int = 0
+                                    ) -> Response:
+        request_url = f'{self.__entity_url}/{name}/metadata' \
+                      f'?query={query}&limit={limit}&skip={skip}'
+
+        response = requests.get(request_url)
+        return response
+
+ +
+ + + +
+
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/_util/_response_treat.html b/docs/old/learning_orchestra_client/_util/_response_treat.html new file mode 100644 index 0000000..d2a600e --- /dev/null +++ b/docs/old/learning_orchestra_client/_util/_response_treat.html @@ -0,0 +1,438 @@ + + + + + + + learning_orchestra_client._util._response_treat API documentation + + + + + + + + +
+
+

+learning_orchestra_client._util._response_treat

+ + +
+ View Source +
import json
+from requests import Response
+import logging
+from typing import Union
+
+
+class ResponseTreat:
+    HTTP_CREATED = 201
+    HTTP_SUCCESS = 200
+    HTTP_ERROR = 500
+
+    def treatment(self, response: Response,
+                  pretty_response: bool = True) -> Union[dict, str]:
+        """
+        description: This method is responsible to return an indented json file
+        or a dict.
+
+        response: file that will be indented.
+
+        return: Indented json file or a dict.
+        """
+        if response.status_code >= self.HTTP_ERROR:
+            logging.error(response.text)
+        elif (
+                response.status_code != self.HTTP_SUCCESS
+                and response.status_code != self.HTTP_CREATED
+        ):
+            logging.warning(response.json()["result"])
+            return {}
+        else:
+            if pretty_response:
+                return json.dumps(response.json(), indent=4, sort_keys=True)
+            else:
+                return response.json()
+
+ +
+ +
+
+
+ #   + + + class + ResponseTreat: +
+ +
+ View Source +
class ResponseTreat:
+    HTTP_CREATED = 201
+    HTTP_SUCCESS = 200
+    HTTP_ERROR = 500
+
+    def treatment(self, response: Response,
+                  pretty_response: bool = True) -> Union[dict, str]:
+        """
+        description: This method is responsible to return an indented json file
+        or a dict.
+
+        response: file that will be indented.
+
+        return: Indented json file or a dict.
+        """
+        if response.status_code >= self.HTTP_ERROR:
+            logging.error(response.text)
+        elif (
+                response.status_code != self.HTTP_SUCCESS
+                and response.status_code != self.HTTP_CREATED
+        ):
+            logging.warning(response.json()["result"])
+            return {}
+        else:
+            if pretty_response:
+                return json.dumps(response.json(), indent=4, sort_keys=True)
+            else:
+                return response.json()
+
+ +
+ + + +
+
#   + + + ResponseTreat() +
+ + + + +
+
+
#   + + HTTP_CREATED = 201 +
+ + + +
+
+
#   + + HTTP_SUCCESS = 200 +
+ + + +
+
+
#   + + HTTP_ERROR = 500 +
+ + + +
+
+
#   + + + def + treatment( + self, + response: requests.models.Response, + pretty_response: bool = True +) -> Union[dict, str]: +
+ +
+ View Source +
    def treatment(self, response: Response,
+                  pretty_response: bool = True) -> Union[dict, str]:
+        """
+        description: This method is responsible to return an indented json file
+        or a dict.
+
+        response: file that will be indented.
+
+        return: Indented json file or a dict.
+        """
+        if response.status_code >= self.HTTP_ERROR:
+            logging.error(response.text)
+        elif (
+                response.status_code != self.HTTP_SUCCESS
+                and response.status_code != self.HTTP_CREATED
+        ):
+            logging.warning(response.json()["result"])
+            return {}
+        else:
+            if pretty_response:
+                return json.dumps(response.json(), indent=4, sort_keys=True)
+            else:
+                return response.json()
+
+ +
+ +

description: This method is responsible to return an indented json file +or a dict.

+ +

response: file that will be indented.

+ +

return: Indented json file or a dict.

+
+ + +
+
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/builder.html b/docs/old/learning_orchestra_client/builder.html new file mode 100644 index 0000000..cb3559f --- /dev/null +++ b/docs/old/learning_orchestra_client/builder.html @@ -0,0 +1,243 @@ + + + + + + + learning_orchestra_client.builder API documentation + + + + + + + + +
+
+

+learning_orchestra_client.builder

+ + + +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/builder/builder.html b/docs/old/learning_orchestra_client/builder/builder.html new file mode 100644 index 0000000..fde0db3 --- /dev/null +++ b/docs/old/learning_orchestra_client/builder/builder.html @@ -0,0 +1,1079 @@ + + + + + + + learning_orchestra_client.builder.builder API documentation + + + + + + + + +
+
+

+learning_orchestra_client.builder.builder

+ + +
+ View Source +
from learning_orchestra_client.observe.observe import Observer
+from learning_orchestra_client._util._response_treat import ResponseTreat
+from learning_orchestra_client._util._entity_reader import EntityReader
+import requests
+from typing import Union
+
+
+class BuilderSparkMl:
+    __TRAIN_FIELD = "trainDatasetName"
+    __TEST_FIELD = "testDatasetName"
+    __CODE_FIELD = "modelingCode"
+    __CLASSIFIERS_LIST_FIELD = "classifiersList"
+
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/builder/sparkml"
+        self.__service_url = f'{cluster_ip}{self.__api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def run_spark_ml_sync(self,
+                          train_dataset_name: str,
+                          test_dataset_name: str,
+                          modeling_code: str,
+                          model_classifiers: list,
+                          pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method call runs several steps of a machine
+        learning pipeline (transform, tune, train and evaluate, for instance)
+        using a model code and several classifiers. It represents a way to run
+        an entire pipeline. The caller waits until the method execution ends,
+        since it is a synchronous method.
+
+        train_dataset_name: Represent final train dataset.
+        test_dataset_name: Represent final test dataset.
+        modeling_code: Represent Python3 code for pyspark pre-processing model
+        model_classifiers: list of initial classifiers to be used in the model
+        pretty_response: if True it represents a result useful for visualization
+
+        return: The set of predictions (URIs of them).
+        """
+
+        request_body_content = {
+            self.__TRAIN_FIELD: train_dataset_name,
+            self.__TEST_FIELD: test_dataset_name,
+            self.__CODE_FIELD: modeling_code,
+            self.__CLASSIFIERS_LIST_FIELD: model_classifiers,
+        }
+        response = requests.post(url=self.__service_url,
+                                 json=request_body_content)
+
+        for classifier in model_classifiers:
+            self.__observer.wait(f'{test_dataset_name}{classifier}')
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def run_spark_ml_async(self,
+                           train_dataset_name: str,
+                           test_dataset_name: str,
+                           modeling_code: str,
+                           model_classifiers: list,
+                           pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method call runs several steps of a machine
+        learning pipeline (transform, tune, train and evaluate, for instance)
+        using a model code and several classifiers. It represents a way to run
+        an entire pipeline. The caller does not wait until the method execution
+        ends, since it is an asynchronous method.
+
+        train_dataset_name: Represent final train dataset.
+        test_dataset_name: Represent final test dataset.
+        modeling_code: Represent Python3 code for pyspark pre-processing model
+        model_classifiers: list of initial classifiers to be used in the model
+        pretty_response: if True it represents a result useful for visualization
+
+        return: the URL to retrieve the Spark pipeline result
+        """
+
+        request_body_content = {
+            self.__TRAIN_FIELD: train_dataset_name,
+            self.__TEST_FIELD: test_dataset_name,
+            self.__CODE_FIELD: modeling_code,
+            self.__CLASSIFIERS_LIST_FIELD: model_classifiers,
+        }
+        response = requests.post(url=self.__service_url,
+                                 json=request_body_content)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_builders(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all model predictions metadata. It
+        does not retrieve the model predictions content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: A list with all model predictions metadata stored in Learning
+        Orchestra or an empty result.
+        """
+
+        response = self.__entity_reader.read_all_instances_from_entity()
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_builder_register_predictions(self,
+                                            builder_name: str,
+                                            query: dict = {},
+                                            limit: int = 10,
+                                            skip: int = 0,
+                                            pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for retrieving the model
+        predictions content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        builder_name: Represents the model predictions name.
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some tuples or registers inside or an error if the
+        pipeline runs incorrectly. The current page is also returned to be used
+        in future content requests.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            builder_name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_builder(self, builder_name: str, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving a specific
+        model metadata.
+
+        pretty_response: If true return indented string, else return dict.
+        builder_name: Represents the model predictions name.
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: Specific model prediction metadata stored in Learning Orchestra
+        or an error if there is no such projections.
+        """
+        response = self.search_builder_register_predictions(
+            builder_name, limit=1,
+            pretty_response=pretty_response)
+
+        return response
+
+    def delete_builder(self, builder_name: str, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting a model prediction.
+        The delete operation is always asynchronous,
+        since the deletion is performed in background.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        builder_name: Represents the pipeline name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        cluster_url_dataset = f'{self.__service_url}/{builder_name}'
+
+        response = requests.delete(cluster_url_dataset)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, dataset_name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the run_spark_ml_async method.
+
+           dataset_name: Represents the pipeline name.
+           timeout: Represents the time in seconds to wait for a builder to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct execution of a pipeline
+        """
+        return self.__observer.wait(dataset_name, timeout)
+
+ +
+ +
+
+
+ #   + + + class + BuilderSparkMl: +
+ +
+ View Source +
class BuilderSparkMl:
+    __TRAIN_FIELD = "trainDatasetName"
+    __TEST_FIELD = "testDatasetName"
+    __CODE_FIELD = "modelingCode"
+    __CLASSIFIERS_LIST_FIELD = "classifiersList"
+
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/builder/sparkml"
+        self.__service_url = f'{cluster_ip}{self.__api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def run_spark_ml_sync(self,
+                          train_dataset_name: str,
+                          test_dataset_name: str,
+                          modeling_code: str,
+                          model_classifiers: list,
+                          pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method call runs several steps of a machine
+        learning pipeline (transform, tune, train and evaluate, for instance)
+        using a model code and several classifiers. It represents a way to run
+        an entire pipeline. The caller waits until the method execution ends,
+        since it is a synchronous method.
+
+        train_dataset_name: Represent final train dataset.
+        test_dataset_name: Represent final test dataset.
+        modeling_code: Represent Python3 code for pyspark pre-processing model
+        model_classifiers: list of initial classifiers to be used in the model
+        pretty_response: if True it represents a result useful for visualization
+
+        return: The set of predictions (URIs of them).
+        """
+
+        request_body_content = {
+            self.__TRAIN_FIELD: train_dataset_name,
+            self.__TEST_FIELD: test_dataset_name,
+            self.__CODE_FIELD: modeling_code,
+            self.__CLASSIFIERS_LIST_FIELD: model_classifiers,
+        }
+        response = requests.post(url=self.__service_url,
+                                 json=request_body_content)
+
+        for classifier in model_classifiers:
+            self.__observer.wait(f'{test_dataset_name}{classifier}')
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def run_spark_ml_async(self,
+                           train_dataset_name: str,
+                           test_dataset_name: str,
+                           modeling_code: str,
+                           model_classifiers: list,
+                           pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method call runs several steps of a machine
+        learning pipeline (transform, tune, train and evaluate, for instance)
+        using a model code and several classifiers. It represents a way to run
+        an entire pipeline. The caller does not wait until the method execution
+        ends, since it is an asynchronous method.
+
+        train_dataset_name: Represent final train dataset.
+        test_dataset_name: Represent final test dataset.
+        modeling_code: Represent Python3 code for pyspark pre-processing model
+        model_classifiers: list of initial classifiers to be used in the model
+        pretty_response: if True it represents a result useful for visualization
+
+        return: the URL to retrieve the Spark pipeline result
+        """
+
+        request_body_content = {
+            self.__TRAIN_FIELD: train_dataset_name,
+            self.__TEST_FIELD: test_dataset_name,
+            self.__CODE_FIELD: modeling_code,
+            self.__CLASSIFIERS_LIST_FIELD: model_classifiers,
+        }
+        response = requests.post(url=self.__service_url,
+                                 json=request_body_content)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_builders(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all model predictions metadata. It
+        does not retrieve the model predictions content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: A list with all model predictions metadata stored in Learning
+        Orchestra or an empty result.
+        """
+
+        response = self.__entity_reader.read_all_instances_from_entity()
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_builder_register_predictions(self,
+                                            builder_name: str,
+                                            query: dict = {},
+                                            limit: int = 10,
+                                            skip: int = 0,
+                                            pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for retrieving the model
+        predictions content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        builder_name: Represents the model predictions name.
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some tuples or registers inside or an error if the
+        pipeline runs incorrectly. The current page is also returned to be used
+        in future content requests.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            builder_name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_builder(self, builder_name: str, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving a specific
+        model metadata.
+
+        pretty_response: If true return indented string, else return dict.
+        builder_name: Represents the model predictions name.
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: Specific model prediction metadata stored in Learning Orchestra
+        or an error if there is no such projections.
+        """
+        response = self.search_builder_register_predictions(
+            builder_name, limit=1,
+            pretty_response=pretty_response)
+
+        return response
+
+    def delete_builder(self, builder_name: str, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting a model prediction.
+        The delete operation is always asynchronous,
+        since the deletion is performed in background.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        builder_name: Represents the pipeline name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        cluster_url_dataset = f'{self.__service_url}/{builder_name}'
+
+        response = requests.delete(cluster_url_dataset)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, dataset_name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the run_spark_ml_async method.
+
+           dataset_name: Represents the pipeline name.
+           timeout: Represents the time in seconds to wait for a builder to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct execution of a pipeline
+        """
+        return self.__observer.wait(dataset_name, timeout)
+
+ +
+ + + +
+
#   + + + BuilderSparkMl(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/builder/sparkml"
+        self.__service_url = f'{cluster_ip}{self.__api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+ +
+ + + +
+
+
#   + + + def + run_spark_ml_sync( + self, + train_dataset_name: str, + test_dataset_name: str, + modeling_code: str, + model_classifiers: list, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def run_spark_ml_sync(self,
+                          train_dataset_name: str,
+                          test_dataset_name: str,
+                          modeling_code: str,
+                          model_classifiers: list,
+                          pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method call runs several steps of a machine
+        learning pipeline (transform, tune, train and evaluate, for instance)
+        using a model code and several classifiers. It represents a way to run
+        an entire pipeline. The caller waits until the method execution ends,
+        since it is a synchronous method.
+
+        train_dataset_name: Represent final train dataset.
+        test_dataset_name: Represent final test dataset.
+        modeling_code: Represent Python3 code for pyspark pre-processing model
+        model_classifiers: list of initial classifiers to be used in the model
+        pretty_response: if True it represents a result useful for visualization
+
+        return: The set of predictions (URIs of them).
+        """
+
+        request_body_content = {
+            self.__TRAIN_FIELD: train_dataset_name,
+            self.__TEST_FIELD: test_dataset_name,
+            self.__CODE_FIELD: modeling_code,
+            self.__CLASSIFIERS_LIST_FIELD: model_classifiers,
+        }
+        response = requests.post(url=self.__service_url,
+                                 json=request_body_content)
+
+        for classifier in model_classifiers:
+            self.__observer.wait(f'{test_dataset_name}{classifier}')
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method call runs several steps of a machine +learning pipeline (transform, tune, train and evaluate, for instance) +using a model code and several classifiers. It represents a way to run +an entire pipeline. The caller waits until the method execution ends, +since it is a synchronous method.

+ +

train_dataset_name: Represent final train dataset. +test_dataset_name: Represent final test dataset. +modeling_code: Represent Python3 code for pyspark pre-processing model +model_classifiers: list of initial classifiers to be used in the model +pretty_response: if True it represents a result useful for visualization

+ +

return: The set of predictions (URIs of them).

+
+ + +
+
+
#   + + + def + run_spark_ml_async( + self, + train_dataset_name: str, + test_dataset_name: str, + modeling_code: str, + model_classifiers: list, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def run_spark_ml_async(self,
+                           train_dataset_name: str,
+                           test_dataset_name: str,
+                           modeling_code: str,
+                           model_classifiers: list,
+                           pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method call runs several steps of a machine
+        learning pipeline (transform, tune, train and evaluate, for instance)
+        using a model code and several classifiers. It represents a way to run
+        an entire pipeline. The caller does not wait until the method execution
+        ends, since it is an asynchronous method.
+
+        train_dataset_name: Represent final train dataset.
+        test_dataset_name: Represent final test dataset.
+        modeling_code: Represent Python3 code for pyspark pre-processing model
+        model_classifiers: list of initial classifiers to be used in the model
+        pretty_response: if True it represents a result useful for visualization
+
+        return: the URL to retrieve the Spark pipeline result
+        """
+
+        request_body_content = {
+            self.__TRAIN_FIELD: train_dataset_name,
+            self.__TEST_FIELD: test_dataset_name,
+            self.__CODE_FIELD: modeling_code,
+            self.__CLASSIFIERS_LIST_FIELD: model_classifiers,
+        }
+        response = requests.post(url=self.__service_url,
+                                 json=request_body_content)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method call runs several steps of a machine +learning pipeline (transform, tune, train and evaluate, for instance) +using a model code and several classifiers. It represents a way to run +an entire pipeline. The caller does not wait until the method execution +ends, since it is an asynchronous method.

+ +

train_dataset_name: Represent final train dataset. +test_dataset_name: Represent final test dataset. +modeling_code: Represent Python3 code for pyspark pre-processing model +model_classifiers: list of initial classifiers to be used in the model +pretty_response: if True it represents a result useful for visualization

+ +

return: the URL to retrieve the Spark pipeline result

+
+ + +
+
+
#   + + + def + search_all_builders(self, pretty_response: bool = False) -> Union[dict, str]: +
+ +
+ View Source +
    def search_all_builders(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all model predictions metadata. It
+        does not retrieve the model predictions content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: A list with all model predictions metadata stored in Learning
+        Orchestra or an empty result.
+        """
+
+        response = self.__entity_reader.read_all_instances_from_entity()
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method retrieves all model predictions metadata. It +does not retrieve the model predictions content.

+ +

pretty_response: If true it returns a string, otherwise a dictionary.

+ +

return: A list with all model predictions metadata stored in Learning +Orchestra or an empty result.

+
+ + +
+
+
#   + + + def + search_builder_register_predictions( + self, + builder_name: str, + query: dict = {}, + limit: int = 10, + skip: int = 0, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def search_builder_register_predictions(self,
+                                            builder_name: str,
+                                            query: dict = {},
+                                            limit: int = 10,
+                                            skip: int = 0,
+                                            pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for retrieving the model
+        predictions content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        builder_name: Represents the model predictions name.
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some tuples or registers inside or an error if the
+        pipeline runs incorrectly. The current page is also returned to be used
+        in future content requests.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            builder_name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for retrieving the model +predictions content.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +builder_name: Represents the model predictions name. +query: Query to make in MongoDB(default: empty query) +limit: Number of rows to return in pagination(default: 10) (maximum is +set at 20 rows per request) +skip: Number of rows to skip in pagination(default: 0)

+ +

return: A page with some tuples or registers inside or an error if the +pipeline runs incorrectly. The current page is also returned to be used +in future content requests.

+
+ + +
+
+
#   + + + def + search_builder( + self, + builder_name: str, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def search_builder(self, builder_name: str, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving a specific
+        model metadata.
+
+        pretty_response: If true return indented string, else return dict.
+        builder_name: Represents the model predictions name.
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: Specific model prediction metadata stored in Learning Orchestra
+        or an error if there is no such projections.
+        """
+        response = self.search_builder_register_predictions(
+            builder_name, limit=1,
+            pretty_response=pretty_response)
+
+        return response
+
+ +
+ +

description: This method is responsible for retrieving a specific +model metadata.

+ +

pretty_response: If true return indented string, else return dict. +builder_name: Represents the model predictions name. +limit: Number of rows to return in pagination(default: 10) (maximum is +set at 20 rows per request) +skip: Number of rows to skip in pagination(default: 0)

+ +

return: Specific model prediction metadata stored in Learning Orchestra +or an error if there is no such projections.

+
+ + +
+
+
#   + + + def + delete_builder( + self, + builder_name: str, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def delete_builder(self, builder_name: str, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting a model prediction.
+        The delete operation is always asynchronous,
+        since the deletion is performed in background.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        builder_name: Represents the pipeline name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        cluster_url_dataset = f'{self.__service_url}/{builder_name}'
+
+        response = requests.delete(cluster_url_dataset)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for deleting a model prediction. +The delete operation is always asynchronous, +since the deletion is performed in background.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +builder_name: Represents the pipeline name.

+ +

return: JSON object with an error message, a warning message or a +correct delete message

+
+ + +
+
+
#   + + + def + wait(self, dataset_name: str, timeout: int = None) -> dict: +
+ +
+ View Source +
    def wait(self, dataset_name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the run_spark_ml_async method.
+
+           dataset_name: Represents the pipeline name.
+           timeout: Represents the time in seconds to wait for a builder to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct execution of a pipeline
+        """
+        return self.__observer.wait(dataset_name, timeout)
+
+ +
+ +

description: This method is responsible to create a synchronization +barrier for the run_spark_ml_async method.

+ +

dataset_name: Represents the pipeline name. +timeout: Represents the time in seconds to wait for a builder to +finish its run.

+ +

return: JSON object with an error message, a warning message or a +correct execution of a pipeline

+
+ + +
+
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/dataset.html b/docs/old/learning_orchestra_client/dataset.html new file mode 100644 index 0000000..e16468c --- /dev/null +++ b/docs/old/learning_orchestra_client/dataset.html @@ -0,0 +1,244 @@ + + + + + + + learning_orchestra_client.dataset API documentation + + + + + + + + +
+
+

+learning_orchestra_client.dataset

+ + + +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/dataset/_dataset.html b/docs/old/learning_orchestra_client/dataset/_dataset.html new file mode 100644 index 0000000..4b1b068 --- /dev/null +++ b/docs/old/learning_orchestra_client/dataset/_dataset.html @@ -0,0 +1,919 @@ + + + + + + + learning_orchestra_client.dataset._dataset API documentation + + + + + + + + +
+
+

+learning_orchestra_client.dataset._dataset

+ + +
+ View Source +
from learning_orchestra_client.observe.observe import Observer
+from learning_orchestra_client._util._response_treat import ResponseTreat
+from learning_orchestra_client._util._entity_reader import EntityReader
+import requests
+from typing import Union
+
+
+class Dataset:
+    __DATASET_NAME = "datasetName"
+    __URL = "datasetURI"
+
+    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def insert_dataset_sync(self,
+                            dataset_name: str,
+                            url: str,
+                            pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method is responsible to insert a dataset from a URI
+        synchronously, i.e., the caller waits until the dataset is inserted into
+        the Learning Orchestra storage mechanism.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        dataset_name: Is the name of the dataset file that will be created.
+        url: Url to CSV file.
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {self.__DATASET_NAME: dataset_name,
+                        self.__URL: url}
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(dataset_name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def insert_dataset_async(self,
+                             dataset_name: str,
+                             url: str,
+                             pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible to insert a dataset from a URI
+        asynchronously, i.e., the caller does not wait until the dataset is
+        inserted into the Learning Orchestra storage mechanism. Instead, the
+        caller receives a JSON object with a URL to proceed future calls to
+        verify if the dataset is inserted.
+
+        pretty_response: If true return indented string, else return dict.
+        dataset_name: Is the name of the dataset file that will be created.
+        url: Url to CSV file.
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation (the caller must use such an URL to
+        proceed future checks to verify if the dataset is inserted - using wait
+        method).
+        """
+        request_body = {self.__DATASET_NAME: dataset_name,
+                        self.__URL: url}
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_datasets(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all datasets metadata, i.e., it does
+        not retrieve the dataset content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All datasets metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_dataset(self, dataset_name, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting the dataset.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks. If a
+         dataset was used by another task (Ex. projection, histogram, pca, tune
+         and so forth), it cannot be deleted.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        dataset_name: Represents the dataset name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        request_url = f'{self.__service_url}/{dataset_name}'
+        response = requests.delete(request_url)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_dataset_content(self,
+                               dataset_name: str,
+                               query: dict = {},
+                               limit: int = 10,
+                               skip: int = 0,
+                               pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving the dataset
+        content
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        dataset_name: Is the name of the dataset file.
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some tuples or registers inside or an error if there
+        is no such dataset. The current page is also returned to be used in
+        future content requests.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            dataset_name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, dataset_name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the insert_dataset_async method.
+
+           dataset_name: Represents the dataset name.
+           timeout: Represents the time in seconds to wait for a dataset
+           download to finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct execution of a pipeline
+        """
+        return self.__observer.wait(dataset_name, timeout)
+
+ +
+ +
+
+
+ #   + + + class + Dataset: +
+ +
+ View Source +
class Dataset:
+    __DATASET_NAME = "datasetName"
+    __URL = "datasetURI"
+
+    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def insert_dataset_sync(self,
+                            dataset_name: str,
+                            url: str,
+                            pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method is responsible to insert a dataset from a URI
+        synchronously, i.e., the caller waits until the dataset is inserted into
+        the Learning Orchestra storage mechanism.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        dataset_name: Is the name of the dataset file that will be created.
+        url: Url to CSV file.
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {self.__DATASET_NAME: dataset_name,
+                        self.__URL: url}
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(dataset_name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def insert_dataset_async(self,
+                             dataset_name: str,
+                             url: str,
+                             pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible to insert a dataset from a URI
+        asynchronously, i.e., the caller does not wait until the dataset is
+        inserted into the Learning Orchestra storage mechanism. Instead, the
+        caller receives a JSON object with a URL to proceed future calls to
+        verify if the dataset is inserted.
+
+        pretty_response: If true return indented string, else return dict.
+        dataset_name: Is the name of the dataset file that will be created.
+        url: Url to CSV file.
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation (the caller must use such an URL to
+        proceed future checks to verify if the dataset is inserted - using wait
+        method).
+        """
+        request_body = {self.__DATASET_NAME: dataset_name,
+                        self.__URL: url}
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_datasets(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all datasets metadata, i.e., it does
+        not retrieve the dataset content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All datasets metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_dataset(self, dataset_name, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting the dataset.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks. If a
+         dataset was used by another task (Ex. projection, histogram, pca, tune
+         and so forth), it cannot be deleted.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        dataset_name: Represents the dataset name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        request_url = f'{self.__service_url}/{dataset_name}'
+        response = requests.delete(request_url)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_dataset_content(self,
+                               dataset_name: str,
+                               query: dict = {},
+                               limit: int = 10,
+                               skip: int = 0,
+                               pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving the dataset
+        content
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        dataset_name: Is the name of the dataset file.
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some tuples or registers inside or an error if there
+        is no such dataset. The current page is also returned to be used in
+        future content requests.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            dataset_name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, dataset_name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the insert_dataset_async method.
+
+           dataset_name: Represents the dataset name.
+           timeout: Represents the time in seconds to wait for a dataset
+           download to finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct execution of a pipeline
+        """
+        return self.__observer.wait(dataset_name, timeout)
+
+ +
+ + + +
+
#   + + + Dataset(cluster_ip: str, api_path: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+ +
+ + + +
+
+
#   + + + def + insert_dataset_sync( + self, + dataset_name: str, + url: str, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def insert_dataset_sync(self,
+                            dataset_name: str,
+                            url: str,
+                            pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method is responsible to insert a dataset from a URI
+        synchronously, i.e., the caller waits until the dataset is inserted into
+        the Learning Orchestra storage mechanism.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        dataset_name: Is the name of the dataset file that will be created.
+        url: Url to CSV file.
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {self.__DATASET_NAME: dataset_name,
+                        self.__URL: url}
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(dataset_name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible to insert a dataset from a URI +synchronously, i.e., the caller waits until the dataset is inserted into +the Learning Orchestra storage mechanism.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +dataset_name: Is the name of the dataset file that will be created. +url: Url to CSV file.

+ +

return: A JSON object with an error or warning message or a URL +indicating the correct operation.

+
+ + +
+
+
#   + + + def + insert_dataset_async( + self, + dataset_name: str, + url: str, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def insert_dataset_async(self,
+                             dataset_name: str,
+                             url: str,
+                             pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible to insert a dataset from a URI
+        asynchronously, i.e., the caller does not wait until the dataset is
+        inserted into the Learning Orchestra storage mechanism. Instead, the
+        caller receives a JSON object with a URL to proceed future calls to
+        verify if the dataset is inserted.
+
+        pretty_response: If true return indented string, else return dict.
+        dataset_name: Is the name of the dataset file that will be created.
+        url: Url to CSV file.
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation (the caller must use such an URL to
+        proceed future checks to verify if the dataset is inserted - using wait
+        method).
+        """
+        request_body = {self.__DATASET_NAME: dataset_name,
+                        self.__URL: url}
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible to insert a dataset from a URI +asynchronously, i.e., the caller does not wait until the dataset is +inserted into the Learning Orchestra storage mechanism. Instead, the +caller receives a JSON object with a URL to proceed future calls to +verify if the dataset is inserted.

+ +

pretty_response: If true return indented string, else return dict. +dataset_name: Is the name of the dataset file that will be created. +url: Url to CSV file.

+ +

return: A JSON object with an error or warning message or a URL +indicating the correct operation (the caller must use such an URL to +proceed future checks to verify if the dataset is inserted - using wait +method).

+
+ + +
+
+
#   + + + def + search_all_datasets(self, pretty_response: bool = False) -> Union[dict, str]: +
+ +
+ View Source +
    def search_all_datasets(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all datasets metadata, i.e., it does
+        not retrieve the dataset content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All datasets metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method retrieves all datasets metadata, i.e., it does +not retrieve the dataset content.

+ +

pretty_response: If true it returns a string, otherwise a dictionary.

+ +

return: All datasets metadata stored in Learning Orchestra or an empty +result.

+
+ + +
+
+
#   + + + def + delete_dataset(self, dataset_name, pretty_response=False) -> Union[dict, str]: +
+ +
+ View Source +
    def delete_dataset(self, dataset_name, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting the dataset.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks. If a
+         dataset was used by another task (Ex. projection, histogram, pca, tune
+         and so forth), it cannot be deleted.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        dataset_name: Represents the dataset name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        request_url = f'{self.__service_url}/{dataset_name}'
+        response = requests.delete(request_url)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for deleting the dataset. +This delete operation is asynchronous, so it does not lock the caller + until the deletion finished. Instead, it returns a JSON object with a + URL for a future use. The caller uses the URL for delete checks. If a + dataset was used by another task (Ex. projection, histogram, pca, tune + and so forth), it cannot be deleted.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +dataset_name: Represents the dataset name.

+ +

return: JSON object with an error message, a warning message or a +correct delete message

+
+ + +
+
+
#   + + + def + search_dataset_content( + self, + dataset_name: str, + query: dict = {}, + limit: int = 10, + skip: int = 0, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def search_dataset_content(self,
+                               dataset_name: str,
+                               query: dict = {},
+                               limit: int = 10,
+                               skip: int = 0,
+                               pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving the dataset
+        content
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        dataset_name: Is the name of the dataset file.
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some tuples or registers inside or an error if there
+        is no such dataset. The current page is also returned to be used in
+        future content requests.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            dataset_name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for retrieving the dataset +content

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +dataset_name: Is the name of the dataset file. +query: Query to make in MongoDB(default: empty query) +limit: Number of rows to return in pagination(default: 10) (maximum is +set at 20 rows per request) +skip: Number of rows to skip in pagination(default: 0)

+ +

return: A page with some tuples or registers inside or an error if there +is no such dataset. The current page is also returned to be used in +future content requests.

+
+ + +
+
+
#   + + + def + wait(self, dataset_name: str, timeout: int = None) -> dict: +
+ +
+ View Source +
    def wait(self, dataset_name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the insert_dataset_async method.
+
+           dataset_name: Represents the dataset name.
+           timeout: Represents the time in seconds to wait for a dataset
+           download to finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct execution of a pipeline
+        """
+        return self.__observer.wait(dataset_name, timeout)
+
+ +
+ +

description: This method is responsible to create a synchronization +barrier for the insert_dataset_async method.

+ +

dataset_name: Represents the dataset name. +timeout: Represents the time in seconds to wait for a dataset +download to finish its run.

+ +

return: JSON object with an error message, a warning message or a +correct execution of a pipeline

+
+ + +
+
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/dataset/csv.html b/docs/old/learning_orchestra_client/dataset/csv.html new file mode 100644 index 0000000..5ff6267 --- /dev/null +++ b/docs/old/learning_orchestra_client/dataset/csv.html @@ -0,0 +1,322 @@ + + + + + + + learning_orchestra_client.dataset.csv API documentation + + + + + + + + +
+
+

+learning_orchestra_client.dataset.csv

+ + +
+ View Source +
from ._dataset import Dataset
+
+
+class DatasetCsv(Dataset):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/dataset/csv"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ +
+
+ + +
+ View Source +
class DatasetCsv(Dataset):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/dataset/csv"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+
#   + + + DatasetCsv(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/dataset/csv"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/dataset/generic.html b/docs/old/learning_orchestra_client/dataset/generic.html new file mode 100644 index 0000000..8c8f6ee --- /dev/null +++ b/docs/old/learning_orchestra_client/dataset/generic.html @@ -0,0 +1,322 @@ + + + + + + + learning_orchestra_client.dataset.generic API documentation + + + + + + + + +
+
+

+learning_orchestra_client.dataset.generic

+ + +
+ View Source +
from ._dataset import Dataset
+
+
+class DatasetGeneric(Dataset):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/dataset/generic"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ +
+
+
+ #   + + + class + DatasetGeneric(learning_orchestra_client.dataset._dataset.Dataset): +
+ +
+ View Source +
class DatasetGeneric(Dataset):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/dataset/generic"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+
#   + + + DatasetGeneric(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/dataset/generic"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/evaluate.html b/docs/old/learning_orchestra_client/evaluate.html new file mode 100644 index 0000000..4fa007f --- /dev/null +++ b/docs/old/learning_orchestra_client/evaluate.html @@ -0,0 +1,244 @@ + + + + + + + learning_orchestra_client.evaluate API documentation + + + + + + + + +
+
+

+learning_orchestra_client.evaluate

+ + + +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/evaluate/_evaluate.html b/docs/old/learning_orchestra_client/evaluate/_evaluate.html new file mode 100644 index 0000000..3cfdb4e --- /dev/null +++ b/docs/old/learning_orchestra_client/evaluate/_evaluate.html @@ -0,0 +1,986 @@ + + + + + + + learning_orchestra_client.evaluate._evaluate API documentation + + + + + + + + +
+
+

+learning_orchestra_client.evaluate._evaluate

+ + +
+ View Source +
from learning_orchestra_client.observe.observe import Observer
+from learning_orchestra_client._util._response_treat import ResponseTreat
+from learning_orchestra_client._util._entity_reader import EntityReader
+import requests
+from typing import Union
+
+
+class Evaluate:
+    __PARENT_NAME_FIELD = "parentName"
+    __MODEL_NAME_FIELD = "modelName"
+    __METHOD_NAME_FIELD = "method"
+    __ClASS_PARAMETERS_FIELD = "methodParameters"
+    __NAME_FIELD = "name"
+    __DESCRIPTION_FIELD = "description"
+
+    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def create_evaluate_sync(self,
+                             name: str,
+                             model_name: str,
+                             parent_name: str,
+                             method_name: str,
+                             parameters: dict,
+                             description: str = "",
+                             pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method runs an evaluation about a model in sync mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model that will be evaluated.
+        parent_name: The name of the previous pipe in the pipeline
+        method_name: the name of the ML tool method used to evaluate a model
+        parameters: the set of parameters of the ML method defined previously
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def create_evaluate_async(self,
+                              name: str,
+                              model_name: str,
+                              parent_name: str,
+                              method_name: str,
+                              parameters: dict,
+                              description: str = "",
+                              pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method runs an evaluation about a model in async mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model that will be evaluated.
+        parent_name: The name of the previous pipe in the pipeline
+        method_name: the name of the ML tool method used to evaluate a model
+        parameters: the set of parameters of the ML method defined previously
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_evaluates(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all created evaluations, i.e., it
+        does not retrieve the specific evaluation content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All datasets metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_evaluate(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting an evaluation
+        result. This delete operation is asynchronous, so it does not lock the
+        caller until the deletion finished. Instead, it returns a JSON object
+        with a URL for a future use. The caller uses the wait method for delete
+        checks. If a dataset was used by another task (Ex. projection,
+        histogram, tune, and so forth), it cannot be deleted.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the model name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_evaluate_content(self,
+                                name: str,
+                                query: dict = {},
+                                limit: int = 10,
+                                skip: int = 0,
+                                pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving the evaluation
+        content
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model.
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some metadata inside or an error if there
+        is no such dataset. The current page is also returned to be used in
+        future content requests.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the create_evaluate_async method and
+           delete_evaluate_async method.
+
+           name: Represents the model name.
+           timeout: Represents the time in seconds to wait for an evaluation to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct evaluation result
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ +
+
+
+ #   + + + class + Evaluate: +
+ +
+ View Source +
class Evaluate:
+    __PARENT_NAME_FIELD = "parentName"
+    __MODEL_NAME_FIELD = "modelName"
+    __METHOD_NAME_FIELD = "method"
+    __ClASS_PARAMETERS_FIELD = "methodParameters"
+    __NAME_FIELD = "name"
+    __DESCRIPTION_FIELD = "description"
+
+    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def create_evaluate_sync(self,
+                             name: str,
+                             model_name: str,
+                             parent_name: str,
+                             method_name: str,
+                             parameters: dict,
+                             description: str = "",
+                             pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method runs an evaluation about a model in sync mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model that will be evaluated.
+        parent_name: The name of the previous pipe in the pipeline
+        method_name: the name of the ML tool method used to evaluate a model
+        parameters: the set of parameters of the ML method defined previously
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def create_evaluate_async(self,
+                              name: str,
+                              model_name: str,
+                              parent_name: str,
+                              method_name: str,
+                              parameters: dict,
+                              description: str = "",
+                              pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method runs an evaluation about a model in async mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model that will be evaluated.
+        parent_name: The name of the previous pipe in the pipeline
+        method_name: the name of the ML tool method used to evaluate a model
+        parameters: the set of parameters of the ML method defined previously
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_evaluates(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all created evaluations, i.e., it
+        does not retrieve the specific evaluation content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All datasets metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_evaluate(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting an evaluation
+        result. This delete operation is asynchronous, so it does not lock the
+        caller until the deletion finished. Instead, it returns a JSON object
+        with a URL for a future use. The caller uses the wait method for delete
+        checks. If a dataset was used by another task (Ex. projection,
+        histogram, tune, and so forth), it cannot be deleted.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the model name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_evaluate_content(self,
+                                name: str,
+                                query: dict = {},
+                                limit: int = 10,
+                                skip: int = 0,
+                                pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving the evaluation
+        content
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model.
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some metadata inside or an error if there
+        is no such dataset. The current page is also returned to be used in
+        future content requests.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the create_evaluate_async method and
+           delete_evaluate_async method.
+
+           name: Represents the model name.
+           timeout: Represents the time in seconds to wait for an evaluation to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct evaluation result
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ + + +
+
#   + + + Evaluate(cluster_ip: str, api_path: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+ +
+ + + +
+
+
#   + + + def + create_evaluate_sync( + self, + name: str, + model_name: str, + parent_name: str, + method_name: str, + parameters: dict, + description: str = '', + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def create_evaluate_sync(self,
+                             name: str,
+                             model_name: str,
+                             parent_name: str,
+                             method_name: str,
+                             parameters: dict,
+                             description: str = "",
+                             pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method runs an evaluation about a model in sync mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model that will be evaluated.
+        parent_name: The name of the previous pipe in the pipeline
+        method_name: the name of the ML tool method used to evaluate a model
+        parameters: the set of parameters of the ML method defined previously
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method runs an evaluation about a model in sync mode

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the model that will be evaluated. +parent_name: The name of the previous pipe in the pipeline +method_name: the name of the ML tool method used to evaluate a model +parameters: the set of parameters of the ML method defined previously

+ +

return: A JSON object with an error or warning message or a URL +indicating the correct operation.

+
+ + +
+
+
#   + + + def + create_evaluate_async( + self, + name: str, + model_name: str, + parent_name: str, + method_name: str, + parameters: dict, + description: str = '', + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def create_evaluate_async(self,
+                              name: str,
+                              model_name: str,
+                              parent_name: str,
+                              method_name: str,
+                              parameters: dict,
+                              description: str = "",
+                              pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method runs an evaluation about a model in async mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model that will be evaluated.
+        parent_name: The name of the previous pipe in the pipeline
+        method_name: the name of the ML tool method used to evaluate a model
+        parameters: the set of parameters of the ML method defined previously
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method runs an evaluation about a model in async mode

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the model that will be evaluated. +parent_name: The name of the previous pipe in the pipeline +method_name: the name of the ML tool method used to evaluate a model +parameters: the set of parameters of the ML method defined previously

+ +

return: A JSON object with an error or warning message or a URL +indicating the correct operation.

+
+ + +
+
+
#   + + + def + search_all_evaluates(self, pretty_response: bool = False) -> Union[dict, str]: +
+ +
+ View Source +
    def search_all_evaluates(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all created evaluations, i.e., it
+        does not retrieve the specific evaluation content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All datasets metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method retrieves all created evaluations, i.e., it +does not retrieve the specific evaluation content.

+ +

pretty_response: If true it returns a string, otherwise a dictionary.

+ +

return: All datasets metadata stored in Learning Orchestra or an empty +result.

+
+ + +
+
+
#   + + + def + delete_evaluate(self, name: str, pretty_response=False) -> Union[dict, str]: +
+ +
+ View Source +
    def delete_evaluate(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting an evaluation
+        result. This delete operation is asynchronous, so it does not lock the
+        caller until the deletion finished. Instead, it returns a JSON object
+        with a URL for a future use. The caller uses the wait method for delete
+        checks. If a dataset was used by another task (Ex. projection,
+        histogram, tune, and so forth), it cannot be deleted.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the model name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for deleting an evaluation +result. This delete operation is asynchronous, so it does not lock the +caller until the deletion finished. Instead, it returns a JSON object +with a URL for a future use. The caller uses the wait method for delete +checks. If a dataset was used by another task (Ex. projection, +histogram, tune, and so forth), it cannot be deleted.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Represents the model name.

+ +

return: JSON object with an error message, a warning message or a +correct delete message

+
+ + +
+
+
#   + + + def + search_evaluate_content( + self, + name: str, + query: dict = {}, + limit: int = 10, + skip: int = 0, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def search_evaluate_content(self,
+                                name: str,
+                                query: dict = {},
+                                limit: int = 10,
+                                skip: int = 0,
+                                pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving the evaluation
+        content
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model.
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some metadata inside or an error if there
+        is no such dataset. The current page is also returned to be used in
+        future content requests.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for retrieving the evaluation +content

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the model. +query: Query to make in MongoDB(default: empty query) +limit: Number of rows to return in pagination(default: 10) (maximum is +set at 20 rows per request) +skip: Number of rows to skip in pagination(default: 0)

+ +

return: A page with some metadata inside or an error if there +is no such dataset. The current page is also returned to be used in +future content requests.

+
+ + +
+
+
#   + + + def + wait(self, name: str, timeout: int = None) -> dict: +
+ +
+ View Source +
    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the create_evaluate_async method and
+           delete_evaluate_async method.
+
+           name: Represents the model name.
+           timeout: Represents the time in seconds to wait for an evaluation to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct evaluation result
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ +

description: This method is responsible to create a synchronization +barrier for the create_evaluate_async method and +delete_evaluate_async method.

+ +

name: Represents the model name. +timeout: Represents the time in seconds to wait for an evaluation to +finish its run.

+ +

return: JSON object with an error message, a warning message or a +correct evaluation result

+
+ + +
+
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/evaluate/scikitlearn.html b/docs/old/learning_orchestra_client/evaluate/scikitlearn.html new file mode 100644 index 0000000..0bf5533 --- /dev/null +++ b/docs/old/learning_orchestra_client/evaluate/scikitlearn.html @@ -0,0 +1,322 @@ + + + + + + + learning_orchestra_client.evaluate.scikitlearn API documentation + + + + + + + + +
+
+

+learning_orchestra_client.evaluate.scikitlearn

+ + +
+ View Source +
from ._evaluate import Evaluate
+
+
+class EvaluateScikitLearn(Evaluate):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/evaluate/scikitlearn"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ +
+
+
+ #   + + + class + EvaluateScikitLearn(learning_orchestra_client.evaluate._evaluate.Evaluate): +
+ +
+ View Source +
class EvaluateScikitLearn(Evaluate):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/evaluate/scikitlearn"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+
#   + + + EvaluateScikitLearn(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/evaluate/scikitlearn"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/evaluate/tensorflow.html b/docs/old/learning_orchestra_client/evaluate/tensorflow.html new file mode 100644 index 0000000..82604ba --- /dev/null +++ b/docs/old/learning_orchestra_client/evaluate/tensorflow.html @@ -0,0 +1,322 @@ + + + + + + + learning_orchestra_client.evaluate.tensorflow API documentation + + + + + + + + +
+
+

+learning_orchestra_client.evaluate.tensorflow

+ + +
+ View Source +
from ._evaluate import Evaluate
+
+
+class EvaluateTensorflow(Evaluate):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/evaluate/tensorflow"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ +
+
+
+ #   + + + class + EvaluateTensorflow(learning_orchestra_client.evaluate._evaluate.Evaluate): +
+ +
+ View Source +
class EvaluateTensorflow(Evaluate):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/evaluate/tensorflow"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+
#   + + + EvaluateTensorflow(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/evaluate/tensorflow"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/explore.html b/docs/old/learning_orchestra_client/explore.html new file mode 100644 index 0000000..8fd6bb9 --- /dev/null +++ b/docs/old/learning_orchestra_client/explore.html @@ -0,0 +1,245 @@ + + + + + + + learning_orchestra_client.explore API documentation + + + + + + + + +
+
+

+learning_orchestra_client.explore

+ + + +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/explore/_explore.html b/docs/old/learning_orchestra_client/explore/_explore.html new file mode 100644 index 0000000..4c01969 --- /dev/null +++ b/docs/old/learning_orchestra_client/explore/_explore.html @@ -0,0 +1,1043 @@ + + + + + + + learning_orchestra_client.explore._explore API documentation + + + + + + + + +
+
+

+learning_orchestra_client.explore._explore

+ + +
+ View Source +
from learning_orchestra_client.observe.observe import Observer
+from learning_orchestra_client._util._response_treat import ResponseTreat
+from learning_orchestra_client._util._entity_reader import EntityReader
+import requests
+from typing import Union
+
+
+class Explore:
+    __PARENT_NAME_FIELD = "parentName"
+    __MODEL_NAME_FIELD = "modelName"
+    __METHOD_NAME_FIELD = "method"
+    __ClASS_PARAMETERS_FIELD = "methodParameters"
+    __NAME_FIELD = "name"
+    __DESCRIPTION_FIELD = "description"
+
+    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def create_explore_sync(self,
+                            name: str,
+                            model_name: str,
+                            parent_name: str,
+                            method_name: str,
+                            parameters: dict,
+                            description: str = "",
+                            pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method runs an evaluation about a model in sync mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model that will be explored.
+        parent_name: The name of the previous pipe in the pipeline
+        method_name: the name of the ML tool method used to explore a model
+        parameters: the set of parameters of the ML method defined previously
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def create_explore_async(self,
+                             name: str,
+                             model_name: str,
+                             parent_name: str,
+                             method_name: str,
+                             parameters: dict,
+                             description: str = "",
+                             pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method runs an explore service about a model in async
+        mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model that will be explored.
+        parent_name: The name of the previous pipe in the pipeline
+        method_name: the name of the ML tool method used to explore a model
+        parameters: the set of parameters of the ML method defined previously
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_explores(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all created explorations, i.e., it
+        does not retrieve the specific explore content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All datasets metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_explore(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting an explore result.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the wait method for delete
+         checks. If a dataset was used by another task (Ex. projection,
+         histogram, tune and so forth), it cannot be deleted.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the model name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_explore_image(self,
+                             name: str,
+                             pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving the explore
+        image to be plotted
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the explore instance.
+
+        return: An URL with a link for an image or an error if there
+        is no such result.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_explore_metadata(self,
+                                name: str,
+                                pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving the explore
+        metadata image.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the explore instance.
+
+        return: A page with some metadata inside or an error if there
+        is no such dataset. The current page is also returned to be used in
+        future content requests.
+        """
+
+        response = self.__entity_reader.read_explore_image_metadata(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+       description: This method is responsible to create a synchronization
+       barrier for the create_explore_async method, delete_explore_async
+       method.
+
+       name: Represents the model name.
+       timeout: Represents the time in seconds to wait for an explore to
+       finish its run.
+
+       return: JSON object with an error message, a warning message or a
+       correct explore result (the image URL as an explore result)
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ +
+
+
+ #   + + + class + Explore: +
+ +
+ View Source +
class Explore:
+    __PARENT_NAME_FIELD = "parentName"
+    __MODEL_NAME_FIELD = "modelName"
+    __METHOD_NAME_FIELD = "method"
+    __ClASS_PARAMETERS_FIELD = "methodParameters"
+    __NAME_FIELD = "name"
+    __DESCRIPTION_FIELD = "description"
+
+    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def create_explore_sync(self,
+                            name: str,
+                            model_name: str,
+                            parent_name: str,
+                            method_name: str,
+                            parameters: dict,
+                            description: str = "",
+                            pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method runs an evaluation about a model in sync mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model that will be explored.
+        parent_name: The name of the previous pipe in the pipeline
+        method_name: the name of the ML tool method used to explore a model
+        parameters: the set of parameters of the ML method defined previously
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def create_explore_async(self,
+                             name: str,
+                             model_name: str,
+                             parent_name: str,
+                             method_name: str,
+                             parameters: dict,
+                             description: str = "",
+                             pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method runs an explore service about a model in async
+        mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model that will be explored.
+        parent_name: The name of the previous pipe in the pipeline
+        method_name: the name of the ML tool method used to explore a model
+        parameters: the set of parameters of the ML method defined previously
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_explores(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all created explorations, i.e., it
+        does not retrieve the specific explore content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All datasets metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_explore(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting an explore result.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the wait method for delete
+         checks. If a dataset was used by another task (Ex. projection,
+         histogram, tune and so forth), it cannot be deleted.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the model name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_explore_image(self,
+                             name: str,
+                             pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving the explore
+        image to be plotted
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the explore instance.
+
+        return: An URL with a link for an image or an error if there
+        is no such result.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_explore_metadata(self,
+                                name: str,
+                                pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving the explore
+        metadata image.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the explore instance.
+
+        return: A page with some metadata inside or an error if there
+        is no such dataset. The current page is also returned to be used in
+        future content requests.
+        """
+
+        response = self.__entity_reader.read_explore_image_metadata(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+       description: This method is responsible to create a synchronization
+       barrier for the create_explore_async method, delete_explore_async
+       method.
+
+       name: Represents the model name.
+       timeout: Represents the time in seconds to wait for an explore to
+       finish its run.
+
+       return: JSON object with an error message, a warning message or a
+       correct explore result (the image URL as an explore result)
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ + + +
+
#   + + + Explore(cluster_ip: str, api_path: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+ +
+ + + +
+
+
#   + + + def + create_explore_sync( + self, + name: str, + model_name: str, + parent_name: str, + method_name: str, + parameters: dict, + description: str = '', + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def create_explore_sync(self,
+                            name: str,
+                            model_name: str,
+                            parent_name: str,
+                            method_name: str,
+                            parameters: dict,
+                            description: str = "",
+                            pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method runs an evaluation about a model in sync mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model that will be explored.
+        parent_name: The name of the previous pipe in the pipeline
+        method_name: the name of the ML tool method used to explore a model
+        parameters: the set of parameters of the ML method defined previously
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method runs an evaluation about a model in sync mode

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the model that will be explored. +parent_name: The name of the previous pipe in the pipeline +method_name: the name of the ML tool method used to explore a model +parameters: the set of parameters of the ML method defined previously

+ +

return: A JSON object with an error or warning message or a URL +indicating the correct operation.

+
+ + +
+
+
#   + + + def + create_explore_async( + self, + name: str, + model_name: str, + parent_name: str, + method_name: str, + parameters: dict, + description: str = '', + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def create_explore_async(self,
+                             name: str,
+                             model_name: str,
+                             parent_name: str,
+                             method_name: str,
+                             parameters: dict,
+                             description: str = "",
+                             pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method runs an explore service about a model in async
+        mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model that will be explored.
+        parent_name: The name of the previous pipe in the pipeline
+        method_name: the name of the ML tool method used to explore a model
+        parameters: the set of parameters of the ML method defined previously
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method runs an explore service about a model in async +mode

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the model that will be explored. +parent_name: The name of the previous pipe in the pipeline +method_name: the name of the ML tool method used to explore a model +parameters: the set of parameters of the ML method defined previously

+ +

return: A JSON object with an error or warning message or a URL +indicating the correct operation.

+
+ + +
+
+
#   + + + def + search_all_explores(self, pretty_response: bool = False) -> Union[dict, str]: +
+ +
+ View Source +
    def search_all_explores(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all created explorations, i.e., it
+        does not retrieve the specific explore content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All datasets metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method retrieves all created explorations, i.e., it +does not retrieve the specific explore content.

+ +

pretty_response: If true it returns a string, otherwise a dictionary.

+ +

return: All datasets metadata stored in Learning Orchestra or an empty +result.

+
+ + +
+
+
#   + + + def + delete_explore(self, name: str, pretty_response=False) -> Union[dict, str]: +
+ +
+ View Source +
    def delete_explore(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting an explore result.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the wait method for delete
+         checks. If a dataset was used by another task (Ex. projection,
+         histogram, tune and so forth), it cannot be deleted.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the model name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for deleting an explore result. +This delete operation is asynchronous, so it does not lock the caller + until the deletion finished. Instead, it returns a JSON object with a + URL for a future use. The caller uses the wait method for delete + checks. If a dataset was used by another task (Ex. projection, + histogram, tune and so forth), it cannot be deleted.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Represents the model name.

+ +

return: JSON object with an error message, a warning message or a +correct delete message

+
+ + +
+
+
#   + + + def + search_explore_image(self, name: str, pretty_response: bool = False) -> Union[dict, str]: +
+ +
+ View Source +
    def search_explore_image(self,
+                             name: str,
+                             pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving the explore
+        image to be plotted
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the explore instance.
+
+        return: An URL with a link for an image or an error if there
+        is no such result.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for retrieving the explore +image to be plotted

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the explore instance.

+ +

return: An URL with a link for an image or an error if there +is no such result.

+
+ + +
+
+
#   + + + def + search_explore_metadata(self, name: str, pretty_response: bool = False) -> Union[dict, str]: +
+ +
+ View Source +
    def search_explore_metadata(self,
+                                name: str,
+                                pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving the explore
+        metadata image.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the explore instance.
+
+        return: A page with some metadata inside or an error if there
+        is no such dataset. The current page is also returned to be used in
+        future content requests.
+        """
+
+        response = self.__entity_reader.read_explore_image_metadata(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for retrieving the explore +metadata image.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the explore instance.

+ +

return: A page with some metadata inside or an error if there +is no such dataset. The current page is also returned to be used in +future content requests.

+
+ + +
+
+
#   + + + def + wait(self, name: str, timeout: int = None) -> dict: +
+ +
+ View Source +
    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+       description: This method is responsible to create a synchronization
+       barrier for the create_explore_async method, delete_explore_async
+       method.
+
+       name: Represents the model name.
+       timeout: Represents the time in seconds to wait for an explore to
+       finish its run.
+
+       return: JSON object with an error message, a warning message or a
+       correct explore result (the image URL as an explore result)
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ +

description: This method is responsible to create a synchronization +barrier for the create_explore_async method, delete_explore_async +method.

+ +

name: Represents the model name. +timeout: Represents the time in seconds to wait for an explore to +finish its run.

+ +

return: JSON object with an error message, a warning message or a +correct explore result (the image URL as an explore result)

+
+ + +
+
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/explore/histogram.html b/docs/old/learning_orchestra_client/explore/histogram.html new file mode 100644 index 0000000..bc8d715 --- /dev/null +++ b/docs/old/learning_orchestra_client/explore/histogram.html @@ -0,0 +1,953 @@ + + + + + + + learning_orchestra_client.explore.histogram API documentation + + + + + + + + +
+
+

+learning_orchestra_client.explore.histogram

+ + +
+ View Source +
from learning_orchestra_client.observe.observe import Observer
+from learning_orchestra_client._util._response_treat import ResponseTreat
+import requests
+from typing import Union
+from learning_orchestra_client._util._entity_reader import EntityReader
+
+
+class ExploreHistogram:
+    __INPUT_NAME = "inputDatasetName"
+    __OUTPUT_NAME = "outputDatasetName"
+    __FIELDS = "names"
+
+    def __init__(self, cluster_ip: str):
+        self.__cluster_ip = cluster_ip
+        self.__api_path = "/api/learningOrchestra/v1/explore/histogram"
+        self.__service_url = f'{cluster_ip}{self.__api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__observer = Observer(self.__cluster_ip)
+        self.__entity_reader = EntityReader(self.__service_url)
+
+    def run_histogram_sync(self,
+                           dataset_name: str,
+                           histogram_name: str,
+                           fields: list,
+                           pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method creates a histogram
+        synchronously, so the caller waits until the histogram is inserted into
+        the Learning Orchestra storage mechanism.
+
+        dataset_name: Represents the name of dataset.
+        histogram_name: Represents the name of histogram.
+        fields: Represents a list of attributes.
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: A JSON object with error or warning messages. In case of
+        success, it returns a histogram.
+        """
+
+        request_body = {
+            self.__INPUT_NAME: dataset_name,
+            self.__OUTPUT_NAME: histogram_name,
+            self.__FIELDS: fields,
+        }
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(dataset_name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def run_histogram_async(self,
+                            dataset_name: str,
+                            histogram_name: str,
+                            fields: list,
+                            pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method creates a histogram
+        asynchronously, so the caller does not wait until the histogram is
+        inserted into the Learning Orchestra storage mechanism.
+
+        dataset_name: Represents the name of dataset.
+        histogram_name: Represents the name of histogram.
+        fields: Represents a list of attributes.
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: A JSON object with error or warning messages. In case of
+        success, it returns a histogram.
+        """
+
+        request_body = {
+            self.__INPUT_NAME: dataset_name,
+            self.__OUTPUT_NAME: histogram_name,
+            self.__FIELDS: fields,
+        }
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_histograms(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all histogram metadata, it does not
+        retrieve the histogram content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: A list with all histogram metadata stored in Learning Orchestra
+        or an empty result.
+        """
+
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_histogram_content(self,
+                                 histogram_name: str,
+                                 query: dict = {},
+                                 limit: int = 10,
+                                 skip: int = 0,
+                                 pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for retrieving the histogram
+        content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        histogram_name: Represents the histogram name.
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some tuples or registers inside or an error if there
+        is no such projection. The current page is also returned to be used in
+        future content requests.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            histogram_name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_histogram(self, histogram_name: str,
+                         pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting a histogram.
+        The delete operation is always asynchronous,
+        since the deletion is performed in background.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        histogram_name: Represents the histogram name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        cluster_url_histogram = f'{self.__service_url}/{histogram_name}'
+        response = requests.delete(cluster_url_histogram)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the run_histogram_async method or delete_histogram
+           method.
+
+           name: Represents the histogram name.
+           timeout: Represents the time in seconds to wait for a histogram to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct histogram result
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ +
+
+
+ #   + + + class + ExploreHistogram: +
+ +
+ View Source +
class ExploreHistogram:
+    __INPUT_NAME = "inputDatasetName"
+    __OUTPUT_NAME = "outputDatasetName"
+    __FIELDS = "names"
+
+    def __init__(self, cluster_ip: str):
+        self.__cluster_ip = cluster_ip
+        self.__api_path = "/api/learningOrchestra/v1/explore/histogram"
+        self.__service_url = f'{cluster_ip}{self.__api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__observer = Observer(self.__cluster_ip)
+        self.__entity_reader = EntityReader(self.__service_url)
+
+    def run_histogram_sync(self,
+                           dataset_name: str,
+                           histogram_name: str,
+                           fields: list,
+                           pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method creates a histogram
+        synchronously, so the caller waits until the histogram is inserted into
+        the Learning Orchestra storage mechanism.
+
+        dataset_name: Represents the name of dataset.
+        histogram_name: Represents the name of histogram.
+        fields: Represents a list of attributes.
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: A JSON object with error or warning messages. In case of
+        success, it returns a histogram.
+        """
+
+        request_body = {
+            self.__INPUT_NAME: dataset_name,
+            self.__OUTPUT_NAME: histogram_name,
+            self.__FIELDS: fields,
+        }
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(dataset_name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def run_histogram_async(self,
+                            dataset_name: str,
+                            histogram_name: str,
+                            fields: list,
+                            pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method creates a histogram
+        asynchronously, so the caller does not wait until the histogram is
+        inserted into the Learning Orchestra storage mechanism.
+
+        dataset_name: Represents the name of dataset.
+        histogram_name: Represents the name of histogram.
+        fields: Represents a list of attributes.
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: A JSON object with error or warning messages. In case of
+        success, it returns a histogram.
+        """
+
+        request_body = {
+            self.__INPUT_NAME: dataset_name,
+            self.__OUTPUT_NAME: histogram_name,
+            self.__FIELDS: fields,
+        }
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_histograms(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all histogram metadata, it does not
+        retrieve the histogram content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: A list with all histogram metadata stored in Learning Orchestra
+        or an empty result.
+        """
+
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_histogram_content(self,
+                                 histogram_name: str,
+                                 query: dict = {},
+                                 limit: int = 10,
+                                 skip: int = 0,
+                                 pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for retrieving the histogram
+        content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        histogram_name: Represents the histogram name.
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some tuples or registers inside or an error if there
+        is no such projection. The current page is also returned to be used in
+        future content requests.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            histogram_name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_histogram(self, histogram_name: str,
+                         pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting a histogram.
+        The delete operation is always asynchronous,
+        since the deletion is performed in background.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        histogram_name: Represents the histogram name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        cluster_url_histogram = f'{self.__service_url}/{histogram_name}'
+        response = requests.delete(cluster_url_histogram)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the run_histogram_async method or delete_histogram
+           method.
+
+           name: Represents the histogram name.
+           timeout: Represents the time in seconds to wait for a histogram to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct histogram result
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ + + +
+
#   + + + ExploreHistogram(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__cluster_ip = cluster_ip
+        self.__api_path = "/api/learningOrchestra/v1/explore/histogram"
+        self.__service_url = f'{cluster_ip}{self.__api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__observer = Observer(self.__cluster_ip)
+        self.__entity_reader = EntityReader(self.__service_url)
+
+ +
+ + + +
+
+
#   + + + def + run_histogram_sync( + self, + dataset_name: str, + histogram_name: str, + fields: list, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def run_histogram_sync(self,
+                           dataset_name: str,
+                           histogram_name: str,
+                           fields: list,
+                           pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method creates a histogram
+        synchronously, so the caller waits until the histogram is inserted into
+        the Learning Orchestra storage mechanism.
+
+        dataset_name: Represents the name of dataset.
+        histogram_name: Represents the name of histogram.
+        fields: Represents a list of attributes.
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: A JSON object with error or warning messages. In case of
+        success, it returns a histogram.
+        """
+
+        request_body = {
+            self.__INPUT_NAME: dataset_name,
+            self.__OUTPUT_NAME: histogram_name,
+            self.__FIELDS: fields,
+        }
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(dataset_name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method creates a histogram +synchronously, so the caller waits until the histogram is inserted into +the Learning Orchestra storage mechanism.

+ +

dataset_name: Represents the name of dataset. +histogram_name: Represents the name of histogram. +fields: Represents a list of attributes. +pretty_response: If true it returns a string, otherwise a dictionary.

+ +

return: A JSON object with error or warning messages. In case of +success, it returns a histogram.

+
+ + +
+
+
#   + + + def + run_histogram_async( + self, + dataset_name: str, + histogram_name: str, + fields: list, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def run_histogram_async(self,
+                            dataset_name: str,
+                            histogram_name: str,
+                            fields: list,
+                            pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method creates a histogram
+        asynchronously, so the caller does not wait until the histogram is
+        inserted into the Learning Orchestra storage mechanism.
+
+        dataset_name: Represents the name of dataset.
+        histogram_name: Represents the name of histogram.
+        fields: Represents a list of attributes.
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: A JSON object with error or warning messages. In case of
+        success, it returns a histogram.
+        """
+
+        request_body = {
+            self.__INPUT_NAME: dataset_name,
+            self.__OUTPUT_NAME: histogram_name,
+            self.__FIELDS: fields,
+        }
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method creates a histogram +asynchronously, so the caller does not wait until the histogram is +inserted into the Learning Orchestra storage mechanism.

+ +

dataset_name: Represents the name of dataset. +histogram_name: Represents the name of histogram. +fields: Represents a list of attributes. +pretty_response: If true it returns a string, otherwise a dictionary.

+ +

return: A JSON object with error or warning messages. In case of +success, it returns a histogram.

+
+ + +
+
+
#   + + + def + search_all_histograms(self, pretty_response: bool = False) -> Union[dict, str]: +
+ +
+ View Source +
    def search_all_histograms(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all histogram metadata, it does not
+        retrieve the histogram content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: A list with all histogram metadata stored in Learning Orchestra
+        or an empty result.
+        """
+
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method retrieves all histogram metadata, it does not +retrieve the histogram content.

+ +

pretty_response: If true it returns a string, otherwise a dictionary.

+ +

return: A list with all histogram metadata stored in Learning Orchestra +or an empty result.

+
+ + +
+
+
#   + + + def + search_histogram_content( + self, + histogram_name: str, + query: dict = {}, + limit: int = 10, + skip: int = 0, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def search_histogram_content(self,
+                                 histogram_name: str,
+                                 query: dict = {},
+                                 limit: int = 10,
+                                 skip: int = 0,
+                                 pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for retrieving the histogram
+        content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        histogram_name: Represents the histogram name.
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some tuples or registers inside or an error if there
+        is no such projection. The current page is also returned to be used in
+        future content requests.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            histogram_name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for retrieving the histogram +content.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +histogram_name: Represents the histogram name. +query: Query to make in MongoDB(default: empty query) +limit: Number of rows to return in pagination(default: 10) (maximum is +set at 20 rows per request) +skip: Number of rows to skip in pagination(default: 0)

+ +

return: A page with some tuples or registers inside or an error if there +is no such projection. The current page is also returned to be used in +future content requests.

+
+ + +
+
+
#   + + + def + delete_histogram( + self, + histogram_name: str, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def delete_histogram(self, histogram_name: str,
+                         pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting a histogram.
+        The delete operation is always asynchronous,
+        since the deletion is performed in background.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        histogram_name: Represents the histogram name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        cluster_url_histogram = f'{self.__service_url}/{histogram_name}'
+        response = requests.delete(cluster_url_histogram)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for deleting a histogram. +The delete operation is always asynchronous, +since the deletion is performed in background.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +histogram_name: Represents the histogram name.

+ +

return: JSON object with an error message, a warning message or a +correct delete message

+
+ + +
+
+
#   + + + def + wait(self, name: str, timeout: int = None) -> dict: +
+ +
+ View Source +
    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the run_histogram_async method or delete_histogram
+           method.
+
+           name: Represents the histogram name.
+           timeout: Represents the time in seconds to wait for a histogram to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct histogram result
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ +

description: This method is responsible to create a synchronization +barrier for the run_histogram_async method or delete_histogram +method.

+ +

name: Represents the histogram name. +timeout: Represents the time in seconds to wait for a histogram to +finish its run.

+ +

return: JSON object with an error message, a warning message or a +correct histogram result

+
+ + +
+
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/explore/scikitlearn.html b/docs/old/learning_orchestra_client/explore/scikitlearn.html new file mode 100644 index 0000000..565241e --- /dev/null +++ b/docs/old/learning_orchestra_client/explore/scikitlearn.html @@ -0,0 +1,323 @@ + + + + + + + learning_orchestra_client.explore.scikitlearn API documentation + + + + + + + + +
+
+

+learning_orchestra_client.explore.scikitlearn

+ + +
+ View Source +
from ._explore import Explore
+
+
+class ExploreScikitLearn(Explore):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/explore/scikitlearn"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ +
+
+
+ #   + + + class + ExploreScikitLearn(learning_orchestra_client.explore._explore.Explore): +
+ +
+ View Source +
class ExploreScikitLearn(Explore):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/explore/scikitlearn"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+
#   + + + ExploreScikitLearn(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/explore/scikitlearn"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/explore/tensorflow.html b/docs/old/learning_orchestra_client/explore/tensorflow.html new file mode 100644 index 0000000..e3b666c --- /dev/null +++ b/docs/old/learning_orchestra_client/explore/tensorflow.html @@ -0,0 +1,323 @@ + + + + + + + learning_orchestra_client.explore.tensorflow API documentation + + + + + + + + +
+
+

+learning_orchestra_client.explore.tensorflow

+ + +
+ View Source +
from ._explore import Explore
+
+
+class ExploreTensorflow(Explore):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/explore/tensorflow"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ +
+
+
+ #   + + + class + ExploreTensorflow(learning_orchestra_client.explore._explore.Explore): +
+ +
+ View Source +
class ExploreTensorflow(Explore):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/explore/tensorflow"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+
#   + + + ExploreTensorflow(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/explore/tensorflow"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/function.html b/docs/old/learning_orchestra_client/function.html new file mode 100644 index 0000000..5b5b27b --- /dev/null +++ b/docs/old/learning_orchestra_client/function.html @@ -0,0 +1,243 @@ + + + + + + + learning_orchestra_client.function API documentation + + + + + + + + +
+
+

+learning_orchestra_client.function

+ + + +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/function/python.html b/docs/old/learning_orchestra_client/function/python.html new file mode 100644 index 0000000..c607d52 --- /dev/null +++ b/docs/old/learning_orchestra_client/function/python.html @@ -0,0 +1,972 @@ + + + + + + + learning_orchestra_client.function.python API documentation + + + + + + + + +
+
+

+learning_orchestra_client.function.python

+ + +
+ View Source +
from learning_orchestra_client.observe.observe import Observer
+from learning_orchestra_client._util._response_treat import ResponseTreat
+from learning_orchestra_client._util._entity_reader import EntityReader
+import requests
+from typing import Union
+
+
+class FunctionPython:
+    __CODE_FIELD = "function"
+    __PARAMETERS_FIELD = "functionParameters"
+    __NAME_FIELD = "name"
+    __DESCRIPTION_FIELD = "description"
+
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/function/python"
+        self.__service_url = f'{cluster_ip}{self.__api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def run_function_sync(self,
+                          name: str,
+                          parameters: dict,
+                          code: str,
+                          description: str = "",
+                          pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method runs a python 3 code in sync mode, so it
+        represents a wildcard for the data scientist. It can be used when
+        train, predict, tune, explore or any other pipe must be customized. The
+        function is also useful for new pipes. pretty_response: If true it
+        returns a string, otherwise a dictionary.
+
+        name: Is the name of the object stored in Learning Orchestra storage
+        system (volume or mongoDB).
+        url: Url to CSV file.
+
+        return: A JSON object with an error or warning message or the correct
+        operation result.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__PARAMETERS_FIELD: parameters,
+            self.__CODE_FIELD: code,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def run_function_async(self,
+                           name: str,
+                           parameters: dict,
+                           code: str,
+                           description: str = "",
+                           pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method runs a python 3 code in async mode, so it
+        represents a wildcard for the data scientist. It does not lock the
+        caller, so a wait method must be used. It can be used when train,
+        predict, tune, explore or any other pipe must be customized. The
+        function is also useful for new pipes.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the function to be called
+        code: the Python code
+        parameters: the parameters of the function being called
+
+        return: A JSON object with an error or warning message or the correct
+        operation result.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__PARAMETERS_FIELD: parameters,
+            self.__CODE_FIELD: code,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_executions(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all created functions metadata,
+        i.e., it does not retrieve the function result content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All function executions metadata stored in Learning Orchestra
+        or an empty result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_execution(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting the function.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the function name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_execution_content(self,
+                                 name: str,
+                                 query: dict = {},
+                                 limit: int = 10,
+                                 skip: int = 0,
+                                 pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving the function
+        results, including metadata. A function is executed many times, using
+        different parameters,
+        thus many results are stored
+        in Learning Orchestra.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the function.
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return:
+         A page with some function results inside or an error if there
+        is no such function. The current page is also returned to be used in
+        future content requests.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, dataset_name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the run_function_async method or delete_function method.
+
+           name: Represents the function name.
+           timeout: Represents the time in seconds to wait for a function to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct function result
+        """
+        return self.__observer.wait(dataset_name, timeout)
+
+ +
+ +
+
+
+ #   + + + class + FunctionPython: +
+ +
+ View Source +
class FunctionPython:
+    __CODE_FIELD = "function"
+    __PARAMETERS_FIELD = "functionParameters"
+    __NAME_FIELD = "name"
+    __DESCRIPTION_FIELD = "description"
+
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/function/python"
+        self.__service_url = f'{cluster_ip}{self.__api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def run_function_sync(self,
+                          name: str,
+                          parameters: dict,
+                          code: str,
+                          description: str = "",
+                          pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method runs a python 3 code in sync mode, so it
+        represents a wildcard for the data scientist. It can be used when
+        train, predict, tune, explore or any other pipe must be customized. The
+        function is also useful for new pipes. pretty_response: If true it
+        returns a string, otherwise a dictionary.
+
+        name: Is the name of the object stored in Learning Orchestra storage
+        system (volume or mongoDB).
+        url: Url to CSV file.
+
+        return: A JSON object with an error or warning message or the correct
+        operation result.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__PARAMETERS_FIELD: parameters,
+            self.__CODE_FIELD: code,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def run_function_async(self,
+                           name: str,
+                           parameters: dict,
+                           code: str,
+                           description: str = "",
+                           pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method runs a python 3 code in async mode, so it
+        represents a wildcard for the data scientist. It does not lock the
+        caller, so a wait method must be used. It can be used when train,
+        predict, tune, explore or any other pipe must be customized. The
+        function is also useful for new pipes.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the function to be called
+        code: the Python code
+        parameters: the parameters of the function being called
+
+        return: A JSON object with an error or warning message or the correct
+        operation result.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__PARAMETERS_FIELD: parameters,
+            self.__CODE_FIELD: code,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_executions(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all created functions metadata,
+        i.e., it does not retrieve the function result content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All function executions metadata stored in Learning Orchestra
+        or an empty result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_execution(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting the function.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the function name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_execution_content(self,
+                                 name: str,
+                                 query: dict = {},
+                                 limit: int = 10,
+                                 skip: int = 0,
+                                 pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving the function
+        results, including metadata. A function is executed many times, using
+        different parameters,
+        thus many results are stored
+        in Learning Orchestra.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the function.
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return:
+         A page with some function results inside or an error if there
+        is no such function. The current page is also returned to be used in
+        future content requests.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, dataset_name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the run_function_async method or delete_function method.
+
+           name: Represents the function name.
+           timeout: Represents the time in seconds to wait for a function to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct function result
+        """
+        return self.__observer.wait(dataset_name, timeout)
+
+ +
+ + + +
+
#   + + + FunctionPython(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/function/python"
+        self.__service_url = f'{cluster_ip}{self.__api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+ +
+ + + +
+
+
#   + + + def + run_function_sync( + self, + name: str, + parameters: dict, + code: str, + description: str = '', + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def run_function_sync(self,
+                          name: str,
+                          parameters: dict,
+                          code: str,
+                          description: str = "",
+                          pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method runs a python 3 code in sync mode, so it
+        represents a wildcard for the data scientist. It can be used when
+        train, predict, tune, explore or any other pipe must be customized. The
+        function is also useful for new pipes. pretty_response: If true it
+        returns a string, otherwise a dictionary.
+
+        name: Is the name of the object stored in Learning Orchestra storage
+        system (volume or mongoDB).
+        url: Url to CSV file.
+
+        return: A JSON object with an error or warning message or the correct
+        operation result.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__PARAMETERS_FIELD: parameters,
+            self.__CODE_FIELD: code,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method runs a python 3 code in sync mode, so it +represents a wildcard for the data scientist. It can be used when +train, predict, tune, explore or any other pipe must be customized. The +function is also useful for new pipes. pretty_response: If true it +returns a string, otherwise a dictionary.

+ +

name: Is the name of the object stored in Learning Orchestra storage +system (volume or mongoDB). +url: Url to CSV file.

+ +

return: A JSON object with an error or warning message or the correct +operation result.

+
+ + +
+
+
#   + + + def + run_function_async( + self, + name: str, + parameters: dict, + code: str, + description: str = '', + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def run_function_async(self,
+                           name: str,
+                           parameters: dict,
+                           code: str,
+                           description: str = "",
+                           pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method runs a python 3 code in async mode, so it
+        represents a wildcard for the data scientist. It does not lock the
+        caller, so a wait method must be used. It can be used when train,
+        predict, tune, explore or any other pipe must be customized. The
+        function is also useful for new pipes.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the function to be called
+        code: the Python code
+        parameters: the parameters of the function being called
+
+        return: A JSON object with an error or warning message or the correct
+        operation result.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__PARAMETERS_FIELD: parameters,
+            self.__CODE_FIELD: code,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method runs a python 3 code in async mode, so it +represents a wildcard for the data scientist. It does not lock the +caller, so a wait method must be used. It can be used when train, +predict, tune, explore or any other pipe must be customized. The +function is also useful for new pipes.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the function to be called +code: the Python code +parameters: the parameters of the function being called

+ +

return: A JSON object with an error or warning message or the correct +operation result.

+
+ + +
+
+
#   + + + def + search_all_executions(self, pretty_response: bool = False) -> Union[dict, str]: +
+ +
+ View Source +
    def search_all_executions(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all created functions metadata,
+        i.e., it does not retrieve the function result content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All function executions metadata stored in Learning Orchestra
+        or an empty result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method retrieves all created functions metadata, +i.e., it does not retrieve the function result content.

+ +

pretty_response: If true it returns a string, otherwise a dictionary.

+ +

return: All function executions metadata stored in Learning Orchestra +or an empty result.

+
+ + +
+
+
#   + + + def + delete_execution(self, name: str, pretty_response=False) -> Union[dict, str]: +
+ +
+ View Source +
    def delete_execution(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting the function.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the function name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for deleting the function. +This delete operation is asynchronous, so it does not lock the caller + until the deletion finished. Instead, it returns a JSON object with a + URL for a future use. The caller uses the URL for delete checks.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Represents the function name.

+ +

return: JSON object with an error message, a warning message or a +correct delete message

+
+ + +
+
+
#   + + + def + search_execution_content( + self, + name: str, + query: dict = {}, + limit: int = 10, + skip: int = 0, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def search_execution_content(self,
+                                 name: str,
+                                 query: dict = {},
+                                 limit: int = 10,
+                                 skip: int = 0,
+                                 pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving the function
+        results, including metadata. A function is executed many times, using
+        different parameters,
+        thus many results are stored
+        in Learning Orchestra.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the function.
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return:
+         A page with some function results inside or an error if there
+        is no such function. The current page is also returned to be used in
+        future content requests.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for retrieving the function +results, including metadata. A function is executed many times, using +different parameters, +thus many results are stored +in Learning Orchestra.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the function. +query: Query to make in MongoDB(default: empty query) +limit: Number of rows to return in pagination(default: 10) (maximum is +set at 20 rows per request) +skip: Number of rows to skip in pagination(default: 0)

+ +

return: + A page with some function results inside or an error if there +is no such function. The current page is also returned to be used in +future content requests.

+
+ + +
+
+
#   + + + def + wait(self, dataset_name: str, timeout: int = None) -> dict: +
+ +
+ View Source +
    def wait(self, dataset_name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the run_function_async method or delete_function method.
+
+           name: Represents the function name.
+           timeout: Represents the time in seconds to wait for a function to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct function result
+        """
+        return self.__observer.wait(dataset_name, timeout)
+
+ +
+ +

description: This method is responsible to create a synchronization +barrier for the run_function_async method or delete_function method.

+ +

name: Represents the function name. +timeout: Represents the time in seconds to wait for a function to +finish its run.

+ +

return: JSON object with an error message, a warning message or a +correct function result

+
+ + +
+
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/model.html b/docs/old/learning_orchestra_client/model.html new file mode 100644 index 0000000..2ff8986 --- /dev/null +++ b/docs/old/learning_orchestra_client/model.html @@ -0,0 +1,244 @@ + + + + + + + learning_orchestra_client.model API documentation + + + + + + + + +
+
+

+learning_orchestra_client.model

+ + + +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/model/_model.html b/docs/old/learning_orchestra_client/model/_model.html new file mode 100644 index 0000000..7420f14 --- /dev/null +++ b/docs/old/learning_orchestra_client/model/_model.html @@ -0,0 +1,933 @@ + + + + + + + learning_orchestra_client.model._model API documentation + + + + + + + + +
+
+

+learning_orchestra_client.model._model

+ + +
+ View Source +
from learning_orchestra_client.observe.observe import Observer
+from learning_orchestra_client._util._response_treat import ResponseTreat
+from learning_orchestra_client._util._entity_reader import EntityReader
+import requests
+from typing import Union
+
+
+class Model:
+    __CLASS_FIELD = "class"
+    __MODULE_PATH_FIELD = "modulePath"
+    __ClASS_PARAMETERS_FIELD = "classParameters"
+    __NAME_FIELD = "modelName"
+    __DESCRIPTION_FIELD = "description"
+
+    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def create_model_sync(self,
+                          name: str,
+                          module_path: str,
+                          class_name: str,
+                          class_parameters: dict,
+                          description: str = "",
+                          pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method runs a model creation in sync mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model that will be created.
+        class_name: is the name of the class to be executed
+        module_path: The name of the package of the ML tool used
+        (Ex. Scikit-learn or TensorFlow)
+        class_parameters: the set of parameters of the ML class defined
+        previously
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__CLASS_FIELD: class_name,
+            self.__MODULE_PATH_FIELD: module_path,
+            self.__ClASS_PARAMETERS_FIELD: class_parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def create_model_async(self,
+                           name: str,
+                           module_path: str,
+                           class_name: str,
+                           class_parameters: dict,
+                           description: str = "",
+                           pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method runs a model creation in async mode, thus it
+        requires a wait method call
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model that will be created.
+        class_name: is the name of the class to be executed
+        module_path: The name of the package of the ML tool used
+        (Ex. Scikit-learn or TensorFlow)
+        class_parameters: the set of parameters of the ML class defined
+        previously
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the future correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__CLASS_FIELD: class_name,
+            self.__MODULE_PATH_FIELD: module_path,
+            self.__ClASS_PARAMETERS_FIELD: class_parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_models(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all models metadata, i.e., it does
+        not retrieve the model content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All models metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_model(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting the model.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the model name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_model(self, name: str, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves a model metadata, i.e., it does
+        not retrieve the model content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the model name
+
+        return: A model metadata stored in Learning Orchestra or an empty
+        result.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the create_model_async method, delete_model method.
+
+           name: Represents the model name.
+           timeout: Represents the time in seconds to wait for a model creation
+           to finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct model result
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ +
+
+
+ #   + + + class + Model: +
+ +
+ View Source +
class Model:
+    __CLASS_FIELD = "class"
+    __MODULE_PATH_FIELD = "modulePath"
+    __ClASS_PARAMETERS_FIELD = "classParameters"
+    __NAME_FIELD = "modelName"
+    __DESCRIPTION_FIELD = "description"
+
+    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def create_model_sync(self,
+                          name: str,
+                          module_path: str,
+                          class_name: str,
+                          class_parameters: dict,
+                          description: str = "",
+                          pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method runs a model creation in sync mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model that will be created.
+        class_name: is the name of the class to be executed
+        module_path: The name of the package of the ML tool used
+        (Ex. Scikit-learn or TensorFlow)
+        class_parameters: the set of parameters of the ML class defined
+        previously
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__CLASS_FIELD: class_name,
+            self.__MODULE_PATH_FIELD: module_path,
+            self.__ClASS_PARAMETERS_FIELD: class_parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def create_model_async(self,
+                           name: str,
+                           module_path: str,
+                           class_name: str,
+                           class_parameters: dict,
+                           description: str = "",
+                           pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method runs a model creation in async mode, thus it
+        requires a wait method call
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model that will be created.
+        class_name: is the name of the class to be executed
+        module_path: The name of the package of the ML tool used
+        (Ex. Scikit-learn or TensorFlow)
+        class_parameters: the set of parameters of the ML class defined
+        previously
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the future correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__CLASS_FIELD: class_name,
+            self.__MODULE_PATH_FIELD: module_path,
+            self.__ClASS_PARAMETERS_FIELD: class_parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_models(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all models metadata, i.e., it does
+        not retrieve the model content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All models metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_model(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting the model.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the model name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_model(self, name: str, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves a model metadata, i.e., it does
+        not retrieve the model content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the model name
+
+        return: A model metadata stored in Learning Orchestra or an empty
+        result.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the create_model_async method, delete_model method.
+
+           name: Represents the model name.
+           timeout: Represents the time in seconds to wait for a model creation
+           to finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct model result
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ + + +
+
#   + + + Model(cluster_ip: str, api_path: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+ +
+ + + +
+
+
#   + + + def + create_model_sync( + self, + name: str, + module_path: str, + class_name: str, + class_parameters: dict, + description: str = '', + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def create_model_sync(self,
+                          name: str,
+                          module_path: str,
+                          class_name: str,
+                          class_parameters: dict,
+                          description: str = "",
+                          pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method runs a model creation in sync mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model that will be created.
+        class_name: is the name of the class to be executed
+        module_path: The name of the package of the ML tool used
+        (Ex. Scikit-learn or TensorFlow)
+        class_parameters: the set of parameters of the ML class defined
+        previously
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__CLASS_FIELD: class_name,
+            self.__MODULE_PATH_FIELD: module_path,
+            self.__ClASS_PARAMETERS_FIELD: class_parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method runs a model creation in sync mode

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the model that will be created. +class_name: is the name of the class to be executed +module_path: The name of the package of the ML tool used +(Ex. Scikit-learn or TensorFlow) +class_parameters: the set of parameters of the ML class defined +previously

+ +

return: A JSON object with an error or warning message or a URL +indicating the correct operation.

+
+ + +
+
+
#   + + + def + create_model_async( + self, + name: str, + module_path: str, + class_name: str, + class_parameters: dict, + description: str = '', + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def create_model_async(self,
+                           name: str,
+                           module_path: str,
+                           class_name: str,
+                           class_parameters: dict,
+                           description: str = "",
+                           pretty_response: bool = False) -> Union[dict, str]:
+        """
+        description: This method runs a model creation in async mode, thus it
+        requires a wait method call
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the model that will be created.
+        class_name: is the name of the class to be executed
+        module_path: The name of the package of the ML tool used
+        (Ex. Scikit-learn or TensorFlow)
+        class_parameters: the set of parameters of the ML class defined
+        previously
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the future correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__CLASS_FIELD: class_name,
+            self.__MODULE_PATH_FIELD: module_path,
+            self.__ClASS_PARAMETERS_FIELD: class_parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method runs a model creation in async mode, thus it +requires a wait method call

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the model that will be created. +class_name: is the name of the class to be executed +module_path: The name of the package of the ML tool used +(Ex. Scikit-learn or TensorFlow) +class_parameters: the set of parameters of the ML class defined +previously

+ +

return: A JSON object with an error or warning message or a URL +indicating the future correct operation.

+
+ + +
+
+
#   + + + def + search_all_models(self, pretty_response: bool = False) -> Union[dict, str]: +
+ +
+ View Source +
    def search_all_models(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all models metadata, i.e., it does
+        not retrieve the model content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All models metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method retrieves all models metadata, i.e., it does +not retrieve the model content.

+ +

pretty_response: If true it returns a string, otherwise a dictionary.

+ +

return: All models metadata stored in Learning Orchestra or an empty +result.

+
+ + +
+
+
#   + + + def + delete_model(self, name: str, pretty_response=False) -> Union[dict, str]: +
+ +
+ View Source +
    def delete_model(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting the model.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the model name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for deleting the model. +This delete operation is asynchronous, so it does not lock the caller + until the deletion finished. Instead, it returns a JSON object with a + URL for a future use. The caller uses the URL for delete checks.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Represents the model name.

+ +

return: JSON object with an error message, a warning message or a +correct delete message

+
+ + +
+
+
#   + + + def + search_model(self, name: str, pretty_response: bool = False) -> Union[dict, str]: +
+ +
+ View Source +
    def search_model(self, name: str, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves a model metadata, i.e., it does
+        not retrieve the model content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the model name
+
+        return: A model metadata stored in Learning Orchestra or an empty
+        result.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method retrieves a model metadata, i.e., it does +not retrieve the model content.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the model name

+ +

return: A model metadata stored in Learning Orchestra or an empty +result.

+
+ + +
+
+
#   + + + def + wait(self, name: str, timeout: int = None) -> dict: +
+ +
+ View Source +
    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the create_model_async method, delete_model method.
+
+           name: Represents the model name.
+           timeout: Represents the time in seconds to wait for a model creation
+           to finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct model result
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ +

description: This method is responsible to create a synchronization +barrier for the create_model_async method, delete_model method.

+ +

name: Represents the model name. +timeout: Represents the time in seconds to wait for a model creation +to finish its run.

+ +

return: JSON object with an error message, a warning message or a +correct model result

+
+ + +
+
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/model/scikitlearn.html b/docs/old/learning_orchestra_client/model/scikitlearn.html new file mode 100644 index 0000000..cf141b6 --- /dev/null +++ b/docs/old/learning_orchestra_client/model/scikitlearn.html @@ -0,0 +1,322 @@ + + + + + + + learning_orchestra_client.model.scikitlearn API documentation + + + + + + + + +
+
+

+learning_orchestra_client.model.scikitlearn

+ + +
+ View Source +
from ._model import Model
+
+
+class ModelScikitLearn(Model):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/model/scikitlearn"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ +
+
+
+ #   + + + class + ModelScikitLearn(learning_orchestra_client.model._model.Model): +
+ +
+ View Source +
class ModelScikitLearn(Model):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/model/scikitlearn"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+
#   + + + ModelScikitLearn(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/model/scikitlearn"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/model/tensorflow.html b/docs/old/learning_orchestra_client/model/tensorflow.html new file mode 100644 index 0000000..93d0de0 --- /dev/null +++ b/docs/old/learning_orchestra_client/model/tensorflow.html @@ -0,0 +1,322 @@ + + + + + + + learning_orchestra_client.model.tensorflow API documentation + + + + + + + + +
+
+

+learning_orchestra_client.model.tensorflow

+ + +
+ View Source +
from ._model import Model
+
+
+class ModelTensorflow(Model):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/model/tensorflow"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ +
+
+
+ #   + + + class + ModelTensorflow(learning_orchestra_client.model._model.Model): +
+ +
+ View Source +
class ModelTensorflow(Model):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/model/tensorflow"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+
#   + + + ModelTensorflow(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/model/tensorflow"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/observe.html b/docs/old/learning_orchestra_client/observe.html new file mode 100644 index 0000000..a77446e --- /dev/null +++ b/docs/old/learning_orchestra_client/observe.html @@ -0,0 +1,243 @@ + + + + + + + learning_orchestra_client.observe API documentation + + + + + + + + +
+
+

+learning_orchestra_client.observe

+ + + +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/observe/observe.html b/docs/old/learning_orchestra_client/observe/observe.html new file mode 100644 index 0000000..3f2c07d --- /dev/null +++ b/docs/old/learning_orchestra_client/observe/observe.html @@ -0,0 +1,601 @@ + + + + + + + learning_orchestra_client.observe.observe API documentation + + + + + + + + +
+
+

+learning_orchestra_client.observe.observe

+ + +
+ View Source +
from pymongo import MongoClient, change_stream
+
+
+class Observer:
+    __TIMEOUT_TIME_MULTIPLICATION = 1000
+
+    def __init__(self, cluster_ip: str):
+        cluster_ip = cluster_ip.replace("http://", "")
+        mongo_url = f'mongodb://root:owl45%2321@{cluster_ip}'
+        mongo_client = MongoClient(
+            mongo_url
+        )
+
+        self.__database = mongo_client.database
+
+    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+        :description: Observe the end of a pipe for a timeout seconds or
+        until the pipe finishes its execution.
+
+        name: Represents the pipe name. Any tune, train, predict service can
+        wait its finish with a
+        wait method call.
+        timeout: the maximum time to wait the observed step, in seconds.
+
+        :return: If True it returns a String. Otherwise, it returns
+        a dictionary with the content of a mongo collection, representing
+        any pipe result
+        """
+
+        dataset_collection = self.__database[name]
+        metadata_query = {"_id": 0}
+        dataset_metadata = dataset_collection.find_one(metadata_query)
+
+        if dataset_metadata["finished"]:
+            return dataset_metadata
+
+        observer_query = [
+            {'$match': {
+                '$and':
+                    [
+                        {'operationType': 'update'},
+                        {'fullDocument.finished': {'$eq': True}}
+                    ]
+            }}
+        ]
+        return dataset_collection.watch(
+            observer_query,
+            full_document='updateLookup',
+            max_await_time_ms=timeout * self.__TIMEOUT_TIME_MULTIPLICATION
+        ).next()['fullDocument']
+
+    def observe_pipe(self, name: str, timeout: int = None) -> \
+            change_stream.CollectionChangeStream:
+        """
+        :description: It waits until a pipe change its content
+        (replace, insert, update and delete mongoDB collection operation
+        types), so it is a bit different
+        from wait method with a timeout and a finish explicit condition.
+
+        :name: the name of the pipe to be observed. A train, predict, explore,
+        transform or any
+        other pipe can be observed.
+        timeout: the maximum time to wait the observed step, in milliseconds.
+
+        :return: A pymongo CollectionChangeStream object. You must use the
+        builtin next() method to iterate over changes.
+        """
+
+        observer_query = [
+            {'$match': {
+                '$or': [
+                    {'operationType': 'replace'},
+                    {'operationType': 'insert'},
+                    {'operationType': 'update'},
+                    {'operationType': 'delete'}
+
+                ]
+            }}
+        ]
+        return self.__database[name].watch(
+            observer_query,
+            max_await_time_ms=timeout * self.__TIMEOUT_TIME_MULTIPLICATION,
+            full_document='updateLookup')
+
+ +
+ +
+
+
+ #   + + + class + Observer: +
+ +
+ View Source +
class Observer:
+    __TIMEOUT_TIME_MULTIPLICATION = 1000
+
+    def __init__(self, cluster_ip: str):
+        cluster_ip = cluster_ip.replace("http://", "")
+        mongo_url = f'mongodb://root:owl45%2321@{cluster_ip}'
+        mongo_client = MongoClient(
+            mongo_url
+        )
+
+        self.__database = mongo_client.database
+
+    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+        :description: Observe the end of a pipe for a timeout seconds or
+        until the pipe finishes its execution.
+
+        name: Represents the pipe name. Any tune, train, predict service can
+        wait its finish with a
+        wait method call.
+        timeout: the maximum time to wait the observed step, in seconds.
+
+        :return: If True it returns a String. Otherwise, it returns
+        a dictionary with the content of a mongo collection, representing
+        any pipe result
+        """
+
+        dataset_collection = self.__database[name]
+        metadata_query = {"_id": 0}
+        dataset_metadata = dataset_collection.find_one(metadata_query)
+
+        if dataset_metadata["finished"]:
+            return dataset_metadata
+
+        observer_query = [
+            {'$match': {
+                '$and':
+                    [
+                        {'operationType': 'update'},
+                        {'fullDocument.finished': {'$eq': True}}
+                    ]
+            }}
+        ]
+        return dataset_collection.watch(
+            observer_query,
+            full_document='updateLookup',
+            max_await_time_ms=timeout * self.__TIMEOUT_TIME_MULTIPLICATION
+        ).next()['fullDocument']
+
+    def observe_pipe(self, name: str, timeout: int = None) -> \
+            change_stream.CollectionChangeStream:
+        """
+        :description: It waits until a pipe change its content
+        (replace, insert, update and delete mongoDB collection operation
+        types), so it is a bit different
+        from wait method with a timeout and a finish explicit condition.
+
+        :name: the name of the pipe to be observed. A train, predict, explore,
+        transform or any
+        other pipe can be observed.
+        timeout: the maximum time to wait the observed step, in milliseconds.
+
+        :return: A pymongo CollectionChangeStream object. You must use the
+        builtin next() method to iterate over changes.
+        """
+
+        observer_query = [
+            {'$match': {
+                '$or': [
+                    {'operationType': 'replace'},
+                    {'operationType': 'insert'},
+                    {'operationType': 'update'},
+                    {'operationType': 'delete'}
+
+                ]
+            }}
+        ]
+        return self.__database[name].watch(
+            observer_query,
+            max_await_time_ms=timeout * self.__TIMEOUT_TIME_MULTIPLICATION,
+            full_document='updateLookup')
+
+ +
+ + + +
+
#   + + + Observer(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        cluster_ip = cluster_ip.replace("http://", "")
+        mongo_url = f'mongodb://root:owl45%2321@{cluster_ip}'
+        mongo_client = MongoClient(
+            mongo_url
+        )
+
+        self.__database = mongo_client.database
+
+ +
+ + + +
+
+
#   + + + def + wait(self, name: str, timeout: int = None) -> dict: +
+ +
+ View Source +
    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+        :description: Observe the end of a pipe for a timeout seconds or
+        until the pipe finishes its execution.
+
+        name: Represents the pipe name. Any tune, train, predict service can
+        wait its finish with a
+        wait method call.
+        timeout: the maximum time to wait the observed step, in seconds.
+
+        :return: If True it returns a String. Otherwise, it returns
+        a dictionary with the content of a mongo collection, representing
+        any pipe result
+        """
+
+        dataset_collection = self.__database[name]
+        metadata_query = {"_id": 0}
+        dataset_metadata = dataset_collection.find_one(metadata_query)
+
+        if dataset_metadata["finished"]:
+            return dataset_metadata
+
+        observer_query = [
+            {'$match': {
+                '$and':
+                    [
+                        {'operationType': 'update'},
+                        {'fullDocument.finished': {'$eq': True}}
+                    ]
+            }}
+        ]
+        return dataset_collection.watch(
+            observer_query,
+            full_document='updateLookup',
+            max_await_time_ms=timeout * self.__TIMEOUT_TIME_MULTIPLICATION
+        ).next()['fullDocument']
+
+ +
+ +

:description: Observe the end of a pipe for a timeout seconds or +until the pipe finishes its execution.

+ +

name: Represents the pipe name. Any tune, train, predict service can +wait its finish with a +wait method call. +timeout: the maximum time to wait the observed step, in seconds.

+ +

:return: If True it returns a String. Otherwise, it returns +a dictionary with the content of a mongo collection, representing +any pipe result

+
+ + +
+
+
#   + + + def + observe_pipe( + self, + name: str, + timeout: int = None +) -> pymongo.change_stream.CollectionChangeStream: +
+ +
+ View Source +
    def observe_pipe(self, name: str, timeout: int = None) -> \
+            change_stream.CollectionChangeStream:
+        """
+        :description: It waits until a pipe change its content
+        (replace, insert, update and delete mongoDB collection operation
+        types), so it is a bit different
+        from wait method with a timeout and a finish explicit condition.
+
+        :name: the name of the pipe to be observed. A train, predict, explore,
+        transform or any
+        other pipe can be observed.
+        timeout: the maximum time to wait the observed step, in milliseconds.
+
+        :return: A pymongo CollectionChangeStream object. You must use the
+        builtin next() method to iterate over changes.
+        """
+
+        observer_query = [
+            {'$match': {
+                '$or': [
+                    {'operationType': 'replace'},
+                    {'operationType': 'insert'},
+                    {'operationType': 'update'},
+                    {'operationType': 'delete'}
+
+                ]
+            }}
+        ]
+        return self.__database[name].watch(
+            observer_query,
+            max_await_time_ms=timeout * self.__TIMEOUT_TIME_MULTIPLICATION,
+            full_document='updateLookup')
+
+ +
+ +

:description: It waits until a pipe change its content +(replace, insert, update and delete mongoDB collection operation +types), so it is a bit different +from wait method with a timeout and a finish explicit condition.

+ +

:name: the name of the pipe to be observed. A train, predict, explore, +transform or any +other pipe can be observed. +timeout: the maximum time to wait the observed step, in milliseconds.

+ +

:return: A pymongo CollectionChangeStream object. You must use the +builtin next() method to iterate over changes.

+
+ + +
+
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/predict.html b/docs/old/learning_orchestra_client/predict.html new file mode 100644 index 0000000..5218fc0 --- /dev/null +++ b/docs/old/learning_orchestra_client/predict.html @@ -0,0 +1,244 @@ + + + + + + + learning_orchestra_client.predict API documentation + + + + + + + + +
+
+

+learning_orchestra_client.predict

+ + + +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/predict/_predict.html b/docs/old/learning_orchestra_client/predict/_predict.html new file mode 100644 index 0000000..8499fbe --- /dev/null +++ b/docs/old/learning_orchestra_client/predict/_predict.html @@ -0,0 +1,987 @@ + + + + + + + learning_orchestra_client.predict._predict API documentation + + + + + + + + +
+
+

+learning_orchestra_client.predict._predict

+ + +
+ View Source +
from learning_orchestra_client.observe.observe import Observer
+from learning_orchestra_client._util._response_treat import ResponseTreat
+from learning_orchestra_client._util._entity_reader import EntityReader
+import requests
+from typing import Union
+
+
+class Predict:
+    __MODEL_NAME_FIELD = "modelName"
+    __PARENT_NAME_FIELD = "parentName"
+    __METHOD_NAME_FIELD = "method"
+    __ClASS_PARAMETERS_FIELD = "methodParameters"
+    __NAME_FIELD = "name"
+    __DESCRIPTION_FIELD = "description"
+
+    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def create_prediction_sync(self,
+                               name: str,
+                               model_name: str,
+                               parent_name: str,
+                               method_name: str,
+                               parameters: dict,
+                               description: str = "",
+                               pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method is responsible to predict models in sync mode
+
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the prediction output object that will be created.
+        parent_name: Is the name of the previous ML step of the pipeline
+        method_name: is the name of the method to be executed (the ML tool way
+        to predict models)
+        parameters: Is the set of parameters used by the method
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def create_prediction_async(self,
+                                name: str,
+                                model_name: str,
+                                parent_name: str,
+                                method_name: str,
+                                parameters: dict,
+                                description: str = "",
+                                pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method is responsible to predict models in async mode.
+        A wait method call is mandatory due to the asynchronous aspect.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the prediction output object that will be created.
+        parent_name: Is the name of the previous ML step of the pipeline
+        method_name: is the name of the method to be executed (the ML tool way
+        to predict models)
+        parameters: Is the set of parameters used by the method
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_predictions(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all predictions metadata, i.e., it
+        does not retrieve the prediction content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All predict metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_prediction(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting the prediction.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the prediction name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_prediction_content(self,
+                                  name: str,
+                                  query: dict = {},
+                                  limit: int = 10,
+                                  skip: int = 0,
+                                  pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving all the
+        prediction tuples or registers, as well as the metadata content
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the prediction object
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some predictions inside or an error if there
+        is no such prediction object. The current page is also returned to be
+        used in future content requests.
+        """
+        response = self.__entity_reader.read_entity_content(
+            name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the create_prediction_async method, delete_prediction
+           method.
+
+           name: Represents the prediction name.
+           timeout: Represents the time in seconds to wait for a prediction to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct prediction result
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ +
+
+
+ #   + + + class + Predict: +
+ +
+ View Source +
class Predict:
+    __MODEL_NAME_FIELD = "modelName"
+    __PARENT_NAME_FIELD = "parentName"
+    __METHOD_NAME_FIELD = "method"
+    __ClASS_PARAMETERS_FIELD = "methodParameters"
+    __NAME_FIELD = "name"
+    __DESCRIPTION_FIELD = "description"
+
+    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def create_prediction_sync(self,
+                               name: str,
+                               model_name: str,
+                               parent_name: str,
+                               method_name: str,
+                               parameters: dict,
+                               description: str = "",
+                               pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method is responsible to predict models in sync mode
+
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the prediction output object that will be created.
+        parent_name: Is the name of the previous ML step of the pipeline
+        method_name: is the name of the method to be executed (the ML tool way
+        to predict models)
+        parameters: Is the set of parameters used by the method
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def create_prediction_async(self,
+                                name: str,
+                                model_name: str,
+                                parent_name: str,
+                                method_name: str,
+                                parameters: dict,
+                                description: str = "",
+                                pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method is responsible to predict models in async mode.
+        A wait method call is mandatory due to the asynchronous aspect.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the prediction output object that will be created.
+        parent_name: Is the name of the previous ML step of the pipeline
+        method_name: is the name of the method to be executed (the ML tool way
+        to predict models)
+        parameters: Is the set of parameters used by the method
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_predictions(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all predictions metadata, i.e., it
+        does not retrieve the prediction content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All predict metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_prediction(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting the prediction.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the prediction name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_prediction_content(self,
+                                  name: str,
+                                  query: dict = {},
+                                  limit: int = 10,
+                                  skip: int = 0,
+                                  pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving all the
+        prediction tuples or registers, as well as the metadata content
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the prediction object
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some predictions inside or an error if there
+        is no such prediction object. The current page is also returned to be
+        used in future content requests.
+        """
+        response = self.__entity_reader.read_entity_content(
+            name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the create_prediction_async method, delete_prediction
+           method.
+
+           name: Represents the prediction name.
+           timeout: Represents the time in seconds to wait for a prediction to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct prediction result
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ + + +
+
#   + + + Predict(cluster_ip: str, api_path: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+ +
+ + + +
+
+
#   + + + def + create_prediction_sync( + self, + name: str, + model_name: str, + parent_name: str, + method_name: str, + parameters: dict, + description: str = '', + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def create_prediction_sync(self,
+                               name: str,
+                               model_name: str,
+                               parent_name: str,
+                               method_name: str,
+                               parameters: dict,
+                               description: str = "",
+                               pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method is responsible to predict models in sync mode
+
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the prediction output object that will be created.
+        parent_name: Is the name of the previous ML step of the pipeline
+        method_name: is the name of the method to be executed (the ML tool way
+        to predict models)
+        parameters: Is the set of parameters used by the method
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible to predict models in sync mode

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the prediction output object that will be created. +parent_name: Is the name of the previous ML step of the pipeline +method_name: is the name of the method to be executed (the ML tool way +to predict models) +parameters: Is the set of parameters used by the method

+ +

return: A JSON object with an error or warning message or a URL +indicating the correct operation.

+
+ + +
+
+
#   + + + def + create_prediction_async( + self, + name: str, + model_name: str, + parent_name: str, + method_name: str, + parameters: dict, + description: str = '', + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def create_prediction_async(self,
+                                name: str,
+                                model_name: str,
+                                parent_name: str,
+                                method_name: str,
+                                parameters: dict,
+                                description: str = "",
+                                pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method is responsible to predict models in async mode.
+        A wait method call is mandatory due to the asynchronous aspect.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the prediction output object that will be created.
+        parent_name: Is the name of the previous ML step of the pipeline
+        method_name: is the name of the method to be executed (the ML tool way
+        to predict models)
+        parameters: Is the set of parameters used by the method
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible to predict models in async mode. +A wait method call is mandatory due to the asynchronous aspect.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the prediction output object that will be created. +parent_name: Is the name of the previous ML step of the pipeline +method_name: is the name of the method to be executed (the ML tool way +to predict models) +parameters: Is the set of parameters used by the method

+ +

return: A JSON object with an error or warning message or a URL +indicating the correct operation.

+
+ + +
+
+
#   + + + def + search_all_predictions(self, pretty_response: bool = False) -> Union[dict, str]: +
+ +
+ View Source +
    def search_all_predictions(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all predictions metadata, i.e., it
+        does not retrieve the prediction content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All predict metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method retrieves all predictions metadata, i.e., it +does not retrieve the prediction content.

+ +

pretty_response: If true it returns a string, otherwise a dictionary.

+ +

return: All predict metadata stored in Learning Orchestra or an empty +result.

+
+ + +
+
+
#   + + + def + delete_prediction(self, name: str, pretty_response=False) -> Union[dict, str]: +
+ +
+ View Source +
    def delete_prediction(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting the prediction.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the prediction name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for deleting the prediction. +This delete operation is asynchronous, so it does not lock the caller + until the deletion finished. Instead, it returns a JSON object with a + URL for a future use. The caller uses the URL for delete checks.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Represents the prediction name.

+ +

return: JSON object with an error message, a warning message or a +correct delete message

+
+ + +
+
+
#   + + + def + search_prediction_content( + self, + name: str, + query: dict = {}, + limit: int = 10, + skip: int = 0, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def search_prediction_content(self,
+                                  name: str,
+                                  query: dict = {},
+                                  limit: int = 10,
+                                  skip: int = 0,
+                                  pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving all the
+        prediction tuples or registers, as well as the metadata content
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the prediction object
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some predictions inside or an error if there
+        is no such prediction object. The current page is also returned to be
+        used in future content requests.
+        """
+        response = self.__entity_reader.read_entity_content(
+            name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for retrieving all the +prediction tuples or registers, as well as the metadata content

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the prediction object +query: Query to make in MongoDB(default: empty query) +limit: Number of rows to return in pagination(default: 10) (maximum is +set at 20 rows per request) +skip: Number of rows to skip in pagination(default: 0)

+ +

return: A page with some predictions inside or an error if there +is no such prediction object. The current page is also returned to be +used in future content requests.

+
+ + +
+
+
#   + + + def + wait(self, name: str, timeout: int = None) -> dict: +
+ +
+ View Source +
    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the create_prediction_async method, delete_prediction
+           method.
+
+           name: Represents the prediction name.
+           timeout: Represents the time in seconds to wait for a prediction to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct prediction result
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ +

description: This method is responsible to create a synchronization +barrier for the create_prediction_async method, delete_prediction +method.

+ +

name: Represents the prediction name. +timeout: Represents the time in seconds to wait for a prediction to +finish its run.

+ +

return: JSON object with an error message, a warning message or a +correct prediction result

+
+ + +
+
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/predict/scikitlearn.html b/docs/old/learning_orchestra_client/predict/scikitlearn.html new file mode 100644 index 0000000..c9bd59c --- /dev/null +++ b/docs/old/learning_orchestra_client/predict/scikitlearn.html @@ -0,0 +1,322 @@ + + + + + + + learning_orchestra_client.predict.scikitlearn API documentation + + + + + + + + +
+
+

+learning_orchestra_client.predict.scikitlearn

+ + +
+ View Source +
from ._predict import Predict
+
+
+class PredictScikitLearn(Predict):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/predict/scikitlearn"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ +
+
+
+ #   + + + class + PredictScikitLearn(learning_orchestra_client.predict._predict.Predict): +
+ +
+ View Source +
class PredictScikitLearn(Predict):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/predict/scikitlearn"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+
#   + + + PredictScikitLearn(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/predict/scikitlearn"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/predict/tensorflow.html b/docs/old/learning_orchestra_client/predict/tensorflow.html new file mode 100644 index 0000000..8d09b18 --- /dev/null +++ b/docs/old/learning_orchestra_client/predict/tensorflow.html @@ -0,0 +1,322 @@ + + + + + + + learning_orchestra_client.predict.tensorflow API documentation + + + + + + + + +
+
+

+learning_orchestra_client.predict.tensorflow

+ + +
+ View Source +
from ._predict import Predict
+
+
+class PredictTensorflow(Predict):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/predict/tensorflow"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ +
+
+
+ #   + + + class + PredictTensorflow(learning_orchestra_client.predict._predict.Predict): +
+ +
+ View Source +
class PredictTensorflow(Predict):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/predict/tensorflow"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+
#   + + + PredictTensorflow(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/predict/tensorflow"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/train.html b/docs/old/learning_orchestra_client/train.html new file mode 100644 index 0000000..e995d8c --- /dev/null +++ b/docs/old/learning_orchestra_client/train.html @@ -0,0 +1,244 @@ + + + + + + + learning_orchestra_client.train API documentation + + + + + + + + +
+
+

+learning_orchestra_client.train

+ + + +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/train/_train.html b/docs/old/learning_orchestra_client/train/_train.html new file mode 100644 index 0000000..5cda331 --- /dev/null +++ b/docs/old/learning_orchestra_client/train/_train.html @@ -0,0 +1,980 @@ + + + + + + + learning_orchestra_client.train._train API documentation + + + + + + + + +
+
+

+learning_orchestra_client.train._train

+ + +
+ View Source +
from learning_orchestra_client.observe.observe import Observer
+from learning_orchestra_client._util._response_treat import ResponseTreat
+from learning_orchestra_client._util._entity_reader import EntityReader
+import requests
+from typing import Union
+
+
+class Train:
+    __PARENT_NAME_FIELD = "parentName"
+    __MODEL_NAME_FIELD = "modelName"
+    __METHOD_NAME_FIELD = "method"
+    __ClASS_PARAMETERS_FIELD = "methodParameters"
+    __NAME_FIELD = "name"
+    __DESCRIPTION_FIELD = "description"
+
+    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def create_training_sync(self,
+                             name: str,
+                             model_name: str,
+                             parent_name: str,
+                             method_name: str,
+                             parameters: dict,
+                             description: str = "",
+                             pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method is responsible to train models in sync mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the train output object that will be created.
+        parent_name: Is the name of the previous ML step of the pipeline
+        method_name: is the name of the method to be executed (the ML tool way
+        to train models)
+        parameters: Is the set of parameters used by the method
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def create_training_async(self,
+                              name: str,
+                              model_name: str,
+                              parent_name: str,
+                              method_name: str,
+                              parameters: dict,
+                              description: str = "",
+                              pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method is responsible to train models in async mode.
+        A wait method call is mandatory due to the asynchronous aspect.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the train output object that will be created.
+        parent_name: Is the name of the previous ML step of the pipeline
+        method_name: is the name of the method to be executed (the ML tool way
+        to train models)
+        parameters: Is the set of parameters used by the method
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_trainings(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all train metadata, i.e., it does
+        not retrieve the train content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All predict metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_training(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting the train step.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the train name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_training_content(self,
+                                name: str,
+                                query: dict = {},
+                                limit: int = 10,
+                                skip: int = 0,
+                                pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving all the train
+        tuples or registers, as well as the metadata content
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the train object
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some trains inside or an error if there
+        is no such train object. The current page is also returned to be used in
+        future content requests.
+        """
+        response = self.__entity_reader.read_entity_content(
+            name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the create_train_async method, delete_train method.
+
+           name: Represents the train name.
+           timeout: Represents the time in seconds to wait for a train to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct train result
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ +
+
+
+ #   + + + class + Train: +
+ +
+ View Source +
class Train:
+    __PARENT_NAME_FIELD = "parentName"
+    __MODEL_NAME_FIELD = "modelName"
+    __METHOD_NAME_FIELD = "method"
+    __ClASS_PARAMETERS_FIELD = "methodParameters"
+    __NAME_FIELD = "name"
+    __DESCRIPTION_FIELD = "description"
+
+    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def create_training_sync(self,
+                             name: str,
+                             model_name: str,
+                             parent_name: str,
+                             method_name: str,
+                             parameters: dict,
+                             description: str = "",
+                             pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method is responsible to train models in sync mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the train output object that will be created.
+        parent_name: Is the name of the previous ML step of the pipeline
+        method_name: is the name of the method to be executed (the ML tool way
+        to train models)
+        parameters: Is the set of parameters used by the method
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def create_training_async(self,
+                              name: str,
+                              model_name: str,
+                              parent_name: str,
+                              method_name: str,
+                              parameters: dict,
+                              description: str = "",
+                              pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method is responsible to train models in async mode.
+        A wait method call is mandatory due to the asynchronous aspect.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the train output object that will be created.
+        parent_name: Is the name of the previous ML step of the pipeline
+        method_name: is the name of the method to be executed (the ML tool way
+        to train models)
+        parameters: Is the set of parameters used by the method
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_trainings(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all train metadata, i.e., it does
+        not retrieve the train content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All predict metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_training(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting the train step.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the train name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_training_content(self,
+                                name: str,
+                                query: dict = {},
+                                limit: int = 10,
+                                skip: int = 0,
+                                pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving all the train
+        tuples or registers, as well as the metadata content
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the train object
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some trains inside or an error if there
+        is no such train object. The current page is also returned to be used in
+        future content requests.
+        """
+        response = self.__entity_reader.read_entity_content(
+            name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the create_train_async method, delete_train method.
+
+           name: Represents the train name.
+           timeout: Represents the time in seconds to wait for a train to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct train result
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ + + +
+
#   + + + Train(cluster_ip: str, api_path: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+ +
+ + + +
+
+
#   + + + def + create_training_sync( + self, + name: str, + model_name: str, + parent_name: str, + method_name: str, + parameters: dict, + description: str = '', + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def create_training_sync(self,
+                             name: str,
+                             model_name: str,
+                             parent_name: str,
+                             method_name: str,
+                             parameters: dict,
+                             description: str = "",
+                             pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method is responsible to train models in sync mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the train output object that will be created.
+        parent_name: Is the name of the previous ML step of the pipeline
+        method_name: is the name of the method to be executed (the ML tool way
+        to train models)
+        parameters: Is the set of parameters used by the method
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible to train models in sync mode

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the train output object that will be created. +parent_name: Is the name of the previous ML step of the pipeline +method_name: is the name of the method to be executed (the ML tool way +to train models) +parameters: Is the set of parameters used by the method

+ +

return: A JSON object with an error or warning message or a URL +indicating the correct operation.

+
+ + +
+
+
#   + + + def + create_training_async( + self, + name: str, + model_name: str, + parent_name: str, + method_name: str, + parameters: dict, + description: str = '', + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def create_training_async(self,
+                              name: str,
+                              model_name: str,
+                              parent_name: str,
+                              method_name: str,
+                              parameters: dict,
+                              description: str = "",
+                              pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method is responsible to train models in async mode.
+        A wait method call is mandatory due to the asynchronous aspect.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the train output object that will be created.
+        parent_name: Is the name of the previous ML step of the pipeline
+        method_name: is the name of the method to be executed (the ML tool way
+        to train models)
+        parameters: Is the set of parameters used by the method
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible to train models in async mode. +A wait method call is mandatory due to the asynchronous aspect.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the train output object that will be created. +parent_name: Is the name of the previous ML step of the pipeline +method_name: is the name of the method to be executed (the ML tool way +to train models) +parameters: Is the set of parameters used by the method

+ +

return: A JSON object with an error or warning message or a URL +indicating the correct operation.

+
+ + +
+
+
#   + + + def + search_all_trainings(self, pretty_response: bool = False) -> Union[dict, str]: +
+ +
+ View Source +
    def search_all_trainings(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all train metadata, i.e., it does
+        not retrieve the train content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All predict metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method retrieves all train metadata, i.e., it does +not retrieve the train content.

+ +

pretty_response: If true it returns a string, otherwise a dictionary.

+ +

return: All predict metadata stored in Learning Orchestra or an empty +result.

+
+ + +
+
+
#   + + + def + delete_training(self, name: str, pretty_response=False) -> Union[dict, str]: +
+ +
+ View Source +
    def delete_training(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting the train step.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the train name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for deleting the train step. +This delete operation is asynchronous, so it does not lock the caller + until the deletion finished. Instead, it returns a JSON object with a + URL for a future use. The caller uses the URL for delete checks.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Represents the train name.

+ +

return: JSON object with an error message, a warning message or a +correct delete message

+
+ + +
+
+
#   + + + def + search_training_content( + self, + name: str, + query: dict = {}, + limit: int = 10, + skip: int = 0, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def search_training_content(self,
+                                name: str,
+                                query: dict = {},
+                                limit: int = 10,
+                                skip: int = 0,
+                                pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving all the train
+        tuples or registers, as well as the metadata content
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the train object
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some trains inside or an error if there
+        is no such train object. The current page is also returned to be used in
+        future content requests.
+        """
+        response = self.__entity_reader.read_entity_content(
+            name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for retrieving all the train +tuples or registers, as well as the metadata content

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the train object +query: Query to make in MongoDB(default: empty query) +limit: Number of rows to return in pagination(default: 10) (maximum is +set at 20 rows per request) +skip: Number of rows to skip in pagination(default: 0)

+ +

return: A page with some trains inside or an error if there +is no such train object. The current page is also returned to be used in +future content requests.

+
+ + +
+
+
#   + + + def + wait(self, name: str, timeout: int = None) -> dict: +
+ +
+ View Source +
    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the create_train_async method, delete_train method.
+
+           name: Represents the train name.
+           timeout: Represents the time in seconds to wait for a train to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct train result
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ +

description: This method is responsible to create a synchronization +barrier for the create_train_async method, delete_train method.

+ +

name: Represents the train name. +timeout: Represents the time in seconds to wait for a train to +finish its run.

+ +

return: JSON object with an error message, a warning message or a +correct train result

+
+ + +
+
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/train/scikitlearn.html b/docs/old/learning_orchestra_client/train/scikitlearn.html new file mode 100644 index 0000000..864c84b --- /dev/null +++ b/docs/old/learning_orchestra_client/train/scikitlearn.html @@ -0,0 +1,334 @@ + + + + + + + learning_orchestra_client.train.scikitlearn API documentation + + + + + + + + +
+
+

+learning_orchestra_client.train.scikitlearn

+ + +
+ View Source +
from ._train import Train
+
+
+class TrainScikitLearn(Train):
+    __PARENT_NAME_FIELD = "parentName"
+    __METHOD_NAME_FIELD = "method"
+    __ClASS_PARAMETERS_FIELD = "methodParameters"
+    __NAME_FIELD = "name"
+    __DESCRIPTION_FIELD = "description"
+
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/train/scikitlearn"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ +
+
+
+ #   + + + class + TrainScikitLearn(learning_orchestra_client.train._train.Train): +
+ +
+ View Source +
class TrainScikitLearn(Train):
+    __PARENT_NAME_FIELD = "parentName"
+    __METHOD_NAME_FIELD = "method"
+    __ClASS_PARAMETERS_FIELD = "methodParameters"
+    __NAME_FIELD = "name"
+    __DESCRIPTION_FIELD = "description"
+
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/train/scikitlearn"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+
#   + + + TrainScikitLearn(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/train/scikitlearn"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/train/tensorflow.html b/docs/old/learning_orchestra_client/train/tensorflow.html new file mode 100644 index 0000000..cc00742 --- /dev/null +++ b/docs/old/learning_orchestra_client/train/tensorflow.html @@ -0,0 +1,334 @@ + + + + + + + learning_orchestra_client.train.tensorflow API documentation + + + + + + + + +
+
+

+learning_orchestra_client.train.tensorflow

+ + +
+ View Source +
from ._train import Train
+
+
+class TrainTensorflow(Train):
+    __PARENT_NAME_FIELD = "parentName"
+    __METHOD_NAME_FIELD = "method"
+    __ClASS_PARAMETERS_FIELD = "methodParameters"
+    __NAME_FIELD = "name"
+    __DESCRIPTION_FIELD = "description"
+
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/train/tensorflow"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ +
+
+
+ #   + + + class + TrainTensorflow(learning_orchestra_client.train._train.Train): +
+ +
+ View Source +
class TrainTensorflow(Train):
+    __PARENT_NAME_FIELD = "parentName"
+    __METHOD_NAME_FIELD = "method"
+    __ClASS_PARAMETERS_FIELD = "methodParameters"
+    __NAME_FIELD = "name"
+    __DESCRIPTION_FIELD = "description"
+
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/train/tensorflow"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+
#   + + + TrainTensorflow(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/train/tensorflow"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/transform.html b/docs/old/learning_orchestra_client/transform.html new file mode 100644 index 0000000..5961457 --- /dev/null +++ b/docs/old/learning_orchestra_client/transform.html @@ -0,0 +1,246 @@ + + + + + + + learning_orchestra_client.transform API documentation + + + + + + + + +
+
+

+learning_orchestra_client.transform

+ + + +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/transform/_transform.html b/docs/old/learning_orchestra_client/transform/_transform.html new file mode 100644 index 0000000..1604833 --- /dev/null +++ b/docs/old/learning_orchestra_client/transform/_transform.html @@ -0,0 +1,996 @@ + + + + + + + learning_orchestra_client.transform._transform API documentation + + + + + + + + +
+
+

+learning_orchestra_client.transform._transform

+ + +
+ View Source +
from learning_orchestra_client.observe.observe import Observer
+from learning_orchestra_client._util._response_treat import ResponseTreat
+from learning_orchestra_client._util._entity_reader import EntityReader
+import requests
+from typing import Union
+
+
+class Transform:
+    __PARENT_NAME_FIELD = "parentName"
+    __MODEL_NAME_FIELD = "modelName"
+    __METHOD_NAME_FIELD = "method"
+    __ClASS_PARAMETERS_FIELD = "methodParameters"
+    __NAME_FIELD = "name"
+    __DESCRIPTION_FIELD = "description"
+
+    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def create_transform_sync(self,
+                              name: str,
+                              model_name: str,
+                              parent_name: str,
+                              method_name: str,
+                              parameters: dict,
+                              description: str = "",
+                              pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method is responsible to transform datasets in sync
+        mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the transform output object that will be created.
+        parent_name: Is the name of the previous ML step of the pipeline
+        method_name: is the name of the method to be executed
+        (the ML tool way to transform datasets)
+        parameters: Is the set of parameters used by the method
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def create_transform_async(self,
+                               name: str,
+                               model_name: str,
+                               parent_name: str,
+                               method_name: str,
+                               parameters: dict,
+                               description: str = "",
+                               pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method is responsible to transform datasets in async
+        mode. The wait method must be called to guarantee a synchronization
+        barrier.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the transform output object that will be created.
+        parent_name: Is the name of the previous ML step of the pipeline
+        method_name: is the name of the method to be executed (the ML tool way
+        to transform datasets)
+        parameters: Is the set of parameters used by the method
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_transformations(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all transform metadata, i.e., it does
+        not retrieve the transform content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All transform metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_transform(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting a transform step.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the transform name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_transform_content(self,
+                                 name: str,
+                                 query: dict = {},
+                                 limit: int = 10,
+                                 skip: int = 0,
+                                 pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving a transform
+        URL, which is useful to obtain the transform plottable content, as well
+        as the metadata content
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the transform object
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return A page with transform content and metadata inside or an error if
+        there is no such train object. The current page is also returned to be
+        used in future content requests.
+        """
+        response = self.__entity_reader.read_entity_content(
+            name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the create_transform_async method, delete_transform
+           method.
+
+           name: Represents the transform name.
+           timeout: Represents the time in seconds to wait for a transform step
+           to finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct transform result
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ +
+
+
+ #   + + + class + Transform: +
+ +
+ View Source +
class Transform:
+    __PARENT_NAME_FIELD = "parentName"
+    __MODEL_NAME_FIELD = "modelName"
+    __METHOD_NAME_FIELD = "method"
+    __ClASS_PARAMETERS_FIELD = "methodParameters"
+    __NAME_FIELD = "name"
+    __DESCRIPTION_FIELD = "description"
+
+    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def create_transform_sync(self,
+                              name: str,
+                              model_name: str,
+                              parent_name: str,
+                              method_name: str,
+                              parameters: dict,
+                              description: str = "",
+                              pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method is responsible to transform datasets in sync
+        mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the transform output object that will be created.
+        parent_name: Is the name of the previous ML step of the pipeline
+        method_name: is the name of the method to be executed
+        (the ML tool way to transform datasets)
+        parameters: Is the set of parameters used by the method
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def create_transform_async(self,
+                               name: str,
+                               model_name: str,
+                               parent_name: str,
+                               method_name: str,
+                               parameters: dict,
+                               description: str = "",
+                               pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method is responsible to transform datasets in async
+        mode. The wait method must be called to guarantee a synchronization
+        barrier.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the transform output object that will be created.
+        parent_name: Is the name of the previous ML step of the pipeline
+        method_name: is the name of the method to be executed (the ML tool way
+        to transform datasets)
+        parameters: Is the set of parameters used by the method
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_transformations(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all transform metadata, i.e., it does
+        not retrieve the transform content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All transform metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_transform(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting a transform step.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the transform name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_transform_content(self,
+                                 name: str,
+                                 query: dict = {},
+                                 limit: int = 10,
+                                 skip: int = 0,
+                                 pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving a transform
+        URL, which is useful to obtain the transform plottable content, as well
+        as the metadata content
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the transform object
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return A page with transform content and metadata inside or an error if
+        there is no such train object. The current page is also returned to be
+        used in future content requests.
+        """
+        response = self.__entity_reader.read_entity_content(
+            name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the create_transform_async method, delete_transform
+           method.
+
+           name: Represents the transform name.
+           timeout: Represents the time in seconds to wait for a transform step
+           to finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct transform result
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ + + +
+
#   + + + Transform(cluster_ip: str, api_path: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str, api_path: str):
+        self.__service_url = f'{cluster_ip}{api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+ +
+ + + +
+
+
#   + + + def + create_transform_sync( + self, + name: str, + model_name: str, + parent_name: str, + method_name: str, + parameters: dict, + description: str = '', + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def create_transform_sync(self,
+                              name: str,
+                              model_name: str,
+                              parent_name: str,
+                              method_name: str,
+                              parameters: dict,
+                              description: str = "",
+                              pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method is responsible to transform datasets in sync
+        mode
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the transform output object that will be created.
+        parent_name: Is the name of the previous ML step of the pipeline
+        method_name: is the name of the method to be executed
+        (the ML tool way to transform datasets)
+        parameters: Is the set of parameters used by the method
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible to transform datasets in sync +mode

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the transform output object that will be created. +parent_name: Is the name of the previous ML step of the pipeline +method_name: is the name of the method to be executed +(the ML tool way to transform datasets) +parameters: Is the set of parameters used by the method

+ +

return: A JSON object with an error or warning message or a URL +indicating the correct operation.

+
+ + +
+
+
#   + + + def + create_transform_async( + self, + name: str, + model_name: str, + parent_name: str, + method_name: str, + parameters: dict, + description: str = '', + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def create_transform_async(self,
+                               name: str,
+                               model_name: str,
+                               parent_name: str,
+                               method_name: str,
+                               parameters: dict,
+                               description: str = "",
+                               pretty_response: bool = False) -> \
+            Union[dict, str]:
+        """
+        description: This method is responsible to transform datasets in async
+        mode. The wait method must be called to guarantee a synchronization
+        barrier.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the transform output object that will be created.
+        parent_name: Is the name of the previous ML step of the pipeline
+        method_name: is the name of the method to be executed (the ML tool way
+        to transform datasets)
+        parameters: Is the set of parameters used by the method
+
+        return: A JSON object with an error or warning message or a URL
+        indicating the correct operation.
+        """
+        request_body = {
+            self.__NAME_FIELD: name,
+            self.__MODEL_NAME_FIELD: model_name,
+            self.__PARENT_NAME_FIELD: parent_name,
+            self.__METHOD_NAME_FIELD: method_name,
+            self.__ClASS_PARAMETERS_FIELD: parameters,
+            self.__DESCRIPTION_FIELD: description}
+
+        request_url = self.__service_url
+
+        response = requests.post(url=request_url, json=request_body)
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible to transform datasets in async +mode. The wait method must be called to guarantee a synchronization +barrier.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the transform output object that will be created. +parent_name: Is the name of the previous ML step of the pipeline +method_name: is the name of the method to be executed (the ML tool way +to transform datasets) +parameters: Is the set of parameters used by the method

+ +

return: A JSON object with an error or warning message or a URL +indicating the correct operation.

+
+ + +
+
+
#   + + + def + search_all_transformations(self, pretty_response: bool = False) -> Union[dict, str]: +
+ +
+ View Source +
    def search_all_transformations(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all transform metadata, i.e., it does
+        not retrieve the transform content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All transform metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method retrieves all transform metadata, i.e., it does +not retrieve the transform content.

+ +

pretty_response: If true it returns a string, otherwise a dictionary.

+ +

return: All transform metadata stored in Learning Orchestra or an empty +result.

+
+ + +
+
+
#   + + + def + delete_transform(self, name: str, pretty_response=False) -> Union[dict, str]: +
+ +
+ View Source +
    def delete_transform(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting a transform step.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the transform name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for deleting a transform step. +This delete operation is asynchronous, so it does not lock the caller + until the deletion finished. Instead, it returns a JSON object with a + URL for a future use. The caller uses the URL for delete checks.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Represents the transform name.

+ +

return: JSON object with an error message, a warning message or a +correct delete message

+
+ + +
+
+
#   + + + def + search_transform_content( + self, + name: str, + query: dict = {}, + limit: int = 10, + skip: int = 0, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def search_transform_content(self,
+                                 name: str,
+                                 query: dict = {},
+                                 limit: int = 10,
+                                 skip: int = 0,
+                                 pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving a transform
+        URL, which is useful to obtain the transform plottable content, as well
+        as the metadata content
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the transform object
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return A page with transform content and metadata inside or an error if
+        there is no such train object. The current page is also returned to be
+        used in future content requests.
+        """
+        response = self.__entity_reader.read_entity_content(
+            name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for retrieving a transform +URL, which is useful to obtain the transform plottable content, as well +as the metadata content

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the transform object +query: Query to make in MongoDB(default: empty query) +limit: Number of rows to return in pagination(default: 10) (maximum is +set at 20 rows per request) +skip: Number of rows to skip in pagination(default: 0)

+ +

return A page with transform content and metadata inside or an error if +there is no such train object. The current page is also returned to be +used in future content requests.

+
+ + +
+
+
#   + + + def + wait(self, name: str, timeout: int = None) -> dict: +
+ +
+ View Source +
    def wait(self, name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the create_transform_async method, delete_transform
+           method.
+
+           name: Represents the transform name.
+           timeout: Represents the time in seconds to wait for a transform step
+           to finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct transform result
+        """
+        return self.__observer.wait(name, timeout)
+
+ +
+ +

description: This method is responsible to create a synchronization +barrier for the create_transform_async method, delete_transform +method.

+ +

name: Represents the transform name. +timeout: Represents the time in seconds to wait for a transform step +to finish its run.

+ +

return: JSON object with an error message, a warning message or a +correct transform result

+
+ + +
+
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/transform/data_type.html b/docs/old/learning_orchestra_client/transform/data_type.html new file mode 100644 index 0000000..ab70e5f --- /dev/null +++ b/docs/old/learning_orchestra_client/transform/data_type.html @@ -0,0 +1,907 @@ + + + + + + + learning_orchestra_client.transform.data_type API documentation + + + + + + + + +
+
+

+learning_orchestra_client.transform.data_type

+ + +
+ View Source +
from learning_orchestra_client._util._response_treat import ResponseTreat
+from learning_orchestra_client._util._entity_reader import EntityReader
+from learning_orchestra_client.observe.observe import Observer
+import requests
+from typing import Union
+
+
+class TransformDataType:
+    __INPUT_NAME = "inputDatasetName"
+    __TYPES = "types"
+
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/transform/dataType"
+        self.__service_url = f'{cluster_ip}{self.__api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def update_dataset_type_sync(self,
+                                 dataset_name: str,
+                                 types: dict,
+                                 pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: Change dataset field types (from number to string and
+        vice-versa). Many type modifications can be performed in one method
+        call.
+
+        dataset_name: Represents the dataset name.
+        types: Represents a map, where the pair key:value is a field:type
+
+        return: A JSON object with error or warning messages or a correct
+        datatype result.
+        """
+        url_request = self.__service_url
+        body_request = {
+            self.__INPUT_NAME: dataset_name,
+            self.__TYPES: types
+        }
+
+        response = requests.patch(url=url_request, json=body_request)
+        self.__observer.wait(dataset_name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def update_dataset_type_async(self,
+                                  dataset_name: str,
+                                  types: dict,
+                                  pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: Change dataset field types (from number to string and
+        vice-versa). Many type modifications can be performed in one method
+        call. Is is an asynchronous call, thus a wait method must be also
+        called to guarantee a synchronization barrier.
+
+        dataset_name: Represents the dataset name.
+        types: Represents a map, where the pair key:value is a field:type
+
+        return: A JSON object with error or warning messages or a correct
+        datatype result.
+        """
+        url_request = self.__service_url
+        body_request = {
+            self.__INPUT_NAME: dataset_name,
+            self.__TYPES: types
+        }
+
+        response = requests.patch(url=url_request, json=body_request)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_datatype(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all datatype metadata, i.e., it does
+        not retrieve the datatype content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All predict metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_datatype(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting the datatype step.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the datatype name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_datatype_content(self,
+                                name: str,
+                                query: dict = {},
+                                limit: int = 10,
+                                skip: int = 0,
+                                pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving all the datatype
+        tuples or registers, as well as the metadata content
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the datatype object
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some registers or tuples inside or an error if there
+        is no such datatype object. The current page is also returned to be
+        used in future content requests.
+        """
+        response = self.__entity_reader.read_entity_content(
+            name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, dataset_name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the update_dataset_type_async method, delete_datatype
+           method.
+
+           name: Represents the datatype name.
+           timeout: Represents the time in seconds to wait for a datatype to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct datatype result
+        """
+        return self.__observer.wait(dataset_name, timeout)
+
+ +
+ +
+
+
+ #   + + + class + TransformDataType: +
+ +
+ View Source +
class TransformDataType:
+    __INPUT_NAME = "inputDatasetName"
+    __TYPES = "types"
+
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/transform/dataType"
+        self.__service_url = f'{cluster_ip}{self.__api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def update_dataset_type_sync(self,
+                                 dataset_name: str,
+                                 types: dict,
+                                 pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: Change dataset field types (from number to string and
+        vice-versa). Many type modifications can be performed in one method
+        call.
+
+        dataset_name: Represents the dataset name.
+        types: Represents a map, where the pair key:value is a field:type
+
+        return: A JSON object with error or warning messages or a correct
+        datatype result.
+        """
+        url_request = self.__service_url
+        body_request = {
+            self.__INPUT_NAME: dataset_name,
+            self.__TYPES: types
+        }
+
+        response = requests.patch(url=url_request, json=body_request)
+        self.__observer.wait(dataset_name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def update_dataset_type_async(self,
+                                  dataset_name: str,
+                                  types: dict,
+                                  pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: Change dataset field types (from number to string and
+        vice-versa). Many type modifications can be performed in one method
+        call. Is is an asynchronous call, thus a wait method must be also
+        called to guarantee a synchronization barrier.
+
+        dataset_name: Represents the dataset name.
+        types: Represents a map, where the pair key:value is a field:type
+
+        return: A JSON object with error or warning messages or a correct
+        datatype result.
+        """
+        url_request = self.__service_url
+        body_request = {
+            self.__INPUT_NAME: dataset_name,
+            self.__TYPES: types
+        }
+
+        response = requests.patch(url=url_request, json=body_request)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_datatype(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all datatype metadata, i.e., it does
+        not retrieve the datatype content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All predict metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_datatype(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting the datatype step.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the datatype name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_datatype_content(self,
+                                name: str,
+                                query: dict = {},
+                                limit: int = 10,
+                                skip: int = 0,
+                                pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving all the datatype
+        tuples or registers, as well as the metadata content
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the datatype object
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some registers or tuples inside or an error if there
+        is no such datatype object. The current page is also returned to be
+        used in future content requests.
+        """
+        response = self.__entity_reader.read_entity_content(
+            name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, dataset_name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the update_dataset_type_async method, delete_datatype
+           method.
+
+           name: Represents the datatype name.
+           timeout: Represents the time in seconds to wait for a datatype to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct datatype result
+        """
+        return self.__observer.wait(dataset_name, timeout)
+
+ +
+ + + +
+
#   + + + TransformDataType(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/transform/dataType"
+        self.__service_url = f'{cluster_ip}{self.__api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+ +
+ + + +
+
+
#   + + + def + update_dataset_type_sync( + self, + dataset_name: str, + types: dict, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def update_dataset_type_sync(self,
+                                 dataset_name: str,
+                                 types: dict,
+                                 pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: Change dataset field types (from number to string and
+        vice-versa). Many type modifications can be performed in one method
+        call.
+
+        dataset_name: Represents the dataset name.
+        types: Represents a map, where the pair key:value is a field:type
+
+        return: A JSON object with error or warning messages or a correct
+        datatype result.
+        """
+        url_request = self.__service_url
+        body_request = {
+            self.__INPUT_NAME: dataset_name,
+            self.__TYPES: types
+        }
+
+        response = requests.patch(url=url_request, json=body_request)
+        self.__observer.wait(dataset_name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: Change dataset field types (from number to string and +vice-versa). Many type modifications can be performed in one method +call.

+ +

dataset_name: Represents the dataset name. +types: Represents a map, where the pair key:value is a field:type

+ +

return: A JSON object with error or warning messages or a correct +datatype result.

+
+ + +
+
+
#   + + + def + update_dataset_type_async( + self, + dataset_name: str, + types: dict, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def update_dataset_type_async(self,
+                                  dataset_name: str,
+                                  types: dict,
+                                  pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: Change dataset field types (from number to string and
+        vice-versa). Many type modifications can be performed in one method
+        call. Is is an asynchronous call, thus a wait method must be also
+        called to guarantee a synchronization barrier.
+
+        dataset_name: Represents the dataset name.
+        types: Represents a map, where the pair key:value is a field:type
+
+        return: A JSON object with error or warning messages or a correct
+        datatype result.
+        """
+        url_request = self.__service_url
+        body_request = {
+            self.__INPUT_NAME: dataset_name,
+            self.__TYPES: types
+        }
+
+        response = requests.patch(url=url_request, json=body_request)
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: Change dataset field types (from number to string and +vice-versa). Many type modifications can be performed in one method +call. Is is an asynchronous call, thus a wait method must be also +called to guarantee a synchronization barrier.

+ +

dataset_name: Represents the dataset name. +types: Represents a map, where the pair key:value is a field:type

+ +

return: A JSON object with error or warning messages or a correct +datatype result.

+
+ + +
+
+
#   + + + def + search_all_datatype(self, pretty_response: bool = False) -> Union[dict, str]: +
+ +
+ View Source +
    def search_all_datatype(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all datatype metadata, i.e., it does
+        not retrieve the datatype content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: All predict metadata stored in Learning Orchestra or an empty
+        result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method retrieves all datatype metadata, i.e., it does +not retrieve the datatype content.

+ +

pretty_response: If true it returns a string, otherwise a dictionary.

+ +

return: All predict metadata stored in Learning Orchestra or an empty +result.

+
+ + +
+
+
#   + + + def + delete_datatype(self, name: str, pretty_response=False) -> Union[dict, str]: +
+ +
+ View Source +
    def delete_datatype(self, name: str, pretty_response=False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting the datatype step.
+        This delete operation is asynchronous, so it does not lock the caller
+         until the deletion finished. Instead, it returns a JSON object with a
+         URL for a future use. The caller uses the URL for delete checks.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Represents the datatype name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+        request_url = f'{self.__service_url}/{name}'
+
+        response = requests.delete(request_url)
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for deleting the datatype step. +This delete operation is asynchronous, so it does not lock the caller + until the deletion finished. Instead, it returns a JSON object with a + URL for a future use. The caller uses the URL for delete checks.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Represents the datatype name.

+ +

return: JSON object with an error message, a warning message or a +correct delete message

+
+ + +
+
+
#   + + + def + search_datatype_content( + self, + name: str, + query: dict = {}, + limit: int = 10, + skip: int = 0, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def search_datatype_content(self,
+                                name: str,
+                                query: dict = {},
+                                limit: int = 10,
+                                skip: int = 0,
+                                pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description:  This method is responsible for retrieving all the datatype
+        tuples or registers, as well as the metadata content
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        name: Is the name of the datatype object
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some registers or tuples inside or an error if there
+        is no such datatype object. The current page is also returned to be
+        used in future content requests.
+        """
+        response = self.__entity_reader.read_entity_content(
+            name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for retrieving all the datatype +tuples or registers, as well as the metadata content

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +name: Is the name of the datatype object +query: Query to make in MongoDB(default: empty query) +limit: Number of rows to return in pagination(default: 10) (maximum is +set at 20 rows per request) +skip: Number of rows to skip in pagination(default: 0)

+ +

return: A page with some registers or tuples inside or an error if there +is no such datatype object. The current page is also returned to be +used in future content requests.

+
+ + +
+
+
#   + + + def + wait(self, dataset_name: str, timeout: int = None) -> dict: +
+ +
+ View Source +
    def wait(self, dataset_name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the update_dataset_type_async method, delete_datatype
+           method.
+
+           name: Represents the datatype name.
+           timeout: Represents the time in seconds to wait for a datatype to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct datatype result
+        """
+        return self.__observer.wait(dataset_name, timeout)
+
+ +
+ +

description: This method is responsible to create a synchronization +barrier for the update_dataset_type_async method, delete_datatype +method.

+ +

name: Represents the datatype name. +timeout: Represents the time in seconds to wait for a datatype to +finish its run.

+ +

return: JSON object with an error message, a warning message or a +correct datatype result

+
+ + +
+
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/transform/projection.html b/docs/old/learning_orchestra_client/transform/projection.html new file mode 100644 index 0000000..2ca35b5 --- /dev/null +++ b/docs/old/learning_orchestra_client/transform/projection.html @@ -0,0 +1,965 @@ + + + + + + + learning_orchestra_client.transform.projection API documentation + + + + + + + + +
+
+

+learning_orchestra_client.transform.projection

+ + +
+ View Source +
from learning_orchestra_client._util._response_treat import ResponseTreat
+from learning_orchestra_client.observe.observe import Observer
+from learning_orchestra_client._util._entity_reader import EntityReader
+import requests
+from typing import Union
+
+
+class TransformProjection:
+    __INPUT_NAME = "inputDatasetName"
+    __OUTPUT_NAME = "outputDatasetName"
+    __FIELDS = "names"
+
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/transform/projection"
+        self.__service_url = f'{cluster_ip}{self.__api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def remove_dataset_attributes_sync(self,
+                                       dataset_name: str,
+                                       projection_name: str,
+                                       fields: list,
+                                       pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method removes a set of attributes of a dataset
+        synchronously, the caller waits until the projection is inserted into
+        the Learning Orchestra storage mechanism.
+
+        pretty_response: If returns true a string, otherwise a dictionary.
+        projection_name: Represents the projection name.
+        dataset_name: Represents the dataset name.
+        fields: Represents the set of attributes to be removed. This is list
+        with some attributes.
+
+        return: A JSON object with error or warning messages. In case of
+        success, it returns the projection metadata.
+        """
+
+        request_body = {
+            self.__INPUT_NAME: dataset_name,
+            self.__OUTPUT_NAME: projection_name,
+            self.__FIELDS: fields,
+        }
+        request_url = self.__service_url
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(dataset_name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def remove_dataset_attributes_async(self,
+                                        dataset_name: str,
+                                        projection_name: str,
+                                        fields: list,
+                                        pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method removes a set of attributes of a dataset
+        asynchronously; this way, the caller does not wait until the projection
+        is inserted into the Learning Orchestra storage mechanism. A wait
+        method call must occur to guarantee a synchronization barrier.
+
+        pretty_response: If returns true a string, otherwise a dictionary.
+        projection_name: Represents the projection name.
+        dataset_name: Represents the dataset name.
+        fields: Represents the set of attributes to be removed. This is list
+        with some attributes.
+
+        return: A JSON object with error or warning messages. In case of
+        success, it returns the projection URL to be obtained latter with a
+        wait method call.
+        """
+
+        request_body = {
+            self.__INPUT_NAME: dataset_name,
+            self.__OUTPUT_NAME: projection_name,
+            self.__FIELDS: fields,
+        }
+        request_url = self.__service_url
+        response = requests.post(url=request_url, json=request_body)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_projections(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all projection metadata, i.e., it
+        does not retrieve the projection content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: A list with all projections metadata stored in Learning
+        Orchestra or an empty result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_projection_content(self,
+                                  projection_name: str,
+                                  query: dict = {},
+                                  limit: int = 10,
+                                  skip: int = 0,
+                                  pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for retrieving the projection
+        content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        projection_name: Represents the projection name.
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some tuples or registers inside or an error if there
+        is no such projection. The current page is also returned to be used in
+        future content requests.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            projection_name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_projection(self, projection_name: str,
+                          pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting a projection.
+        The delete operation is always asynchronous and performed in background.
+
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        projection_name: Represents the projection name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+        cluster_url_projection = f'{self.__service_url}/{projection_name}'
+
+        response = requests.delete(cluster_url_projection)
+        response.raise_for_status()
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, projection_name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the remove_dataset_attributes_async method,
+           delete_projection method.
+
+           name: Represents the projection name.
+           timeout: Represents the time in seconds to wait for a projection to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct projection result
+        """
+        return self.__observer.wait(projection_name, timeout)
+
+ +
+ +
+
+
+ #   + + + class + TransformProjection: +
+ +
+ View Source +
class TransformProjection:
+    __INPUT_NAME = "inputDatasetName"
+    __OUTPUT_NAME = "outputDatasetName"
+    __FIELDS = "names"
+
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/transform/projection"
+        self.__service_url = f'{cluster_ip}{self.__api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+    def remove_dataset_attributes_sync(self,
+                                       dataset_name: str,
+                                       projection_name: str,
+                                       fields: list,
+                                       pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method removes a set of attributes of a dataset
+        synchronously, the caller waits until the projection is inserted into
+        the Learning Orchestra storage mechanism.
+
+        pretty_response: If returns true a string, otherwise a dictionary.
+        projection_name: Represents the projection name.
+        dataset_name: Represents the dataset name.
+        fields: Represents the set of attributes to be removed. This is list
+        with some attributes.
+
+        return: A JSON object with error or warning messages. In case of
+        success, it returns the projection metadata.
+        """
+
+        request_body = {
+            self.__INPUT_NAME: dataset_name,
+            self.__OUTPUT_NAME: projection_name,
+            self.__FIELDS: fields,
+        }
+        request_url = self.__service_url
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(dataset_name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def remove_dataset_attributes_async(self,
+                                        dataset_name: str,
+                                        projection_name: str,
+                                        fields: list,
+                                        pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method removes a set of attributes of a dataset
+        asynchronously; this way, the caller does not wait until the projection
+        is inserted into the Learning Orchestra storage mechanism. A wait
+        method call must occur to guarantee a synchronization barrier.
+
+        pretty_response: If returns true a string, otherwise a dictionary.
+        projection_name: Represents the projection name.
+        dataset_name: Represents the dataset name.
+        fields: Represents the set of attributes to be removed. This is list
+        with some attributes.
+
+        return: A JSON object with error or warning messages. In case of
+        success, it returns the projection URL to be obtained latter with a
+        wait method call.
+        """
+
+        request_body = {
+            self.__INPUT_NAME: dataset_name,
+            self.__OUTPUT_NAME: projection_name,
+            self.__FIELDS: fields,
+        }
+        request_url = self.__service_url
+        response = requests.post(url=request_url, json=request_body)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_all_projections(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all projection metadata, i.e., it
+        does not retrieve the projection content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: A list with all projections metadata stored in Learning
+        Orchestra or an empty result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def search_projection_content(self,
+                                  projection_name: str,
+                                  query: dict = {},
+                                  limit: int = 10,
+                                  skip: int = 0,
+                                  pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for retrieving the projection
+        content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        projection_name: Represents the projection name.
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some tuples or registers inside or an error if there
+        is no such projection. The current page is also returned to be used in
+        future content requests.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            projection_name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def delete_projection(self, projection_name: str,
+                          pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting a projection.
+        The delete operation is always asynchronous and performed in background.
+
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        projection_name: Represents the projection name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+        cluster_url_projection = f'{self.__service_url}/{projection_name}'
+
+        response = requests.delete(cluster_url_projection)
+        response.raise_for_status()
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+    def wait(self, projection_name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the remove_dataset_attributes_async method,
+           delete_projection method.
+
+           name: Represents the projection name.
+           timeout: Represents the time in seconds to wait for a projection to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct projection result
+        """
+        return self.__observer.wait(projection_name, timeout)
+
+ +
+ + + +
+
#   + + + TransformProjection(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/transform/projection"
+        self.__service_url = f'{cluster_ip}{self.__api_path}'
+        self.__response_treat = ResponseTreat()
+        self.__cluster_ip = cluster_ip
+        self.__entity_reader = EntityReader(self.__service_url)
+        self.__observer = Observer(self.__cluster_ip)
+
+ +
+ + + +
+
+
#   + + + def + remove_dataset_attributes_sync( + self, + dataset_name: str, + projection_name: str, + fields: list, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def remove_dataset_attributes_sync(self,
+                                       dataset_name: str,
+                                       projection_name: str,
+                                       fields: list,
+                                       pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method removes a set of attributes of a dataset
+        synchronously, the caller waits until the projection is inserted into
+        the Learning Orchestra storage mechanism.
+
+        pretty_response: If returns true a string, otherwise a dictionary.
+        projection_name: Represents the projection name.
+        dataset_name: Represents the dataset name.
+        fields: Represents the set of attributes to be removed. This is list
+        with some attributes.
+
+        return: A JSON object with error or warning messages. In case of
+        success, it returns the projection metadata.
+        """
+
+        request_body = {
+            self.__INPUT_NAME: dataset_name,
+            self.__OUTPUT_NAME: projection_name,
+            self.__FIELDS: fields,
+        }
+        request_url = self.__service_url
+        response = requests.post(url=request_url, json=request_body)
+        self.__observer.wait(dataset_name)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method removes a set of attributes of a dataset +synchronously, the caller waits until the projection is inserted into +the Learning Orchestra storage mechanism.

+ +

pretty_response: If returns true a string, otherwise a dictionary. +projection_name: Represents the projection name. +dataset_name: Represents the dataset name. +fields: Represents the set of attributes to be removed. This is list +with some attributes.

+ +

return: A JSON object with error or warning messages. In case of +success, it returns the projection metadata.

+
+ + +
+
+
#   + + + def + remove_dataset_attributes_async( + self, + dataset_name: str, + projection_name: str, + fields: list, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def remove_dataset_attributes_async(self,
+                                        dataset_name: str,
+                                        projection_name: str,
+                                        fields: list,
+                                        pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method removes a set of attributes of a dataset
+        asynchronously; this way, the caller does not wait until the projection
+        is inserted into the Learning Orchestra storage mechanism. A wait
+        method call must occur to guarantee a synchronization barrier.
+
+        pretty_response: If returns true a string, otherwise a dictionary.
+        projection_name: Represents the projection name.
+        dataset_name: Represents the dataset name.
+        fields: Represents the set of attributes to be removed. This is list
+        with some attributes.
+
+        return: A JSON object with error or warning messages. In case of
+        success, it returns the projection URL to be obtained latter with a
+        wait method call.
+        """
+
+        request_body = {
+            self.__INPUT_NAME: dataset_name,
+            self.__OUTPUT_NAME: projection_name,
+            self.__FIELDS: fields,
+        }
+        request_url = self.__service_url
+        response = requests.post(url=request_url, json=request_body)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method removes a set of attributes of a dataset +asynchronously; this way, the caller does not wait until the projection +is inserted into the Learning Orchestra storage mechanism. A wait +method call must occur to guarantee a synchronization barrier.

+ +

pretty_response: If returns true a string, otherwise a dictionary. +projection_name: Represents the projection name. +dataset_name: Represents the dataset name. +fields: Represents the set of attributes to be removed. This is list +with some attributes.

+ +

return: A JSON object with error or warning messages. In case of +success, it returns the projection URL to be obtained latter with a +wait method call.

+
+ + +
+
+
#   + + + def + search_all_projections(self, pretty_response: bool = False) -> Union[dict, str]: +
+ +
+ View Source +
    def search_all_projections(self, pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method retrieves all projection metadata, i.e., it
+        does not retrieve the projection content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+
+        return: A list with all projections metadata stored in Learning
+        Orchestra or an empty result.
+        """
+        response = self.__entity_reader.read_all_instances_from_entity()
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method retrieves all projection metadata, i.e., it +does not retrieve the projection content.

+ +

pretty_response: If true it returns a string, otherwise a dictionary.

+ +

return: A list with all projections metadata stored in Learning +Orchestra or an empty result.

+
+ + +
+
+
#   + + + def + search_projection_content( + self, + projection_name: str, + query: dict = {}, + limit: int = 10, + skip: int = 0, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def search_projection_content(self,
+                                  projection_name: str,
+                                  query: dict = {},
+                                  limit: int = 10,
+                                  skip: int = 0,
+                                  pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for retrieving the projection
+        content.
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        projection_name: Represents the projection name.
+        query: Query to make in MongoDB(default: empty query)
+        limit: Number of rows to return in pagination(default: 10) (maximum is
+        set at 20 rows per request)
+        skip: Number of rows to skip in pagination(default: 0)
+
+        return: A page with some tuples or registers inside or an error if there
+        is no such projection. The current page is also returned to be used in
+        future content requests.
+        """
+
+        response = self.__entity_reader.read_entity_content(
+            projection_name, query, limit, skip)
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for retrieving the projection +content.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +projection_name: Represents the projection name. +query: Query to make in MongoDB(default: empty query) +limit: Number of rows to return in pagination(default: 10) (maximum is +set at 20 rows per request) +skip: Number of rows to skip in pagination(default: 0)

+ +

return: A page with some tuples or registers inside or an error if there +is no such projection. The current page is also returned to be used in +future content requests.

+
+ + +
+
+
#   + + + def + delete_projection( + self, + projection_name: str, + pretty_response: bool = False +) -> Union[dict, str]: +
+ +
+ View Source +
    def delete_projection(self, projection_name: str,
+                          pretty_response: bool = False) \
+            -> Union[dict, str]:
+        """
+        description: This method is responsible for deleting a projection.
+        The delete operation is always asynchronous and performed in background.
+
+
+        pretty_response: If true it returns a string, otherwise a dictionary.
+        projection_name: Represents the projection name.
+
+        return: JSON object with an error message, a warning message or a
+        correct delete message
+        """
+        cluster_url_projection = f'{self.__service_url}/{projection_name}'
+
+        response = requests.delete(cluster_url_projection)
+        response.raise_for_status()
+
+        return self.__response_treat.treatment(response, pretty_response)
+
+ +
+ +

description: This method is responsible for deleting a projection. +The delete operation is always asynchronous and performed in background.

+ +

pretty_response: If true it returns a string, otherwise a dictionary. +projection_name: Represents the projection name.

+ +

return: JSON object with an error message, a warning message or a +correct delete message

+
+ + +
+
+
#   + + + def + wait(self, projection_name: str, timeout: int = None) -> dict: +
+ +
+ View Source +
    def wait(self, projection_name: str, timeout: int = None) -> dict:
+        """
+           description: This method is responsible to create a synchronization
+           barrier for the remove_dataset_attributes_async method,
+           delete_projection method.
+
+           name: Represents the projection name.
+           timeout: Represents the time in seconds to wait for a projection to
+           finish its run.
+
+           return: JSON object with an error message, a warning message or a
+           correct projection result
+        """
+        return self.__observer.wait(projection_name, timeout)
+
+ +
+ +

description: This method is responsible to create a synchronization +barrier for the remove_dataset_attributes_async method, +delete_projection method.

+ +

name: Represents the projection name. +timeout: Represents the time in seconds to wait for a projection to +finish its run.

+ +

return: JSON object with an error message, a warning message or a +correct projection result

+
+ + +
+
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/transform/scikitlearn.html b/docs/old/learning_orchestra_client/transform/scikitlearn.html new file mode 100644 index 0000000..f366640 --- /dev/null +++ b/docs/old/learning_orchestra_client/transform/scikitlearn.html @@ -0,0 +1,322 @@ + + + + + + + learning_orchestra_client.transform.scikitlearn API documentation + + + + + + + + +
+
+

+learning_orchestra_client.transform.scikitlearn

+ + +
+ View Source +
from ._transform import Transform
+
+
+class TransformScikitLearn(Transform):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/transform/scikitlearn"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ +
+
+
+ #   + + + class + TransformScikitLearn(learning_orchestra_client.transform._transform.Transform): +
+ +
+ View Source +
class TransformScikitLearn(Transform):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/transform/scikitlearn"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+
#   + + + TransformScikitLearn(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/transform/scikitlearn"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/old/learning_orchestra_client/transform/tensorflow.html b/docs/old/learning_orchestra_client/transform/tensorflow.html new file mode 100644 index 0000000..50cc4fc --- /dev/null +++ b/docs/old/learning_orchestra_client/transform/tensorflow.html @@ -0,0 +1,322 @@ + + + + + + + learning_orchestra_client.transform.tensorflow API documentation + + + + + + + + +
+
+

+learning_orchestra_client.transform.tensorflow

+ + +
+ View Source +
from ._transform import Transform
+
+
+class TransformTensorflow(Transform):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/transform/tensorflow"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ +
+
+
+ #   + + + class + TransformTensorflow(learning_orchestra_client.transform._transform.Transform): +
+ +
+ View Source +
class TransformTensorflow(Transform):
+    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/transform/tensorflow"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+
#   + + + TransformTensorflow(cluster_ip: str) +
+ +
+ View Source +
    def __init__(self, cluster_ip: str):
+        self.__api_path = "/api/learningOrchestra/v1/transform/tensorflow"
+        self.__cluster_ip = cluster_ip
+        super().__init__(cluster_ip, self.__api_path)
+
+ +
+ + + +
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/old/search.json b/docs/old/search.json new file mode 100644 index 0000000..8b37c0d --- /dev/null +++ b/docs/old/search.json @@ -0,0 +1 @@ +[{"fullname": "learning_orchestra_client", "modulename": "learning_orchestra_client", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.builder", "modulename": "learning_orchestra_client.builder", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.builder.builder", "modulename": "learning_orchestra_client.builder.builder", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.builder.builder.BuilderSparkMl", "modulename": "learning_orchestra_client.builder.builder", "qualname": "BuilderSparkMl", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.builder.builder.BuilderSparkMl.__init__", "modulename": "learning_orchestra_client.builder.builder", "qualname": "BuilderSparkMl.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.builder.builder.BuilderSparkMl.run_spark_ml_sync", "modulename": "learning_orchestra_client.builder.builder", "qualname": "BuilderSparkMl.run_spark_ml_sync", "type": "function", "doc": "

description: This method call runs several steps of a machine\nlearning pipeline (transform, tune, train and evaluate, for instance)\nusing a model code and several classifiers. It represents a way to run\nan entire pipeline. The caller waits until the method execution ends,\nsince it is a synchronous method.

\n\n

train_dataset_name: Represent final train dataset.\ntest_dataset_name: Represent final test dataset.\nmodeling_code: Represent Python3 code for pyspark pre-processing model\nmodel_classifiers: list of initial classifiers to be used in the model\npretty_response: if True it represents a result useful for visualization

\n\n

return: The set of predictions (URIs of them).

\n", "parameters": ["self", "train_dataset_name", "test_dataset_name", "modeling_code", "model_classifiers", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.builder.builder.BuilderSparkMl.run_spark_ml_async", "modulename": "learning_orchestra_client.builder.builder", "qualname": "BuilderSparkMl.run_spark_ml_async", "type": "function", "doc": "

description: This method call runs several steps of a machine\nlearning pipeline (transform, tune, train and evaluate, for instance)\nusing a model code and several classifiers. It represents a way to run\nan entire pipeline. The caller does not wait until the method execution\nends, since it is an asynchronous method.

\n\n

train_dataset_name: Represent final train dataset.\ntest_dataset_name: Represent final test dataset.\nmodeling_code: Represent Python3 code for pyspark pre-processing model\nmodel_classifiers: list of initial classifiers to be used in the model\npretty_response: if True it represents a result useful for visualization

\n\n

return: the URL to retrieve the Spark pipeline result

\n", "parameters": ["self", "train_dataset_name", "test_dataset_name", "modeling_code", "model_classifiers", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.builder.builder.BuilderSparkMl.search_all_builders", "modulename": "learning_orchestra_client.builder.builder", "qualname": "BuilderSparkMl.search_all_builders", "type": "function", "doc": "

description: This method retrieves all model predictions metadata. It\ndoes not retrieve the model predictions content.

\n\n

pretty_response: If true it returns a string, otherwise a dictionary.

\n\n

return: A list with all model predictions metadata stored in Learning\nOrchestra or an empty result.

\n", "parameters": ["self", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.builder.builder.BuilderSparkMl.search_builder_register_predictions", "modulename": "learning_orchestra_client.builder.builder", "qualname": "BuilderSparkMl.search_builder_register_predictions", "type": "function", "doc": "

description: This method is responsible for retrieving the model\npredictions content.

\n\n

pretty_response: If true it returns a string, otherwise a dictionary.\nbuilder_name: Represents the model predictions name.\nquery: Query to make in MongoDB(default: empty query)\nlimit: Number of rows to return in pagination(default: 10) (maximum is\nset at 20 rows per request)\nskip: Number of rows to skip in pagination(default: 0)

\n\n

return: A page with some tuples or registers inside or an error if the\npipeline runs incorrectly. The current page is also returned to be used\nin future content requests.

\n", "parameters": ["self", "builder_name", "query", "limit", "skip", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.builder.builder.BuilderSparkMl.search_builder", "modulename": "learning_orchestra_client.builder.builder", "qualname": "BuilderSparkMl.search_builder", "type": "function", "doc": "

description: This method is responsible for retrieving a specific\nmodel metadata.

\n\n

pretty_response: If true return indented string, else return dict.\nbuilder_name: Represents the model predictions name.\nlimit: Number of rows to return in pagination(default: 10) (maximum is\nset at 20 rows per request)\nskip: Number of rows to skip in pagination(default: 0)

\n\n

return: Specific model prediction metadata stored in Learning Orchestra\nor an error if there is no such projections.

\n", "parameters": ["self", "builder_name", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.builder.builder.BuilderSparkMl.delete_builder", "modulename": "learning_orchestra_client.builder.builder", "qualname": "BuilderSparkMl.delete_builder", "type": "function", "doc": "

description: This method is responsible for deleting a model prediction.\nThe delete operation is always asynchronous,\nsince the deletion is performed in background.

\n\n

pretty_response: If true it returns a string, otherwise a dictionary.\nbuilder_name: Represents the pipeline name.

\n\n

return: JSON object with an error message, a warning message or a\ncorrect delete message

\n", "parameters": ["self", "builder_name", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.builder.builder.BuilderSparkMl.wait", "modulename": "learning_orchestra_client.builder.builder", "qualname": "BuilderSparkMl.wait", "type": "function", "doc": "

description: This method is responsible to create a synchronization\nbarrier for the run_spark_ml_async method.

\n\n

dataset_name: Represents the pipeline name.\ntimeout: Represents the time in seconds to wait for a builder to\nfinish its run.

\n\n

return: JSON object with an error message, a warning message or a\ncorrect execution of a pipeline

\n", "parameters": ["self", "dataset_name", "timeout"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.dataset", "modulename": "learning_orchestra_client.dataset", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.dataset.csv", "modulename": "learning_orchestra_client.dataset.csv", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.dataset.csv.DatasetCsv", "modulename": "learning_orchestra_client.dataset.csv", "qualname": "DatasetCsv", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.dataset.csv.DatasetCsv.__init__", "modulename": "learning_orchestra_client.dataset.csv", "qualname": "DatasetCsv.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.dataset.generic", "modulename": "learning_orchestra_client.dataset.generic", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.dataset.generic.DatasetGeneric", "modulename": "learning_orchestra_client.dataset.generic", "qualname": "DatasetGeneric", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.dataset.generic.DatasetGeneric.__init__", "modulename": "learning_orchestra_client.dataset.generic", "qualname": "DatasetGeneric.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.evaluate", "modulename": "learning_orchestra_client.evaluate", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.evaluate.scikitlearn", "modulename": "learning_orchestra_client.evaluate.scikitlearn", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.evaluate.scikitlearn.EvaluateScikitLearn", "modulename": "learning_orchestra_client.evaluate.scikitlearn", "qualname": "EvaluateScikitLearn", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.evaluate.scikitlearn.EvaluateScikitLearn.__init__", "modulename": "learning_orchestra_client.evaluate.scikitlearn", "qualname": "EvaluateScikitLearn.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.evaluate.tensorflow", "modulename": "learning_orchestra_client.evaluate.tensorflow", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.evaluate.tensorflow.EvaluateTensorflow", "modulename": "learning_orchestra_client.evaluate.tensorflow", "qualname": "EvaluateTensorflow", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.evaluate.tensorflow.EvaluateTensorflow.__init__", "modulename": "learning_orchestra_client.evaluate.tensorflow", "qualname": "EvaluateTensorflow.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.explore", "modulename": "learning_orchestra_client.explore", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.explore.histogram", "modulename": "learning_orchestra_client.explore.histogram", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.explore.histogram.ExploreHistogram", "modulename": "learning_orchestra_client.explore.histogram", "qualname": "ExploreHistogram", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.explore.histogram.ExploreHistogram.__init__", "modulename": "learning_orchestra_client.explore.histogram", "qualname": "ExploreHistogram.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.explore.histogram.ExploreHistogram.run_histogram_sync", "modulename": "learning_orchestra_client.explore.histogram", "qualname": "ExploreHistogram.run_histogram_sync", "type": "function", "doc": "

description: This method creates a histogram\nsynchronously, so the caller waits until the histogram is inserted into\nthe Learning Orchestra storage mechanism.

\n\n

dataset_name: Represents the name of dataset.\nhistogram_name: Represents the name of histogram.\nfields: Represents a list of attributes.\npretty_response: If true it returns a string, otherwise a dictionary.

\n\n

return: A JSON object with error or warning messages. In case of\nsuccess, it returns a histogram.

\n", "parameters": ["self", "dataset_name", "histogram_name", "fields", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.explore.histogram.ExploreHistogram.run_histogram_async", "modulename": "learning_orchestra_client.explore.histogram", "qualname": "ExploreHistogram.run_histogram_async", "type": "function", "doc": "

description: This method creates a histogram\nasynchronously, so the caller does not wait until the histogram is\ninserted into the Learning Orchestra storage mechanism.

\n\n

dataset_name: Represents the name of dataset.\nhistogram_name: Represents the name of histogram.\nfields: Represents a list of attributes.\npretty_response: If true it returns a string, otherwise a dictionary.

\n\n

return: A JSON object with error or warning messages. In case of\nsuccess, it returns a histogram.

\n", "parameters": ["self", "dataset_name", "histogram_name", "fields", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.explore.histogram.ExploreHistogram.search_all_histograms", "modulename": "learning_orchestra_client.explore.histogram", "qualname": "ExploreHistogram.search_all_histograms", "type": "function", "doc": "

description: This method retrieves all histogram metadata, it does not\nretrieve the histogram content.

\n\n

pretty_response: If true it returns a string, otherwise a dictionary.

\n\n

return: A list with all histogram metadata stored in Learning Orchestra\nor an empty result.

\n", "parameters": ["self", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.explore.histogram.ExploreHistogram.search_histogram_content", "modulename": "learning_orchestra_client.explore.histogram", "qualname": "ExploreHistogram.search_histogram_content", "type": "function", "doc": "

description: This method is responsible for retrieving the histogram\ncontent.

\n\n

pretty_response: If true it returns a string, otherwise a dictionary.\nhistogram_name: Represents the histogram name.\nquery: Query to make in MongoDB(default: empty query)\nlimit: Number of rows to return in pagination(default: 10) (maximum is\nset at 20 rows per request)\nskip: Number of rows to skip in pagination(default: 0)

\n\n

return: A page with some tuples or registers inside or an error if there\nis no such projection. The current page is also returned to be used in\nfuture content requests.

\n", "parameters": ["self", "histogram_name", "query", "limit", "skip", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.explore.histogram.ExploreHistogram.delete_histogram", "modulename": "learning_orchestra_client.explore.histogram", "qualname": "ExploreHistogram.delete_histogram", "type": "function", "doc": "

description: This method is responsible for deleting a histogram.\nThe delete operation is always asynchronous,\nsince the deletion is performed in background.

\n\n

pretty_response: If true it returns a string, otherwise a dictionary.\nhistogram_name: Represents the histogram name.

\n\n

return: JSON object with an error message, a warning message or a\ncorrect delete message

\n", "parameters": ["self", "histogram_name", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.explore.histogram.ExploreHistogram.wait", "modulename": "learning_orchestra_client.explore.histogram", "qualname": "ExploreHistogram.wait", "type": "function", "doc": "

description: This method is responsible to create a synchronization\nbarrier for the run_histogram_async method or delete_histogram\nmethod.

\n\n

name: Represents the histogram name.\ntimeout: Represents the time in seconds to wait for a histogram to\nfinish its run.

\n\n

return: JSON object with an error message, a warning message or a\ncorrect histogram result

\n", "parameters": ["self", "name", "timeout"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.explore.scikitlearn", "modulename": "learning_orchestra_client.explore.scikitlearn", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.explore.scikitlearn.ExploreScikitLearn", "modulename": "learning_orchestra_client.explore.scikitlearn", "qualname": "ExploreScikitLearn", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.explore.scikitlearn.ExploreScikitLearn.__init__", "modulename": "learning_orchestra_client.explore.scikitlearn", "qualname": "ExploreScikitLearn.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.explore.tensorflow", "modulename": "learning_orchestra_client.explore.tensorflow", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.explore.tensorflow.ExploreTensorflow", "modulename": "learning_orchestra_client.explore.tensorflow", "qualname": "ExploreTensorflow", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.explore.tensorflow.ExploreTensorflow.__init__", "modulename": "learning_orchestra_client.explore.tensorflow", "qualname": "ExploreTensorflow.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.function", "modulename": "learning_orchestra_client.function", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.function.python", "modulename": "learning_orchestra_client.function.python", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.function.python.FunctionPython", "modulename": "learning_orchestra_client.function.python", "qualname": "FunctionPython", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.function.python.FunctionPython.__init__", "modulename": "learning_orchestra_client.function.python", "qualname": "FunctionPython.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.function.python.FunctionPython.run_function_sync", "modulename": "learning_orchestra_client.function.python", "qualname": "FunctionPython.run_function_sync", "type": "function", "doc": "

description: This method runs a python 3 code in sync mode, so it\nrepresents a wildcard for the data scientist. It can be used when\ntrain, predict, tune, explore or any other pipe must be customized. The\nfunction is also useful for new pipes. pretty_response: If true it\nreturns a string, otherwise a dictionary.

\n\n

name: Is the name of the object stored in Learning Orchestra storage\nsystem (volume or mongoDB).\nurl: Url to CSV file.

\n\n

return: A JSON object with an error or warning message or the correct\noperation result.

\n", "parameters": ["self", "name", "parameters", "code", "description", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.function.python.FunctionPython.run_function_async", "modulename": "learning_orchestra_client.function.python", "qualname": "FunctionPython.run_function_async", "type": "function", "doc": "

description: This method runs a python 3 code in async mode, so it\nrepresents a wildcard for the data scientist. It does not lock the\ncaller, so a wait method must be used. It can be used when train,\npredict, tune, explore or any other pipe must be customized. The\nfunction is also useful for new pipes.

\n\n

pretty_response: If true it returns a string, otherwise a dictionary.\nname: Is the name of the function to be called\ncode: the Python code\nparameters: the parameters of the function being called

\n\n

return: A JSON object with an error or warning message or the correct\noperation result.

\n", "parameters": ["self", "name", "parameters", "code", "description", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.function.python.FunctionPython.search_all_executions", "modulename": "learning_orchestra_client.function.python", "qualname": "FunctionPython.search_all_executions", "type": "function", "doc": "

description: This method retrieves all created functions metadata,\ni.e., it does not retrieve the function result content.

\n\n

pretty_response: If true it returns a string, otherwise a dictionary.

\n\n

return: All function executions metadata stored in Learning Orchestra\nor an empty result.

\n", "parameters": ["self", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.function.python.FunctionPython.delete_execution", "modulename": "learning_orchestra_client.function.python", "qualname": "FunctionPython.delete_execution", "type": "function", "doc": "

description: This method is responsible for deleting the function.\nThis delete operation is asynchronous, so it does not lock the caller\n until the deletion finished. Instead, it returns a JSON object with a\n URL for a future use. The caller uses the URL for delete checks.

\n\n

pretty_response: If true it returns a string, otherwise a dictionary.\nname: Represents the function name.

\n\n

return: JSON object with an error message, a warning message or a\ncorrect delete message

\n", "parameters": ["self", "name", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.function.python.FunctionPython.search_execution_content", "modulename": "learning_orchestra_client.function.python", "qualname": "FunctionPython.search_execution_content", "type": "function", "doc": "

description: This method is responsible for retrieving the function\nresults, including metadata. A function is executed many times, using\ndifferent parameters,\nthus many results are stored\nin Learning Orchestra.

\n\n

pretty_response: If true it returns a string, otherwise a dictionary.\nname: Is the name of the function.\nquery: Query to make in MongoDB(default: empty query)\nlimit: Number of rows to return in pagination(default: 10) (maximum is\nset at 20 rows per request)\nskip: Number of rows to skip in pagination(default: 0)

\n\n

return:\n A page with some function results inside or an error if there\nis no such function. The current page is also returned to be used in\nfuture content requests.

\n", "parameters": ["self", "name", "query", "limit", "skip", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.function.python.FunctionPython.wait", "modulename": "learning_orchestra_client.function.python", "qualname": "FunctionPython.wait", "type": "function", "doc": "

description: This method is responsible to create a synchronization\nbarrier for the run_function_async method or delete_function method.

\n\n

name: Represents the function name.\ntimeout: Represents the time in seconds to wait for a function to\nfinish its run.

\n\n

return: JSON object with an error message, a warning message or a\ncorrect function result

\n", "parameters": ["self", "dataset_name", "timeout"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.model", "modulename": "learning_orchestra_client.model", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.model.scikitlearn", "modulename": "learning_orchestra_client.model.scikitlearn", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.model.scikitlearn.ModelScikitLearn", "modulename": "learning_orchestra_client.model.scikitlearn", "qualname": "ModelScikitLearn", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.model.scikitlearn.ModelScikitLearn.__init__", "modulename": "learning_orchestra_client.model.scikitlearn", "qualname": "ModelScikitLearn.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.model.tensorflow", "modulename": "learning_orchestra_client.model.tensorflow", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.model.tensorflow.ModelTensorflow", "modulename": "learning_orchestra_client.model.tensorflow", "qualname": "ModelTensorflow", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.model.tensorflow.ModelTensorflow.__init__", "modulename": "learning_orchestra_client.model.tensorflow", "qualname": "ModelTensorflow.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.observe", "modulename": "learning_orchestra_client.observe", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.observe.observe", "modulename": "learning_orchestra_client.observe.observe", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.observe.observe.Observer", "modulename": "learning_orchestra_client.observe.observe", "qualname": "Observer", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.observe.observe.Observer.__init__", "modulename": "learning_orchestra_client.observe.observe", "qualname": "Observer.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.observe.observe.Observer.wait", "modulename": "learning_orchestra_client.observe.observe", "qualname": "Observer.wait", "type": "function", "doc": "

:description: Observe the end of a pipe for a timeout seconds or\nuntil the pipe finishes its execution.

\n\n

name: Represents the pipe name. Any tune, train, predict service can\nwait its finish with a\nwait method call.\ntimeout: the maximum time to wait the observed step, in seconds.

\n\n

:return: If True it returns a String. Otherwise, it returns\na dictionary with the content of a mongo collection, representing\nany pipe result

\n", "parameters": ["self", "name", "timeout"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.observe.observe.Observer.observe_pipe", "modulename": "learning_orchestra_client.observe.observe", "qualname": "Observer.observe_pipe", "type": "function", "doc": "

:description: It waits until a pipe change its content\n(replace, insert, update and delete mongoDB collection operation\ntypes), so it is a bit different\nfrom wait method with a timeout and a finish explicit condition.

\n\n

:name: the name of the pipe to be observed. A train, predict, explore,\ntransform or any\nother pipe can be observed.\ntimeout: the maximum time to wait the observed step, in milliseconds.

\n\n

:return: A pymongo CollectionChangeStream object. You must use the\nbuiltin next() method to iterate over changes.

\n", "parameters": ["self", "name", "timeout"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.predict", "modulename": "learning_orchestra_client.predict", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.predict.scikitlearn", "modulename": "learning_orchestra_client.predict.scikitlearn", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.predict.scikitlearn.PredictScikitLearn", "modulename": "learning_orchestra_client.predict.scikitlearn", "qualname": "PredictScikitLearn", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.predict.scikitlearn.PredictScikitLearn.__init__", "modulename": "learning_orchestra_client.predict.scikitlearn", "qualname": "PredictScikitLearn.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.predict.tensorflow", "modulename": "learning_orchestra_client.predict.tensorflow", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.predict.tensorflow.PredictTensorflow", "modulename": "learning_orchestra_client.predict.tensorflow", "qualname": "PredictTensorflow", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.predict.tensorflow.PredictTensorflow.__init__", "modulename": "learning_orchestra_client.predict.tensorflow", "qualname": "PredictTensorflow.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.train", "modulename": "learning_orchestra_client.train", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.train.scikitlearn", "modulename": "learning_orchestra_client.train.scikitlearn", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.train.scikitlearn.TrainScikitLearn", "modulename": "learning_orchestra_client.train.scikitlearn", "qualname": "TrainScikitLearn", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.train.scikitlearn.TrainScikitLearn.__init__", "modulename": "learning_orchestra_client.train.scikitlearn", "qualname": "TrainScikitLearn.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.train.tensorflow", "modulename": "learning_orchestra_client.train.tensorflow", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.train.tensorflow.TrainTensorflow", "modulename": "learning_orchestra_client.train.tensorflow", "qualname": "TrainTensorflow", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.train.tensorflow.TrainTensorflow.__init__", "modulename": "learning_orchestra_client.train.tensorflow", "qualname": "TrainTensorflow.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.transform", "modulename": "learning_orchestra_client.transform", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.transform.data_type", "modulename": "learning_orchestra_client.transform.data_type", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.transform.data_type.TransformDataType", "modulename": "learning_orchestra_client.transform.data_type", "qualname": "TransformDataType", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.transform.data_type.TransformDataType.__init__", "modulename": "learning_orchestra_client.transform.data_type", "qualname": "TransformDataType.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.transform.data_type.TransformDataType.update_dataset_type_sync", "modulename": "learning_orchestra_client.transform.data_type", "qualname": "TransformDataType.update_dataset_type_sync", "type": "function", "doc": "

description: Change dataset field types (from number to string and\nvice-versa). Many type modifications can be performed in one method\ncall.

\n\n

dataset_name: Represents the dataset name.\ntypes: Represents a map, where the pair key:value is a field:type

\n\n

return: A JSON object with error or warning messages or a correct\ndatatype result.

\n", "parameters": ["self", "dataset_name", "types", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.transform.data_type.TransformDataType.update_dataset_type_async", "modulename": "learning_orchestra_client.transform.data_type", "qualname": "TransformDataType.update_dataset_type_async", "type": "function", "doc": "

description: Change dataset field types (from number to string and\nvice-versa). Many type modifications can be performed in one method\ncall. Is is an asynchronous call, thus a wait method must be also\ncalled to guarantee a synchronization barrier.

\n\n

dataset_name: Represents the dataset name.\ntypes: Represents a map, where the pair key:value is a field:type

\n\n

return: A JSON object with error or warning messages or a correct\ndatatype result.

\n", "parameters": ["self", "dataset_name", "types", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.transform.data_type.TransformDataType.search_all_datatype", "modulename": "learning_orchestra_client.transform.data_type", "qualname": "TransformDataType.search_all_datatype", "type": "function", "doc": "

description: This method retrieves all datatype metadata, i.e., it does\nnot retrieve the datatype content.

\n\n

pretty_response: If true it returns a string, otherwise a dictionary.

\n\n

return: All predict metadata stored in Learning Orchestra or an empty\nresult.

\n", "parameters": ["self", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.transform.data_type.TransformDataType.delete_datatype", "modulename": "learning_orchestra_client.transform.data_type", "qualname": "TransformDataType.delete_datatype", "type": "function", "doc": "

description: This method is responsible for deleting the datatype step.\nThis delete operation is asynchronous, so it does not lock the caller\n until the deletion finished. Instead, it returns a JSON object with a\n URL for a future use. The caller uses the URL for delete checks.

\n\n

pretty_response: If true it returns a string, otherwise a dictionary.\nname: Represents the datatype name.

\n\n

return: JSON object with an error message, a warning message or a\ncorrect delete message

\n", "parameters": ["self", "name", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.transform.data_type.TransformDataType.search_datatype_content", "modulename": "learning_orchestra_client.transform.data_type", "qualname": "TransformDataType.search_datatype_content", "type": "function", "doc": "

description: This method is responsible for retrieving all the datatype\ntuples or registers, as well as the metadata content

\n\n

pretty_response: If true it returns a string, otherwise a dictionary.\nname: Is the name of the datatype object\nquery: Query to make in MongoDB(default: empty query)\nlimit: Number of rows to return in pagination(default: 10) (maximum is\nset at 20 rows per request)\nskip: Number of rows to skip in pagination(default: 0)

\n\n

return: A page with some registers or tuples inside or an error if there\nis no such datatype object. The current page is also returned to be\nused in future content requests.

\n", "parameters": ["self", "name", "query", "limit", "skip", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.transform.data_type.TransformDataType.wait", "modulename": "learning_orchestra_client.transform.data_type", "qualname": "TransformDataType.wait", "type": "function", "doc": "

description: This method is responsible to create a synchronization\nbarrier for the update_dataset_type_async method, delete_datatype\nmethod.

\n\n

name: Represents the datatype name.\ntimeout: Represents the time in seconds to wait for a datatype to\nfinish its run.

\n\n

return: JSON object with an error message, a warning message or a\ncorrect datatype result

\n", "parameters": ["self", "dataset_name", "timeout"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.transform.projection", "modulename": "learning_orchestra_client.transform.projection", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.transform.projection.TransformProjection", "modulename": "learning_orchestra_client.transform.projection", "qualname": "TransformProjection", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.transform.projection.TransformProjection.__init__", "modulename": "learning_orchestra_client.transform.projection", "qualname": "TransformProjection.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.transform.projection.TransformProjection.remove_dataset_attributes_sync", "modulename": "learning_orchestra_client.transform.projection", "qualname": "TransformProjection.remove_dataset_attributes_sync", "type": "function", "doc": "

description: This method removes a set of attributes of a dataset\nsynchronously, the caller waits until the projection is inserted into\nthe Learning Orchestra storage mechanism.

\n\n

pretty_response: If returns true a string, otherwise a dictionary.\nprojection_name: Represents the projection name.\ndataset_name: Represents the dataset name.\nfields: Represents the set of attributes to be removed. This is list\nwith some attributes.

\n\n

return: A JSON object with error or warning messages. In case of\nsuccess, it returns the projection metadata.

\n", "parameters": ["self", "dataset_name", "projection_name", "fields", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.transform.projection.TransformProjection.remove_dataset_attributes_async", "modulename": "learning_orchestra_client.transform.projection", "qualname": "TransformProjection.remove_dataset_attributes_async", "type": "function", "doc": "

description: This method removes a set of attributes of a dataset\nasynchronously; this way, the caller does not wait until the projection\nis inserted into the Learning Orchestra storage mechanism. A wait\nmethod call must occur to guarantee a synchronization barrier.

\n\n

pretty_response: If returns true a string, otherwise a dictionary.\nprojection_name: Represents the projection name.\ndataset_name: Represents the dataset name.\nfields: Represents the set of attributes to be removed. This is list\nwith some attributes.

\n\n

return: A JSON object with error or warning messages. In case of\nsuccess, it returns the projection URL to be obtained latter with a\nwait method call.

\n", "parameters": ["self", "dataset_name", "projection_name", "fields", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.transform.projection.TransformProjection.search_all_projections", "modulename": "learning_orchestra_client.transform.projection", "qualname": "TransformProjection.search_all_projections", "type": "function", "doc": "

description: This method retrieves all projection metadata, i.e., it\ndoes not retrieve the projection content.

\n\n

pretty_response: If true it returns a string, otherwise a dictionary.

\n\n

return: A list with all projections metadata stored in Learning\nOrchestra or an empty result.

\n", "parameters": ["self", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.transform.projection.TransformProjection.search_projection_content", "modulename": "learning_orchestra_client.transform.projection", "qualname": "TransformProjection.search_projection_content", "type": "function", "doc": "

description: This method is responsible for retrieving the projection\ncontent.

\n\n

pretty_response: If true it returns a string, otherwise a dictionary.\nprojection_name: Represents the projection name.\nquery: Query to make in MongoDB(default: empty query)\nlimit: Number of rows to return in pagination(default: 10) (maximum is\nset at 20 rows per request)\nskip: Number of rows to skip in pagination(default: 0)

\n\n

return: A page with some tuples or registers inside or an error if there\nis no such projection. The current page is also returned to be used in\nfuture content requests.

\n", "parameters": ["self", "projection_name", "query", "limit", "skip", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.transform.projection.TransformProjection.delete_projection", "modulename": "learning_orchestra_client.transform.projection", "qualname": "TransformProjection.delete_projection", "type": "function", "doc": "

description: This method is responsible for deleting a projection.\nThe delete operation is always asynchronous and performed in background.

\n\n

pretty_response: If true it returns a string, otherwise a dictionary.\nprojection_name: Represents the projection name.

\n\n

return: JSON object with an error message, a warning message or a\ncorrect delete message

\n", "parameters": ["self", "projection_name", "pretty_response"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.transform.projection.TransformProjection.wait", "modulename": "learning_orchestra_client.transform.projection", "qualname": "TransformProjection.wait", "type": "function", "doc": "

description: This method is responsible to create a synchronization\nbarrier for the remove_dataset_attributes_async method,\ndelete_projection method.

\n\n

name: Represents the projection name.\ntimeout: Represents the time in seconds to wait for a projection to\nfinish its run.

\n\n

return: JSON object with an error message, a warning message or a\ncorrect projection result

\n", "parameters": ["self", "projection_name", "timeout"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.transform.scikitlearn", "modulename": "learning_orchestra_client.transform.scikitlearn", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.transform.scikitlearn.TransformScikitLearn", "modulename": "learning_orchestra_client.transform.scikitlearn", "qualname": "TransformScikitLearn", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.transform.scikitlearn.TransformScikitLearn.__init__", "modulename": "learning_orchestra_client.transform.scikitlearn", "qualname": "TransformScikitLearn.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}, {"fullname": "learning_orchestra_client.transform.tensorflow", "modulename": "learning_orchestra_client.transform.tensorflow", "qualname": "", "type": "module", "doc": "

\n"}, {"fullname": "learning_orchestra_client.transform.tensorflow.TransformTensorflow", "modulename": "learning_orchestra_client.transform.tensorflow", "qualname": "TransformTensorflow", "type": "class", "doc": "

\n"}, {"fullname": "learning_orchestra_client.transform.tensorflow.TransformTensorflow.__init__", "modulename": "learning_orchestra_client.transform.tensorflow", "qualname": "TransformTensorflow.__init__", "type": "function", "doc": "

\n", "parameters": ["self", "cluster_ip"], "funcdef": "def"}] \ No newline at end of file diff --git a/html/learning_orchestra_client/predict/index.html b/docs/predict/index.html similarity index 100% rename from html/learning_orchestra_client/predict/index.html rename to docs/predict/index.html diff --git a/html/learning_orchestra_client/predict/scikitlearn.html b/docs/predict/scikitlearn.html similarity index 100% rename from html/learning_orchestra_client/predict/scikitlearn.html rename to docs/predict/scikitlearn.html diff --git a/html/learning_orchestra_client/predict/tensorflow.html b/docs/predict/tensorflow.html similarity index 100% rename from html/learning_orchestra_client/predict/tensorflow.html rename to docs/predict/tensorflow.html diff --git a/html/learning_orchestra_client/train/horovod.html b/docs/train/horovod.html similarity index 100% rename from html/learning_orchestra_client/train/horovod.html rename to docs/train/horovod.html diff --git a/html/learning_orchestra_client/train/index.html b/docs/train/index.html similarity index 100% rename from html/learning_orchestra_client/train/index.html rename to docs/train/index.html diff --git a/html/learning_orchestra_client/train/scikitlearn.html b/docs/train/scikitlearn.html similarity index 100% rename from html/learning_orchestra_client/train/scikitlearn.html rename to docs/train/scikitlearn.html diff --git a/html/learning_orchestra_client/train/tensorflow.html b/docs/train/tensorflow.html similarity index 100% rename from html/learning_orchestra_client/train/tensorflow.html rename to docs/train/tensorflow.html diff --git a/html/learning_orchestra_client/transform/data_type.html b/docs/transform/data_type.html similarity index 100% rename from html/learning_orchestra_client/transform/data_type.html rename to docs/transform/data_type.html diff --git a/html/learning_orchestra_client/transform/index.html b/docs/transform/index.html similarity index 100% rename from html/learning_orchestra_client/transform/index.html rename to docs/transform/index.html diff --git a/html/learning_orchestra_client/transform/projection.html b/docs/transform/projection.html similarity index 100% rename from html/learning_orchestra_client/transform/projection.html rename to docs/transform/projection.html diff --git a/html/learning_orchestra_client/transform/scikitlearn.html b/docs/transform/scikitlearn.html similarity index 100% rename from html/learning_orchestra_client/transform/scikitlearn.html rename to docs/transform/scikitlearn.html diff --git a/html/learning_orchestra_client/transform/tensorflow.html b/docs/transform/tensorflow.html similarity index 100% rename from html/learning_orchestra_client/transform/tensorflow.html rename to docs/transform/tensorflow.html