{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Analysis of behavioral changes\n", "\n", "We categorize the behaviors into three types : \n", " - In the first category (*hand*: red curve) are mouvements of the arm that did not grab any stick and thus not moved the out-of-reached object.\n", " - The second category (*stick*: green curve) are mouvements that did grab one of the two sticks but did not touch the object with it.\n", " - The third category (*object*: blue curve) contains the mouvements where both a stick was grabbed and the object was moved by the stick.\n", " \n", "\n", "We define *Overlapping Waves* as patterns of behaviors that follow all of the three following criterions.\n", "\n", "###Criterions:\n", " - *stick* increases quikly from 0 to more than 10 (potentially after an initial phase with a steady low value), and is followed by a plateau (steady curve with small slope) and no abrupt changes. \n", " - *object* increases quikly from 0 to more than 10 (potentially after an initial phase with a steady low value), and is followed by a plateau (steady curve with small slope) and no abrupt changes. \n", " - *object* starts to raise at least 1000 iterations after *stick* started to raise." ] }, { "cell_type": "code", "execution_count": 55, "metadata": { "collapsed": false }, "outputs": [], "source": [ "img_path = \"../data/2016-01-26_14-37-37-Tools-cogsci-xp1/img/\"" ] }, { "cell_type": "code", "execution_count": 56, "metadata": { "collapsed": true }, "outputs": [], "source": [ "analysis_results = {}" ] }, { "cell_type": "code", "execution_count": 76, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from IPython.display import Image, HTML, display\n", "from glob import glob\n", "\n", "def analysis(config):\n", " im_list = []\n", " imagesList=''.join( [\"\" % str(s) \n", " for s in [img_path + '{}-log{}-events-100000.png'.format(config, trial) for trial in range(1, 101)]])\n", " #print imagesList\n", " display(HTML(imagesList))" ] }, { "cell_type": "code", "execution_count": 77, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "analysis(config)" ] }, { "cell_type": "code", "execution_count": 78, "metadata": { "collapsed": false }, "outputs": [], "source": [ "analysis_results[\"F-RmB\"] = 0" ] }, { "cell_type": "code", "execution_count": 79, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "analysis(\"F-RGB\")" ] }, { "cell_type": "code", "execution_count": 85, "metadata": { "collapsed": true }, "outputs": [], "source": [ "analysis_results[\"F-RGB\"] = 0" ] }, { "cell_type": "code", "execution_count": 80, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "analysis(\"H-RGB-RMB\")" ] }, { "cell_type": "code", "execution_count": 86, "metadata": { "collapsed": true }, "outputs": [], "source": [ "trials_criterion_ok = [\n", " 1,0,1,1,1,0,1,1,1,0,\n", " 0,0,1,1,0,1,0,1,0,0,\n", " 0,1,0,0,1,0,0,0,1,0,\n", " 1,1,0,0,1,1,1,0,1,1,\n", " 0,0,0,0,1,0,1,1,0,1,\n", " 1,1,1,1,0,1,0,1,1,1,\n", " 1,0,1,1,1,0,1,0,0,1,\n", " 1,0,1,1,0,1,1,0,0,1,\n", " 0,1,1,1,1,0,0,1,0,1,\n", " 1,1,1,1,1,1,1,1,0,1,\n", "]\n", "\n", "analysis_results[\"H-RGB-RMB\"] = sum(trials_criterion_ok)" ] }, { "cell_type": "code", "execution_count": 81, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "analysis(\"H-RGB-P-AMB\")" ] }, { "cell_type": "code", "execution_count": 87, "metadata": { "collapsed": true }, "outputs": [], "source": [ "trials_criterion_ok = [\n", " 1,0,1,1,0,0,1,0,1,1,\n", " 1,1,1,0,1,1,1,0,1,0,\n", " 1,1,1,1,1,1,1,1,0,0,\n", " 0,1,0,0,0,0,1,1,1,0,\n", " 1,1,0,1,1,0,1,1,0,1,\n", " 0,1,1,1,1,1,1,1,1,1,\n", " 1,0,1,1,1,1,0,0,0,1,\n", " 1,0,1,1,0,1,1,1,1,1,\n", " 1,0,1,1,1,1,0,1,0,1,\n", " 1,1,1,0,0,1,1,1,1,1,\n", "]\n", "\n", "analysis_results[\"H-RGB-P-AMB\"] = sum(trials_criterion_ok)" ] }, { "cell_type": "code", "execution_count": 82, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "analysis(\"H-RGB-GR-AMB\")" ] }, { "cell_type": "code", "execution_count": 88, "metadata": { "collapsed": true }, "outputs": [], "source": [ "trials_criterion_ok = [\n", " 0,1,0,0,0,0,0,0,0,0,\n", " 0,0,0,0,0,0,0,0,0,0,\n", " 0,0,0,0,0,0,0,0,0,0,\n", " 0,0,0,0,0,0,0,0,0,0,\n", " 0,0,0,0,0,1,0,0,0,0,\n", " 0,0,1,0,0,0,0,0,0,0,\n", " 0,0,0,0,1,0,0,0,0,0,\n", " 1,0,0,0,0,0,0,0,0,0,\n", " 0,1,0,0,0,0,0,0,0,0,\n", " 0,0,0,0,0,0,1,0,0,0,\n", "]\n", "\n", "analysis_results[\"H-RGB-GR-AMB\"] = sum(trials_criterion_ok)" ] }, { "cell_type": "code", "execution_count": 83, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "analysis(\"H-RGB-P-AMB-PGITC\")" ] }, { "cell_type": "code", "execution_count": 89, "metadata": { "collapsed": true }, "outputs": [], "source": [ "trials_criterion_ok = [\n", " 1,1,1,1,1,0,0,0,0,1,\n", " 1,1,1,1,1,1,1,0,1,1,\n", " 1,1,1,1,1,1,0,0,1,0,\n", " 1,1,1,1,1,1,0,0,1,0,\n", " 1,0,1,1,1,1,1,0,1,0,\n", " 1,1,0,1,1,0,1,1,1,1,\n", " 1,1,1,1,1,1,1,0,1,1,\n", " 1,1,1,1,0,1,1,1,1,1,\n", " 1,1,1,1,1,1,1,0,0,1,\n", " 1,1,1,1,1,1,0,1,1,1,\n", "]\n", "\n", "analysis_results[\"H-RGB-P-AMB-PGITC\"] = sum(trials_criterion_ok)" ] }, { "cell_type": "code", "execution_count": 90, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{'F-RmB': 0, 'H-RGB-P-AMB-PGITC': 79, 'H-RGB-GR-AMB': 7, 'H-RGB-RMB': 60, 'F-RGB': 0, 'H-RGB-P-AMB': 70}\n" ] } ], "source": [ "print analysis_results" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 0 }