<commit_before><commit_msg>tinkering with new ideas for handling multiple appliances per meter<commit_after>{
 "metadata": {
  "name": "",
  "signature": "sha256:e0f2ef9949199c182a270ad5d51f1517b9c8ccde400e526041533c019c279ed0"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Problems with the current design:\n",
      "\n",
      "* if, when training disag algos, we iterate through appliances then we'll end up training on the same meters labelled as different appliances\n",
      "* when we ask for a power series for an appliance, I think it's not sufficient to give a warning that that meter measures multiple appliances; instead we should return something like a PowerStrip object."
     ]
    },
    {
     "cell_type": "raw",
     "metadata": {},
     "source": [
      ">>> electric['toaster']\n",
      "PowerStrip(dominant=Appliance(type='toaster', instance=1), \n",
      "           others=[Appliance(type='sandwich maker', instance=1)])\n",
      "\n",
      ">>> electric['fridge']\n",
      "Appliance(type='fridge', instance=1)\n",
      "or\n",
      "PowerStrip(dominant=Appliance(type='fridge', instance=1))\n",
      "the latter feels better because then we can simplify life by iterating through all powerstrips and, on each iteration, only getting powerstrip.dominant.\n",
      "\n",
      "The PowerStrip class would contain Appliances.\n",
      "\n",
      "But what if there is no dominant appliance (UK-DALE will be the only dataset with this information).\n",
      ">>> electric['fridge']\n",
      "PowerStrip(dominant=None, others=[Appliance('fridge')])\n",
      "\n",
      "How do we handle functions like on_duration?  Different appliances on the powerstrip could have different on_power_thresholds, and so could be distinguishable, but this will rarely be the case.  So maybe functions like on_duration should just take the minimum on_power_threshold from all appliances and return a single on_duration for the entire powerstrip?\n",
      "\n",
      "How do give a PowerStrip an ID?  I suppose each appliance no longer needs a dataset and a building?  e.g.:\n",
      "\n",
      "PowerStrip(dataset=REDD, building=1, appliances=[(fridge,1), (kettle,1)], dominant=(fridge,1))\n",
      "\n",
      "OR... get rid of PowerStrip idea.  Instead have get_leaf_meters.  And we handle dual-supply at the meter level (i.e. a single meter object with two dataframes, one for each physical meter... which slightly breaks things).\n",
      "\n",
      "Meter(dataset=REDD, building=1, appliances=[(fridge,1), (kettle,1)], dominant=(fridge,1))\n",
      "\n",
      "That is more simple but perhaps feels a little conceptually \"dirty\".  Or maybe not.\n",
      "\n",
      "then, do we ask the meter for its on_duration, activity_distribution, proportion_of_energy etc?  I guess that's OK.  It means the Appliance class becomes quite simple (it's basically just a wrapper around a dict of metadata)."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}
{'fraction_non_alphanumeric': 0.13183081197900587, 'fraction_numerical': 0.018524235875270145, 'mean_word_length': 3.2744063324538257, 'pattern_counts': {'":': 20, '<': 3, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1681809', 'n_tokens_mistral': 1021, 'n_tokens_neox': 960, 'n_words': 334}