Beispiel #1
0
    def __init__(self, uuid, **kwargs):
        # Call super class init first
        model.__init__(self, uuid, **kwargs)

        self._feature_vector_paths = kwargs.get("feature_vectors")
        self._truth_vector_paths = kwargs.get("truth_vectors")

        # Handle to storage for model parameters
        params = self._parameters

        # Set various bits of meta data, these are defaults and can be changed later
        params.setMetaData("model_type", u"decision_tree_regressor_model")
        params.setMetaData("model_desc",
                           u"SciKits Decision Tree Regressor implementation")

        params.setMetaData("criterion", kwargs.get("criterion"))
        params.setMetaData("splitter", kwargs.get("splitter"))
        params.setMetaData("max_features", kwargs.get("max_features"))
        params.setMetaData("max_depth", kwargs.get("max_depth"))
        params.setMetaData("min_samples_split",
                           kwargs.get("min_samples_split"))
        params.setMetaData("min_samples_leaf", kwargs.get("min_samples_leaf"))
        params.setMetaData("max_weight_fraction_leaf",
                           kwargs.get("max_weight_fraction_leaf"))
        params.setMetaData("max_leaf_nodes", kwargs.get("max_leaf_nodes"))
        params.setMetaData("random_state", kwargs.get("random_state"))
        params.setMetaData("presort", kwargs.get("presort"))

        # Validation fields
        # params.addRequiredBinaryFields([
        # "lr_coef_json",
        # "lr_intercept_json"])

        # Validator information
        params.setMetaData("db_views", [])
    def __init__(self, uuid, **kwargs):
        # Call super class init first
        model.__init__(self, uuid, **kwargs)

        gamma = kwargs.get("gamma")
        if (gamma is None):
            gamma = 0.001

        # Handle to storage for model parameters
        # Set various bits of meta data, these are defaults and can be changed later
        self._parameters.setMetaData("model_type", u"example_model")
        self._parameters.setMetaData("model_desc", u"A description of the example_model")
        self._parameters.setMetaData("gamma", gamma)
        self._parameters.setMetaData("clf", {})
        self._parameters.setMetaData("feature_vectors", [])
        self._parameters.setMetaData("truth_vectors", [])
Beispiel #3
0
    def __init__(self, uuid, **kwargs):
        # Call super class init first
        model.__init__(self, uuid, **kwargs)

        self._feature_vector_paths = kwargs.get("feature_vectors")
        self._truth_vector_paths = kwargs.get("truth_vectors")

        # Handle to storage for model parameters
        params = self._parameters

        # Set various bits of meta data, these are defaults and can be changed later
        params.setMetaData("model_type", u"gaussian_nb_model")
        params.setMetaData("model_desc",
                           u"SciKits Gaussian Naive Bayes implementation")

        # Validator information
        params.setMetaData("db_views", [])
Beispiel #4
0
    def __init__(self, uuid, **kwargs):
        # Call super class init first
        model.__init__(self, uuid, **kwargs)

        # Handle to storage for model parameters
        params = self._parameters

        # Set various bits of meta data, these are defaults and can be changed later
        params.setMetaData("model_type", u"multinomial_nb_model")
        params.setMetaData("model_desc",
                           u"SciKits Multinomial Naive Bayes implementation")

        params.setMetaData("alpha", kwargs.get("alpha"))
        params.setMetaData("fit_prior", kwargs.get("fit_prior"))
        params.setMetaData("class_prior", kwargs.get("class_prior"))

        # Validator information
        params.setMetaData("db_views", [])
    def __init__(self, uuid, **kwargs):
        """ Create instance of the db management model
            Input:
                kwargs: various parameters
        """

        # Call super class init first
        model.__init__(self, uuid, **kwargs)

        # Handle to storage for model parameters
        params = self._parameters

        # Set various bits of meta data, these are defaults and can be changed later
        params.setMetaData("model_type", u"attribute_index")
        params.setMetaData("model_desc", u"The most awesome attribute_index model ever")
        params.setMetaData("value_index", {})
        params.setMetaData("processed_count", 0)
        params.setMetaData("count_threshold", 0)

        attributes_to_index = kwargs.get("attributes_to_index")
        if attributes_to_index is None:
            attributes_to_index = []

        values_to_index = kwargs.get("values_to_index")
        if values_to_index is None:
            values_to_index = []

        count_threshold = kwargs.get("count_threshold")
        if (count_threshold == None):
            count_threshold = 0

        params.setMetaData("attributes_to_index", attributes_to_index)
        params.setMetaData("values_to_index", values_to_index)
        params.setMetaData("count_threshold", count_threshold)

        self._hyperparameter_list.append("attributes_to_index")
        self._hyperparameter_list.append("values_to_index")
        self._hyperparameter_list.append("count_threshold")
Beispiel #6
0
    def __init__(self, uuid, **kwargs):
        # Call super class init first
        print "lr_model kwargs " + str(kwargs)

        model.__init__(self, uuid, **kwargs)

        self._feature_vector_paths = kwargs.get("feature_vectors")
        self._truth_vector_paths = kwargs.get("truth_vectors")

        # Handle to storage for model parameters
        params = self._parameters

        # Set various bits of meta data, these are defaults and can be changed later
        params.setMetaData("model_type", u"logistic_regression_model")
        params.setMetaData("model_desc",
                           u"SciKits Logistic Regression implementation")

        params.setMetaData("penalty", kwargs.get("penalty"))
        params.setMetaData("dual", kwargs.get("dual"))
        params.setMetaData("C", kwargs.get("C"))
        params.setMetaData("fit_intercept", kwargs.get("fit_intercept"))
        params.setMetaData("intercept_scaling",
                           kwargs.get("intercept_scaling"))
        params.setMetaData("class_weight", kwargs.get("class_weight"))
        params.setMetaData("max_iter", kwargs.get("max_iter"))
        params.setMetaData("random_state", kwargs.get("random_state"))
        params.setMetaData("solver", kwargs.get("solver"))
        params.setMetaData("tol", kwargs.get("tol"))
        params.setMetaData("multi_class", kwargs.get("multi_class"))
        params.setMetaData("verbose", kwargs.get("verbose"))

        # Validation fields
        # params.addRequiredBinaryFields([
        # "lr_coef_json",
        # "lr_intercept_json"])

        # Validator information
        params.setMetaData("db_views", [])
Beispiel #7
0
    def __init__(self, uuid, **kwargs):
        """ Create instance of the db management model
            Input:
                kwargs: various parameters
        """
        # Call super class init first
        model.__init__(self, uuid, **kwargs)

        # Handle to storage for model parameters
        params = self._parameters

        # Set various bits of meta data, these are defaults and can be changed later
        params.setMetaData("model_type", u"attribute_count_analysis")
        params.setMetaData(
            "model_desc",
            u"The most awesome attribute_count_analysis model ever")

        params.setMetaData("attribute_index_name",
                           kwargs.get("attribute_index_name"))
        params.setMetaData("attribute_index_db_type",
                           kwargs.get("attribute_index_db_type"))
        params.setMetaData("attribute_index_db_host",
                           kwargs.get("attribute_index_db_host"))
        params.setMetaData("attribute_index_db_name",
                           kwargs.get("attribute_index_db_name"))

        antecedent_key_list = kwargs.get("antecedent_key_list")
        if antecedent_key_list is None:
            antecedent_key_list = []
        antecedent_value_list = kwargs.get("antecedent_value_list")
        if antecedent_value_list is None:
            antecedent_value_list = []
        consequent_key_list = kwargs.get("consequent_key_list")
        if consequent_key_list is None:
            consequent_key_list = []
        consequent_value_list = kwargs.get("consequent_value_list")
        if consequent_value_list is None:
            consequent_value_list = []

        params.setMetaData("antecedent_key_list", antecedent_key_list)
        params.setMetaData("antecedent_value_list", antecedent_value_list)
        params.setMetaData("consequent_key_list", consequent_key_list)
        params.setMetaData("consequent_value_list", consequent_value_list)

        #         report_antecedent_count = kwargs.get("report_antecedent_count")
        #         if (report_antecedent_count==None):
        #             report_antecedent_count = False
        report_tp = kwargs.get("report_tp")
        if report_tp is None:
            report_tp = False
        report_fp = kwargs.get("report_fp")
        if report_fp is None:
            report_fp = False
        report_fn = kwargs.get("report_fn")
        if report_fn is None:
            report_fn = False
        report_precision = kwargs.get("report_precision")
        if report_precision is None:
            report_precision = False
        report_recall = kwargs.get("report_recall")
        if report_recall is None:
            report_recall = False
        report_f_measure = kwargs.get("report_f_measure")
        if report_f_measure is None:
            report_f_measure = False

        # params.setMetaData("report_antecedent_count", report_antecedent_count)
        params.setMetaData("report_tp", report_tp)
        params.setMetaData("report_fp", report_fp)
        params.setMetaData("report_fn", report_fn)
        params.setMetaData("report_precision", report_precision)
        params.setMetaData("report_recall", report_recall)
        params.setMetaData("report_f_measure", report_f_measure)

        self._hyperparameter_list.append("attribute_index_name")
        self._hyperparameter_list.append("attribute_index_db_type")
        self._hyperparameter_list.append("attribute_index_db_host")
        self._hyperparameter_list.append("attribute_index_db_name")
        self._hyperparameter_list.append("antecedent_key_list")
        self._hyperparameter_list.append("antecedent_value_list")
        self._hyperparameter_list.append("consequent_key_list")
        self._hyperparameter_list.append("consequent_value_list")
        self._hyperparameter_list.append("report_tp")
        self._hyperparameter_list.append("report_fp")
        self._hyperparameter_list.append("report_fn")
        self._hyperparameter_list.append("report_precision")
        self._hyperparameter_list.append("report_recall")
        self._hyperparameter_list.append("report_f_measure")

        params.setMetaData("value_lists", {})
        params.setMetaData("tp_lists", {})
        params.setMetaData("fp_lists", {})
        params.setMetaData("fn_lists", {})
        params.setMetaData("stats_dicts", {})