X-Git-Url: https://git.auder.net/?p=talweg.git;a=blobdiff_plain;f=reports%2Freport_2017-03-01.7h_average.ipynb;h=61317d0f216ed5669edfaeff089c157eb577e8ad;hp=cedb40eb968cfae88d4b6c57433c07d3ea760cae;hb=98e958cab563866f8e00886b54336018a2e8bc97;hpb=25b75559e2d9bf84e2de35b851d93fefdae36e17 diff --git a/reports/report_2017-03-01.7h_average.ipynb b/reports/report_2017-03-01.7h_average.ipynb index cedb40e..61317d0 100644 --- a/reports/report_2017-03-01.7h_average.ipynb +++ b/reports/report_2017-03-01.7h_average.ipynb @@ -2,43 +2,22 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Loading required package: R6\n" - ] - } - ], + "outputs": [], "source": [ "library(talweg)" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "ename": "ERROR", - "evalue": "Error in private$.data <<- list(): object 'private' not found\n", - "output_type": "error", - "traceback": [ - "Error in private$.data <<- list(): object 'private' not found\nTraceback:\n", - "1. getData(ts_data, exo_data, input_tz = \"Europe/Paris\", working_tz = \"Europe/Paris\", \n . predict_at = 7)", - "2. Data$new()", - "3. .subset2(public_bind_env, \"initialize\")(...)", - "4. initializeData(self, private)" - ] - } - ], + "outputs": [], "source": [ "ts_data = read.csv(system.file(\"extdata\",\"pm10_mesures_H_loc.csv\",package=\"talweg\"))\n", "exo_data = read.csv(system.file(\"extdata\",\"meteo_extra_noNAs.csv\",package=\"talweg\"))\n", @@ -75,7 +54,7 @@ "outputs": [], "source": [ "indices_ch = seq(as.Date(\"2015-01-18\"),as.Date(\"2015-01-24\"),\"days\")\n", - "p_ch_nn = computeForecast(data,indices_ch, \"Neighbors\", \"Neighbors\", simtype=\"mix\")\n", + "p_ch_nn = computeForecast(data, indices_ch, \"Neighbors\", \"Neighbors\", simtype=\"mix\")\n", "p_ch_pz = computeForecast(data, indices_ch, \"Persistence\", \"Zero\", same_day=TRUE)\n", "p_ch_az = computeForecast(data, indices_ch, \"Average\", \"Zero\") #, memory=183)\n", "#p_ch_zz = computeForecast(data, indices_ch, \"Zero\", \"Zero\")" @@ -115,13 +94,6 @@ "#Bleu: prévue, noir: réalisée" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Prédictions d'autant plus lisses que le jour à prévoir est atypique (pollué)." - ] - }, { "cell_type": "code", "execution_count": null, @@ -156,22 +128,11 @@ }, "outputs": [], "source": [ - "par(mfrow=c(2,2))\n", - "options(repr.plot.width=9, repr.plot.height=7)\n", - "plotFilamentsBox(data, f3_ch$indices)\n", - "plotFilamentsBox(data, f3_ch$indices+1)\n", - "plotFilamentsBox(data, f4_ch$indices)\n", - "plotFilamentsBox(data, f4_ch$indices+1)\n", + "par(mfrow=c(1,2))\n", + "plotFilamentsBox(data, f3_ch)\n", + "plotFilamentsBox(data, f4_ch)\n", "\n", - "#En haut : jour 3 + lendemain (4) ; en bas : jour 4 + lendemain (5)\n", - "#À gauche : premières 24h ; à droite : 24h suivantes" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Dans les deux cas, un voisinage \"raisonnable\" est trouvé ; mais grande variabilité le lendemain \"pollué\"." + "#À gauche : jour 3 + lendemain (4) ; à droite : jour 4 + lendemain (5)" ] }, { @@ -183,18 +144,10 @@ "outputs": [], "source": [ "par(mfrow=c(1,2))\n", - "options(repr.plot.width=9, repr.plot.height=4)\n", - "plotRelativeVariability(data, f3_ch$indices)\n", - "plotRelativeVariability(data, f4_ch$indices)\n", + "plotRelVar(data, f3_ch)\n", + "plotRelVar(data, f4_ch)\n", "\n", - "#Variabilité sur 60 courbes au hasard en rouge ; sur nos 60 voisins (+ lendemains) en noir" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Il faudrait que la courbe noire soit nettement plus basse que la courbe rouge." + "#Variabilité globale en rouge ; sur nos 60 voisins (+ lendemains) en noir" ] }, { @@ -205,32 +158,11 @@ }, "outputs": [], "source": [ - "par(mfrow=c(1,3))\n", + "par(mfrow=c(1,2))\n", "plotSimils(p_ch_nn, 3)\n", "plotSimils(p_ch_nn, 4)\n", - "plotSimils(p_ch_nn, 5)\n", "\n", - "#Non pollué à gauche, pollué au milieu, autre pollué à droite" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "La plupart des poids très proches de zéro ; pas pour le jour 5 : autre type de jour, cf. ci-dessous." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "par(mfrow=c(1,2))\n", - "plotPredReal(data, p_ch_nn, 5)\n", - "ignored <- computeFilaments(data, p_ch_nn$getIndexInData(5), plot=TRUE)" + "#Non pollué à gauche, pollué à droite" ] }, { @@ -302,13 +234,6 @@ "#Bleu: prévue, noir: réalisée" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "À gauche un jour \"bien\" prévu, à droite le pic d'erreur (jour 6)." - ] - }, { "cell_type": "code", "execution_count": null, @@ -344,21 +269,10 @@ "outputs": [], "source": [ "par(mfrow=c(2,2))\n", - "options(repr.plot.width=9, repr.plot.height=7)\n", - "plotFilamentsBox(data, f4_ep$indices)\n", - "plotFilamentsBox(data, f4_ep$indices+1)\n", - "plotFilamentsBox(data, f6_ep$indices)\n", - "plotFilamentsBox(data, f6_ep$indices+1)\n", + "plotFilamentsBox(data, f4_ep)\n", + "plotFilamentsBox(data, f6_ep)\n", "\n", - "#En haut : jour 4 + lendemain (5) ; en bas : jour 6 + lendemain (7)\n", - "#À gauche : premières 24h ; à droite : 24h suivantes" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\"Voisinages\" catastrophiques : les jours 4 et 6 sont trop atypiques." + "#À gauche : jour 4 + lendemain (5) ; à droite : jour 6 + lendemain (7)" ] }, { @@ -370,18 +284,10 @@ "outputs": [], "source": [ "par(mfrow=c(1,2))\n", - "options(repr.plot.width=9, repr.plot.height=4)\n", - "plotRelativeVariability(data, f4_ep$indices)\n", - "plotRelativeVariability(data, f6_ep$indices)\n", + "plotRelativeVariability(data, f4_ep)\n", + "plotRelativeVariability(data, f6_ep)\n", "\n", - "#Variabilité sur 60 courbes au hasard en rouge ; sur nos 60 voisins (+ lendemains) en noir" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Il faudrait que la courbe noire soit nettement plus basse que la courbe rouge." + "#Variabilité globale en rouge ; sur nos 60 voisins (+ lendemains) en noir" ] }, { @@ -397,13 +303,6 @@ "plotSimils(p_ep_nn, 6)" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Poids très concentrés près de zéro pour les prédictions avec peu de voisins." - ] - }, { "cell_type": "code", "execution_count": null, @@ -457,13 +356,6 @@ "#Noir: neighbors, rouge: persistence, vert: moyenne" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Performances des méthodes \"Average\" et \"Neighbors\" comparables ; mauvais résultats pour la persistence." - ] - }, { "cell_type": "code", "execution_count": null, @@ -515,21 +407,10 @@ "outputs": [], "source": [ "par(mfrow=c(2,2))\n", - "options(repr.plot.width=9, repr.plot.height=7)\n", - "plotFilamentsBox(data, f5_np$indices)\n", - "plotFilamentsBox(data, f5_np$indices+1)\n", - "plotFilamentsBox(data, f6_np$indices)\n", - "plotFilamentsBox(data, f6_np$indices+1)\n", + "plotFilamentsBox(data, f5_np)\n", + "plotFilamentsBox(data, f6_np)\n", "\n", - "#En haut : jour 3 + lendemain (4) ; en bas : jour 6 + lendemain (7)\n", - "#À gauche : premières 24h ; à droite : 24h suivantes" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Jours \"typiques\", donc beaucoup de voisins. En revanche les lendemains des jours similaires sont très variables." + "#À gauche : jour 5 + lendemain (6) ; à droite : jour 6 + lendemain (7)" ] }, { @@ -541,18 +422,10 @@ "outputs": [], "source": [ "par(mfrow=c(1,2))\n", - "options(repr.plot.width=9, repr.plot.height=4)\n", - "plotRelativeVariability(data, f5_np$indices)\n", - "plotRelativeVariability(data, f6_np$indices)\n", + "plotRelVar(data, f5_np)\n", + "plotRelVar(data, f6_np)\n", "\n", - "#Variabilité sur 60 courbes au hasard en rouge ; sur nos 60 voisins (+ lendemains) en noir" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Bonne situation : la courbe noire est toujours assez nettement en dessous." + "#Variabilité globale en rouge ; sur nos 60 voisins (+ lendemains) en noir" ] }, { @@ -568,13 +441,6 @@ "plotSimils(p_np_nn, 6)" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Répartition idéale des poids : quelques uns au-delà de 0.3-0.4, le reste très proche de zéro." - ] - }, { "cell_type": "code", "execution_count": null, @@ -612,7 +478,7 @@ "mimetype": "text/x-r-source", "name": "R", "pygments_lexer": "r", - "version": "3.2.3" + "version": "3.3.2" } }, "nbformat": 4,