<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/analyzing-accelerometer-data-with-r/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://blog.revolutionanalytics.com/2018/02/accelerometers.html"> Revolutions</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div>
<p>Using your smartphone (any modern phone with a built-in accelerometer should work), visit the <a rel="nofollow" href="https://jhubiostatistics.shinyapps.io/cast_spells/" target="_blank">Cast Your Spell</a> page created by <a rel="nofollow" href="http://nickstrayer.me/" target="_blank">Nick Strayer</a>. (If you need to type it to your phone browser directly, here's a shortlink: <code>bit.ly/castspell</code> .) Scroll down and click the &quot;Press To Cast!&quot; button, and then wave your phone like a wand using one of the shapes shown.</p>
<p><a rel="nofollow" href="http://a4.typepad.com/6a0105360ba1c6970c01b7c95246b4970b-pi" target="_blank"><img alt="Castspell" title="Castspell" src="http://a4.typepad.com/6a0105360ba1c6970c01b7c95246b4970b-450wi"></a></p>
<p>The app will attempt to detect which of the four &quot;spells&quot; you gestured. It was pretty confident in its detection when I cast &quot;Incendio&quot;, but your mileage may vary depending on your wizarding ability and the underlying categorization model. </p>
<p><a rel="nofollow" href="http://a3.typepad.com/6a0105360ba1c6970c01bb09f5a383970d-pi" target="_blank"><img alt="Cast Spell Prediction" title="Cast Spell Prediction" src="http://a3.typepad.com/6a0105360ba1c6970c01bb09f5a383970d-450wi"></a></p>
<p>Nick Strayer described how he built this application in a <a rel="nofollow" href="http://nickstrayer.me/dataDayTexas/#1" target="_blank">presentation at Data Day Texas</a> last month. The app itself was built using <a rel="nofollow" href="http://shiny.rstudio.com/" target="_blank">Shiny</a> with the <a rel="nofollow" href="https://github.com/nstrayer/shinysense" target="_blank">shinysense package</a> (on Github) to collect movement data from the phone. Nick trained a convolutional neural network model (from his own casting gesture data) using the <a rel="nofollow" href="https://keras.rstudio.com/" target="_blank">keras package</a> to classify gestures into one of the four &quot;spells&quot;. (Interesting side note: because CNNs aren't time-dependent, you can gesture in reverse and still pass the classification test.)</p>
<p><a rel="nofollow" href="http://digitalspyuk.cdnds.net/16/46/480x198/gallery-1479227655-tumblr-inline-n9laetes451qh7ojh.gif" target="_blank"><img border="0" src="http://a1.typepad.com/6a0105360ba1c6970c01b7c951e891970b-800wi" alt="image from digitalspyuk.cdnds.net" title="image from digitalspyuk.cdnds.net"></a></p>
<p>It's almost like magic! For the complete details on how the Cast your Spell app was constructed, see Nick Strayer's presentation at the link below.</p>
<p>Data Day Texas 2018: <a rel="nofollow" href="http://nickstrayer.me/dataDayTexas/#1" target="_blank">Making Magic with Keras and Shiny (Nick Strayer)</a></p>
</div>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://blog.revolutionanalytics.com/2018/02/accelerometers.html"> Revolutions</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/B7Cs_XvOepM" height="1"></a></div>