'update'
authorBenjamin Auder <benjamin.auder@somewhere>
Wed, 29 Mar 2017 09:48:53 +0000 (11:48 +0200)
committerBenjamin Auder <benjamin.auder@somewhere>
Wed, 29 Mar 2017 09:48:53 +0000 (11:48 +0200)
reports/report.ipynb
reports/run.sh [new file with mode: 0644]
reports/run_notebook.sh [deleted file]

index c4656a9..70d86d2 100644 (file)
@@ -2,10 +2,7 @@
  "cells": [
   {
    "cell_type": "markdown",
-   "metadata": {
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "source": [
     "\n",
     "\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "library(talweg)\n",
   },
   {
    "cell_type": "markdown",
-   "metadata": {
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "source": [
     "\n",
     "\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
-    "reload(\"../pkg\")\n",
     "p_nn = computeForecast(data, indices_ch, \"Neighbors\", \"Neighbors\", horizon=H)\n",
-    "p_nn2 = computeForecast(data, indices_ch, \"Neighbors2\", \"Neighbors\", horizon=H)\n",
+    "p_nn2 = computeForecast(data, indices_ch, \"Neighbors2\", \"Zero\", horizon=H)\n",
     "p_az = computeForecast(data, indices_ch, \"Average\", \"Zero\", horizon=H)\n",
     "p_pz = computeForecast(data, indices_ch, \"Persistence\", \"Zero\", horizon=H, same_day=TRUE)"
    ]
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
-   "outputs": [],
-   "source": [
-    "p_nn2$getParams(5)$weights"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "e_nn = computeError(data, p_nn, H)\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "options(repr.plot.width=9, repr.plot.height=4)\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "par(mfrow=c(1,2))\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "par(mfrow=c(1,2))\n",
-    "#plotFilamentsBox(data, f_np); title(paste(\"FilBox nn day\",i_np))\n",
-    "#plotFilamentsBox(data, f_p); title(paste(\"FilBox nn day\",i_p))\n",
+    "plotFilamentsBox(data, f_np); title(paste(\"FilBox nn day\",i_np))\n",
+    "plotFilamentsBox(data, f_p); title(paste(\"FilBox nn day\",i_p))\n",
     "\n",
-    "plotFilamentsBox(data, f_np2); title(paste(\"FilBox nn2 day\",i_np))\n",
+    "# Generally too few neighbors:\n",
+    "#plotFilamentsBox(data, f_np2); title(paste(\"FilBox nn2 day\",i_np))\n",
     "#plotFilamentsBox(data, f_p2); title(paste(\"FilBox nn2 day\",i_p))"
    ]
   },
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "f_np2"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "par(mfrow=c(1,2))\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "par(mfrow=c(1,2))\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "# Fenêtres sélectionnées dans ]0,7] / nn à gauche, nn2 à droite\n",
   },
   {
    "cell_type": "markdown",
-   "metadata": {
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "source": [
     "\n",
     "\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "p_nn = computeForecast(data, indices_ep, \"Neighbors\", \"Neighbors\", horizon=H)\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "e_nn = computeError(data, p_nn, H)\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "options(repr.plot.width=9, repr.plot.height=4)\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "par(mfrow=c(1,2))\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "par(mfrow=c(1,2))\n",
     "plotFilamentsBox(data, f_np); title(paste(\"FilBox nn day\",i_np))\n",
     "plotFilamentsBox(data, f_p); title(paste(\"FilBox nn day\",i_p))\n",
     "\n",
-    "plotFilamentsBox(data, f_np2); title(paste(\"FilBox nn2 day\",i_np))\n",
-    "plotFilamentsBox(data, f_p2); title(paste(\"FilBox nn2 day\",i_p))"
+    "# Generally too few neighbors:\n",
+    "#plotFilamentsBox(data, f_np2); title(paste(\"FilBox nn2 day\",i_np))\n",
+    "#plotFilamentsBox(data, f_p2); title(paste(\"FilBox nn2 day\",i_p))"
    ]
   },
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "par(mfrow=c(1,2))\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "par(mfrow=c(1,2))\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "# Fenêtres sélectionnées dans ]0,7] / nn à gauche, nn2 à droite\n",
   },
   {
    "cell_type": "markdown",
-   "metadata": {
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "source": [
     "\n",
     "\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "p_nn = computeForecast(data, indices_np, \"Neighbors\", \"Neighbors\", horizon=H)\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "e_nn = computeError(data, p_nn, H)\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "options(repr.plot.width=9, repr.plot.height=4)\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "par(mfrow=c(1,2))\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "par(mfrow=c(1,2))\n",
     "plotFilamentsBox(data, f_np); title(paste(\"FilBox nn day\",i_np))\n",
     "plotFilamentsBox(data, f_p); title(paste(\"FilBox nn day\",i_p))\n",
     "\n",
-    "plotFilamentsBox(data, f_np2); title(paste(\"FilBox nn2 day\",i_np))\n",
-    "plotFilamentsBox(data, f_p2); title(paste(\"FilBox nn2 day\",i_p))"
+    "# Generally too few neighbors:\n",
+    "#plotFilamentsBox(data, f_np2); title(paste(\"FilBox nn2 day\",i_np))\n",
+    "#plotFilamentsBox(data, f_p2); title(paste(\"FilBox nn2 day\",i_p))"
    ]
   },
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "par(mfrow=c(1,2))\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "par(mfrow=c(1,2))\n",
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": false,
-    "deletable": true,
-    "editable": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "# Fenêtres sélectionnées dans ]0,7] / nn à gauche, nn2 à droite\n",
    ]
   }
  ],
- "metadata": {
-  "kernelspec": {
-   "display_name": "R",
-   "language": "R",
-   "name": "ir"
-  },
-  "language_info": {
-   "codemirror_mode": "r",
-   "file_extension": ".r",
-   "mimetype": "text/x-r-source",
-   "name": "R",
-   "pygments_lexer": "r",
-   "version": "3.3.3"
-  }
- },
+ "metadata": {},
  "nbformat": 4,
  "nbformat_minor": 2
 }
diff --git a/reports/run.sh b/reports/run.sh
new file mode 100644 (file)
index 0000000..d108199
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+# Usage: ./run.sh P H
+
+nbfile=report_P$1_H$2.ipynb
+./ipynb_generator.py report.gj $nbfile P=$1 H=$2
+
+htmlfile=report_P$1_H$2.html
+jupyter-nbconvert \
+       --ExecutePreprocessor.kernel_name='ir' \
+       --ExecutePreprocessor.timeout=1800 \
+       --to html --execute $nbfile \
+       --output=$htmlfile
diff --git a/reports/run_notebook.sh b/reports/run_notebook.sh
deleted file mode 100644 (file)
index a6b31ce..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-jupyter-nbconvert --ExecutePreprocessor.timeout=1800 --to notebook --execute report_2017-03-01.ipynb