Пример #1
0
    def model_is_ready(self, model, **kwargs):
        """Checks whether a model's status is FINISHED.

        """
        check_resource_type(model, MODEL_PATH, message="A model id is needed.")
        resource = self.get_model(model, **kwargs)
        return resource_is_ready(resource)
Пример #2
0
    def source_is_ready(self, source):
        """Checks whether a source' status is FINISHED.

        """
        check_resource_type(source, SOURCE_PATH, message="A source id is needed.")
        source = self.get_source(source)
        return resource_is_ready(source)
Пример #3
0
    def dataset_is_ready(self, dataset):
        """Check whether a dataset' status is FINISHED.

        """
        check_resource_type(dataset, DATASET_PATH, message="A dataset id is needed.")
        resource = self.get_dataset(dataset)
        return resource_is_ready(resource)
Пример #4
0
    def pca_is_ready(self, pca, **kwargs):
        """Checks whether a pca's status is FINISHED.

        """
        check_resource_type(pca, PCA_PATH, message="A PCA id is needed.")
        resource = self.get_pca(pca, **kwargs)
        return resource_is_ready(resource)
Пример #5
0
    def anomaly_is_ready(self, anomaly, **kwargs):
        """Checks whether an anomaly detector's status is FINISHED.

        """
        check_resource_type(anomaly, ANOMALY_PATH,
                            message="An anomaly id is needed.")
        resource = self.get_anomaly(anomaly, **kwargs)
        return resource_is_ready(resource)
Пример #6
0
    def topic_model_is_ready(self, topic_model, **kwargs):
        """Checks whether a topic model's status is FINISHED.

        """
        check_resource_type(topic_model, TOPIC_MODEL_PATH,
                            message="A topic model id is needed.")
        resource = self.get_topic_model(topic_model, **kwargs)
        return resource_is_ready(resource)
Пример #7
0
    def lda_is_ready(self, lda, **kwargs):
        """Checks whether an LDA's status is FINISHED.

        """
        check_resource_type(lda, LDA_PATH,
                            message="An LDA id is needed.")
        resource = self.get_lda(lda, **kwargs)
        return resource_is_ready(resource)
Пример #8
0
    def fusion_is_ready(self, fusion, **kwargs):
        """Checks whether a fusion's status is FINISHED.

        """
        check_resource_type(fusion, FUSION_PATH,
                            message="A fusion id is needed.")
        resource = self.get_fusion(fusion, **kwargs)
        return resource_is_ready(resource)
Пример #9
0
    def cluster_is_ready(self, cluster, **kwargs):
        """Checks whether a cluster's status is FINISHED.

        """
        check_resource_type(cluster, CLUSTER_PATH,
                            message="A cluster id is needed.")
        resource = self.get_cluster(cluster, **kwargs)
        return resource_is_ready(resource)
Пример #10
0
    def time_series_is_ready(self, time_series, **kwargs):
        """Checks whether a time series's status is FINISHED.

        """
        check_resource_type(time_series, TIME_SERIES_PATH,
                            message="A time series id is needed.")
        resource = self.get_time_series(time_series, **kwargs)
        return resource_is_ready(resource)
Пример #11
0
    def dataset_is_ready(self, dataset):
        """Check whether a dataset' status is FINISHED.

        """
        check_resource_type(dataset, DATASET_PATH,
                            message="A dataset id is needed.")
        resource = self.get_dataset(dataset)
        return resource_is_ready(resource)
Пример #12
0
    def linear_regression_is_ready(self, linear_regression, **kwargs):
        """Checks whether a linear regressioin's status is FINISHED.

        """
        check_resource_type(linear_regression, LINEAR_REGRESSION_PATH,
                            message="A linear regression id is needed.")
        resource = self.get_linear_regression(linear_regression, **kwargs)
        return resource_is_ready(resource)
Пример #13
0
    def deepnet_is_ready(self, deepnet, **kwargs):
        """Checks whether a deepnet's status is FINISHED.

        """
        check_resource_type(deepnet, DEEPNET_PATH,
                            message="A deepnet id is needed.")
        resource = self.get_deepnet(deepnet, **kwargs)
        return resource_is_ready(resource)
Пример #14
0
    def topic_model_is_ready(self, topic_model, **kwargs):
        """Checks whether a topic model's status is FINISHED.

        """
        check_resource_type(topic_model, TOPIC_MODEL_PATH,
                            message="A topic model id is needed.")
        resource = self.get_topic_model(topic_model, **kwargs)
        return resource_is_ready(resource)
Пример #15
0
    def deepnet_is_ready(self, deepnet, **kwargs):
        """Checks whether a deepnet's status is FINISHED.

        """
        check_resource_type(deepnet, DEEPNET_PATH,
                            message="A deepnet id is needed.")
        resource = self.get_deepnet(deepnet, **kwargs)
        return resource_is_ready(resource)
Пример #16
0
    def ensemble_is_ready(self, ensemble):
        """Checks whether a ensemble's status is FINISHED.

        """
        check_resource_type(ensemble, ENSEMBLE_PATH,
                            message="An ensemble id is needed.")
        resource = self.get_ensemble(ensemble)
        return resource_is_ready(resource)
Пример #17
0
    def logistic_regression_is_ready(self, logistic_regression, **kwargs):
        """Checks whether a logistic regressioin's status is FINISHED.

        """
        check_resource_type(logistic_regression, LOGISTIC_REGRESSION_PATH,
                            message="A logistic regression id is needed.")
        resource = self.get_logistic_regression(logistic_regression, **kwargs)
        return resource_is_ready(resource)
Пример #18
0
    def cluster_is_ready(self, cluster, **kwargs):
        """Checks whether a cluster's status is FINISHED.

        """
        check_resource_type(cluster, CLUSTER_PATH,
                            message="A cluster id is needed.")
        resource = self.get_cluster(cluster, **kwargs)
        return resource_is_ready(resource)
Пример #19
0
    def pca_is_ready(self, pca, **kwargs):
        """Checks whether a pca's status is FINISHED.

        """
        check_resource_type(pca, PCA_PATH,
                            message="A PCA id is needed.")
        resource = self.get_pca(pca, **kwargs)
        return resource_is_ready(resource)
Пример #20
0
    def model_is_ready(self, model, **kwargs):
        """Checks whether a model's status is FINISHED.

        """
        check_resource_type(model, MODEL_PATH,
                            message="A model id is needed.")
        resource = self.get_model(model, **kwargs)
        return resource_is_ready(resource)
Пример #21
0
    def source_is_ready(self, source):
        """Checks whether a source' status is FINISHED.

        """
        check_resource_type(source, SOURCE_PATH,
                            message="A source id is needed.")
        source = self.get_source(source)
        return resource_is_ready(source)
Пример #22
0
    def anomaly_is_ready(self, anomaly, **kwargs):
        """Checks whether an anomaly detector's status is FINISHED.

        """
        check_resource_type(anomaly, ANOMALY_PATH,
                            message="An anomaly id is needed.")
        resource = self.get_anomaly(anomaly, **kwargs)
        return resource_is_ready(resource)
Пример #23
0
    def ensemble_is_ready(self, ensemble):
        """Checks whether a ensemble's status is FINISHED.

        """
        check_resource_type(ensemble, ENSEMBLE_PATH,
                            message="An ensemble id is needed.")
        resource = self.get_ensemble(ensemble)
        return resource_is_ready(resource)
Пример #24
0
    def logistic_regression_is_ready(self, logistic_regression, **kwargs):
        """Checks whether a logistic regressioin's status is FINISHED.

        """
        check_resource_type(logistic_regression,
                            LOGISTIC_REGRESSION_PATH,
                            message="A logistic regression id is needed.")
        resource = self.get_logistic_regression(logistic_regression, **kwargs)
        return resource_is_ready(resource)
Пример #25
0
    def fusion_is_ready(self, fusion, **kwargs):
        """Checks whether a fusion's status is FINISHED.

        """
        check_resource_type(fusion,
                            FUSION_PATH,
                            message="A fusion id is needed.")
        resource = self.get_fusion(fusion, **kwargs)
        return resource_is_ready(resource)
Пример #26
0
    def optiml_is_ready(self, optiml, **kwargs):
        """Checks whether an optiml's status is FINISHED.

        """
        check_resource_type(optiml,
                            OPTIML_PATH,
                            message="An optiml id is needed.")
        resource = self.get_optiml(optiml, **kwargs)
        return resource_is_ready(resource)
Пример #27
0
    def linear_regression_is_ready(self, linear_regression, **kwargs):
        """Checks whether a linear regressioin's status is FINISHED.

        """
        check_resource_type(linear_regression,
                            LINEAR_REGRESSION_PATH,
                            message="A linear regression id is needed.")
        resource = self.get_linear_regression(linear_regression, **kwargs)
        return resource_is_ready(resource)
Пример #28
0
def lacks_info(model, inner_key="model"):
    """Whether the information in `model` is not enough to use it locally

    """
    try:
        return not (resource_is_ready(model) and \
            check_model_structure(model, inner_key) and \
            check_model_fields(model))
    except Exception:
        return True
Пример #29
0
def lacks_info(model, inner_key="model"):
    """Whether the information in `model` is not enough to use it locally

    """
    try:
        return not (resource_is_ready(model) and \
            check_model_structure(model, inner_key) and \
            check_model_fields(model))
    except Exception:
        return True