From f90580123a091faba7a241669aacc8f8700fa96b Mon Sep 17 00:00:00 2001 From: Hector Dominguez Date: Thu, 21 Feb 2019 23:45:28 -0500 Subject: [PATCH 1/4] create primitive for `sklearn.linear_model.MultiTaskLasso` --- .../sklearn.linear_model.MultiTaskLasso.json | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 mlprimitives/jsons/sklearn.linear_model.MultiTaskLasso.json diff --git a/mlprimitives/jsons/sklearn.linear_model.MultiTaskLasso.json b/mlprimitives/jsons/sklearn.linear_model.MultiTaskLasso.json new file mode 100644 index 00000000..77f6718f --- /dev/null +++ b/mlprimitives/jsons/sklearn.linear_model.MultiTaskLasso.json @@ -0,0 +1,120 @@ +{ + "name": "sklearn.linear_model.MultiTaskLasso", + "contributors": [ + "Hector Dominguez " + ], + "documentation": "https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.MultiTaskLasso.html", + "description": "Multi-task Lasso model trained with L1/L2 mixed-norm as regularizer", + "classifiers": { + "type": "estimator", + "subtype": "regressor" + }, + "modalities": [], + "primitive": "sklearn.linear_model.MultiTaskLasso", + "fit": { + "method": "fit", + "args": [ + { + "name": "X", + "type": "ndarray" + }, + { + "name": "y", + "type": "array" + } + ] + }, + "produce": { + "method": "predict", + "args": [ + { + "name": "X", + "type": "ndarray" + } + ], + "output": [ + { + "name": "y", + "type": "array" + } + ] + }, + "hyperparameters": { + "fixed": { + "copy_X": { + "type": "bool", + "description": "If True, X will be copied; else, it may be overwritten", + "default": true + }, + "warm_start": { + "type": "bool", + "description": "When set to True, reuse the solution of the previous call to fit as initialization, otherwise, just erase the previous solution", + "default": false + }, + "random_state": { + "type": "multitype", + "description": "The seed of the pseudo random number generator that selects a random feature to update. ", + "types": { + "int": { + "description": "random_state is the seed used by the random number generator" + }, + "RandomState": { + "description": "random_state is the random number generator" + }, + "None": { + "description": "the random number generator is the RandomState instance used by np.random" + } + }, + "default": null + } + }, + "tunable": { + "alpha": { + "type": "float", + "description": "Constant that multiplies the L1/L2 term", + "default": 1.0, + "range": [ + 0.01, + 10.0 + ] + }, + "fit_intercept": { + "type": "bool", + "default": true, + "description": "whether to calculate the intercept for this model. If set to false, no intercept will be used in calculations (e.g. data is expected to be already centered)" + }, + "normalize": { + "type": "bool", + "default": false, + "description": "This parameter is ignored when fit_intercept is set to False. If True, the regressors X will be normalized before regression by subtracting the mean and dividing by the l2-norm" + }, + "max_iter": { + "type": "int", + "description": "The maximum number of iterations", + "default": 1000, + "range": [ + 1, + 10000 + ] + }, + "tol": { + "type": "float", + "description": "The tolerance for the optimization: if the updates are smaller than tol, the optimization code checks the dual gap for optimality and continues until it is smaller than tol", + "default": 0.0001, + "range": [ + 1e-06, + 0.01 + ] + }, + "selection": { + "type": "str", + "description": "If set to \u2018random\u2019, a random coefficient is updated every iteration rather than looping over features sequentially by default", + "values": [ + "cyclic", + "random" + ], + "default": "cyclic" + } + } + } +} From 4431a4b88405af0d74e6e342702f283a7fd64cbd Mon Sep 17 00:00:00 2001 From: Hector Dominguez Date: Thu, 21 Feb 2019 23:45:50 -0500 Subject: [PATCH 2/4] create pipeline using `sklearn.linear_model.MultiTaskLasso` --- pipelines/sklearn.linear_model.MultiTaskLasso.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 pipelines/sklearn.linear_model.MultiTaskLasso.json diff --git a/pipelines/sklearn.linear_model.MultiTaskLasso.json b/pipelines/sklearn.linear_model.MultiTaskLasso.json new file mode 100644 index 00000000..4af3e587 --- /dev/null +++ b/pipelines/sklearn.linear_model.MultiTaskLasso.json @@ -0,0 +1,13 @@ +{ + "metadata": { + "name": "sklearn.linear_model.MultiTaskLasso", + "data_type": "single_table", + "task_type": "regression" + }, + "validation": { + "dataset": "boston" + }, + "primitives": [ + "sklearn.linear_model.MultiTaskLasso" + ] +} From bd1ac0517fe9208f632cd9ed95e5615057a38441 Mon Sep 17 00:00:00 2001 From: Hector Dominguez Date: Fri, 22 Feb 2019 14:03:03 -0500 Subject: [PATCH 3/4] delete pipeline for `sklearn.linear_model.MultiTaskLasso` ... as there is not way to test it. --- pipelines/sklearn.linear_model.MultiTaskLasso.json | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 pipelines/sklearn.linear_model.MultiTaskLasso.json diff --git a/pipelines/sklearn.linear_model.MultiTaskLasso.json b/pipelines/sklearn.linear_model.MultiTaskLasso.json deleted file mode 100644 index 4af3e587..00000000 --- a/pipelines/sklearn.linear_model.MultiTaskLasso.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "metadata": { - "name": "sklearn.linear_model.MultiTaskLasso", - "data_type": "single_table", - "task_type": "regression" - }, - "validation": { - "dataset": "boston" - }, - "primitives": [ - "sklearn.linear_model.MultiTaskLasso" - ] -} From 8ec0a7c8c43ba2298a52721095c3a38ad67b9905 Mon Sep 17 00:00:00 2001 From: Hector Dominguez Date: Fri, 22 Feb 2019 14:09:07 -0500 Subject: [PATCH 4/4] remove `\u2018` --- mlprimitives/jsons/sklearn.linear_model.MultiTaskLasso.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlprimitives/jsons/sklearn.linear_model.MultiTaskLasso.json b/mlprimitives/jsons/sklearn.linear_model.MultiTaskLasso.json index 77f6718f..aaf2be5c 100644 --- a/mlprimitives/jsons/sklearn.linear_model.MultiTaskLasso.json +++ b/mlprimitives/jsons/sklearn.linear_model.MultiTaskLasso.json @@ -108,7 +108,7 @@ }, "selection": { "type": "str", - "description": "If set to \u2018random\u2019, a random coefficient is updated every iteration rather than looping over features sequentially by default", + "description": "If set to random, a random coefficient is updated every iteration rather than looping over features sequentially by default", "values": [ "cyclic", "random"