From 4179c5a803bd74236e6bde0bd59f562cac4bac1d Mon Sep 17 00:00:00 2001 From: Brian Pondi Date: Thu, 4 Jan 2024 23:19:36 +0100 Subject: [PATCH 1/2] MLP Classification --- CHANGELOG.md | 1 + proposals/dl_fit_class_mlp.json | 159 ++++++++++++++++++++++++++++++++ tests/.words | 9 ++ 3 files changed, 169 insertions(+) create mode 100644 proposals/dl_fit_class_mlp.json diff --git a/CHANGELOG.md b/CHANGELOG.md index f0b68043..d1d1647b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - New processes in proposal state: - `date_between` - `date_difference` + - `dl_fit_class_mlp` - `filter_vector` - `flatten_dimensions` - `load_geojson` diff --git a/proposals/dl_fit_class_mlp.json b/proposals/dl_fit_class_mlp.json new file mode 100644 index 00000000..766eb770 --- /dev/null +++ b/proposals/dl_fit_class_mlp.json @@ -0,0 +1,159 @@ +{ + "id": "dl_fit_class_mlp", + "summary": "Train a Multilayer Perceptron classification model", + "description": "Fit a Multilayer Perceptron (MLP) classification model to training data. MLP is a class of feedforward artificial neural network (ANN) that consists of at least three layers of nodes: an input layer, a hidden layer, and an output layer. MLP utilizes a supervised learning technique called backpropagation for training.\n\nThis implementation is inspired by Z. Wang, W. Yan, and T. Oates (2017), Time Series Classification from Scratch with Deep Neural Networks: A Strong Baseline.", + "categories": [ + "machine learning", + "deep learning" + ], + "experimental": true, + "parameters": [ + { + "name": "predictors", + "description": "The predictors for the MLP classification model as a vector data cube. These are the independent variables that the MLP algorithm analyses to learn patterns and relationships within the data.", + "schema": [ + { + "type": "object", + "subtype": "datacube", + "dimensions": [ + { + "type": "geometry" + }, + { + "type": "bands" + } + ] + }, + { + "type": "object", + "subtype": "datacube", + "dimensions": [ + { + "type": "geometry" + }, + { + "type": "other" + } + ] + } + ] + }, + { + "name": "target", + "description": "The dependent variable for MLP classification. These are the labeled data, aligning with predictor values based on a shared geometry dimension. This ensures a clear connection between predictor rows and labels.", + "schema": { + "type": "object", + "subtype": "datacube", + "dimensions": [ + { + "type": "geometry" + } + ] + } + }, + { + "name": "hidden_layers", + "description": "The number and size of hidden layers in the MLP.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "minimum": 1 + }, + "default": [ + 512, + 512, + 512 + ] + } + }, + { + "name": "dropout_rates", + "description": "Dropout rates for the hidden layers. Each value corresponds to the dropout rate for a specific layer.", + "schema": { + "type": "array", + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "default": [ + 0.4, + 0.3, + 0.2 + ] + } + }, + { + "name": "epochs", + "description": "The number of epochs for training the model.", + "schema": { + "type": "integer", + "minimum": 1, + "default": 100 + } + }, + { + "name": "batch_size", + "description": "Size of minibatches for stochastic optimizers.", + "schema": { + "type": "integer", + "minimum": 1, + "default": 64 + } + }, + { + "name": "activation_function", + "description": "Activation function for the hidden layers.", + "schema": { + "type": "string", + "enum": [ + "relu", + "tanh", + "sigmoid" + ], + "default": "relu" + } + }, + { + "name": "optimizer", + "description": "The gradient descent algorithm for weight optimization.", + "schema": { + "type": "string", + "enum": [ + "adam", + "sgd", + "lbfgs" + ], + "default": "adam" + } + }, + { + "name": "random_state", + "description": "Sets the seed of the algorithm's internal random number generator for initializing weights, biases, and data splitting in 'sgd' or 'adam' optimizers. Use an integer for consistent results across function calls.", + "optional": true, + "default": null, + "schema": { + "type": [ + "integer", + "null" + ] + } + } + ], + "returns": { + "description": "A model object that can be saved with ``save_ml_model()`` and restored with ``load_ml_model()``.", + "schema": { + "type": "object", + "subtype": "ml-model" + } + }, + "links": [ + { + "href": "https://arxiv.org/abs/1611.06455", + "title": "Z. Wang, W. Yan, and T. Oates (2017), Time Series Classification from Scratch with Deep Neural Networks: A Strong Baseline", + "type": "text/html", + "rel": "about" + } + ] +} \ No newline at end of file diff --git a/tests/.words b/tests/.words index a50285ba..ea5f4c4f 100644 --- a/tests/.words +++ b/tests/.words @@ -47,3 +47,12 @@ Hyndman date1 date2 favor +Wang +Yan +Oates +adam +sgd +minibatches +Perceptron +feedforward +backpropagation From 3bc995ac9166c86af101a81ff97fe50b0c1b56b5 Mon Sep 17 00:00:00 2001 From: Brian Pondi Date: Tue, 20 Feb 2024 15:50:53 +0100 Subject: [PATCH 2/2] rewording --- CHANGELOG.md | 2 +- proposals/{dl_fit_class_mlp.json => ml_fit_class_mlp.json} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename proposals/{dl_fit_class_mlp.json => ml_fit_class_mlp.json} (96%) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1d1647b..16d344e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,12 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - New processes in proposal state: - `date_between` - `date_difference` - - `dl_fit_class_mlp` - `filter_vector` - `flatten_dimensions` - `load_geojson` - `load_ml_model` - `load_url` + - `ml_fit_class_mlp` - `ml_fit_class_random_forest` - `ml_fit_regr_random_forest` - `ml_predict` diff --git a/proposals/dl_fit_class_mlp.json b/proposals/ml_fit_class_mlp.json similarity index 96% rename from proposals/dl_fit_class_mlp.json rename to proposals/ml_fit_class_mlp.json index 766eb770..7fbb6131 100644 --- a/proposals/dl_fit_class_mlp.json +++ b/proposals/ml_fit_class_mlp.json @@ -1,7 +1,7 @@ { - "id": "dl_fit_class_mlp", + "id": "ml_fit_class_mlp", "summary": "Train a Multilayer Perceptron classification model", - "description": "Fit a Multilayer Perceptron (MLP) classification model to training data. MLP is a class of feedforward artificial neural network (ANN) that consists of at least three layers of nodes: an input layer, a hidden layer, and an output layer. MLP utilizes a supervised learning technique called backpropagation for training.\n\nThis implementation is inspired by Z. Wang, W. Yan, and T. Oates (2017), Time Series Classification from Scratch with Deep Neural Networks: A Strong Baseline.", + "description": "Fit a Multilayer Perceptron (MLP) classification model to training data. MLP is a class of feedforward artificial neural network (ANN) that consists of at least three layers of nodes: an input layer, a hidden layer, and an output layer. MLP utilizes a supervised learning technique called backpropagation for training.", "categories": [ "machine learning", "deep learning"