{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Neural Networks for classification\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from ai4water.hyperopt import Categorical\nfrom ai4water.datasets import MtropicsLaos\nfrom ai4water.experiments import DLClassificationExperiments"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "dataset = MtropicsLaos()\n\n#lookback = 5\n#data =    dataset.make_classification(lookback_steps=lookback)\n\n#print(data.shape)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "inputs = data.columns.tolist()[0:-1]\noutputs = data.columns.tolist()[-1:]\n\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "exp = DLClassificationExperiments(\n    input_features=inputs,\n    output_features=outputs,\n    epochs=50,\n    ts_args={\"lookback\": lookback},\n    save=False\n)\n\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "exp.batch_size_space = Categorical(categories=[4, 8, 12, 16, 32],\n                                   name=\"batch_size\")\n\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "exp.fit(data=data,\n        include=[\"MLP\", \"CNN\", \"LSTM\", \"TFT\"])\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "#exp.compare_errors('accuracy', data=data)"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.7.9"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}