Behavior Analysis with Machine Learning and R
$10.00
Minimum price
$18.00
Suggested price

Behavior Analysis with Machine Learning and R

A Sensors and Data Driven Approach

About the Book

This book aims to provide an introduction to machine learning and deep learning concepts and algorithms applied to a diverse set of behavior analysis problems.

The book covers topics and practical aspects within the entire data analysis pipeline—from data collection, visualization, preprocessing, and encoding to model training and evaluation. No prior knowledge in machine learning is assumed. The book covers How To:

  • Build supervised machine learning models to predict indoor locations based on Wi-Fi signals, recognize physical activities from smartphone sensors and 3D skeleton data, detect hand gestures from accelerometer signals, and much more.
  • Apply some of the most common techniques to explore, visualize, encode, and preprocess behavioral data.
  • Use unsupervised learning algorithms to discover criminal behavioral patterns.
  • Program your own ensemble learning methods and use multi-view stacking to fuse signals from heterogeneous data sources.
  • Encode your data using different representations, such as feature vectors, time series, images, bags of words, graphs, and so on.
  • Train deep learning models with Keras and TensorFlow, including neural networks to classify muscle activity from electromyography signals and convolutional neural networks to detect smiles in images.
  • Evaluate the performance of your models in traditional and multi-user settings.
  • Train anomaly detection models such as Isolation Forests and autoencoders to detect abnormal fish trajectories.
  • And much more!

A html version is available at: https://enriquegit.github.io/behavior-free/

  • Share this book

About the Author

Enrique Garcia-Ceja
Enrique Garcia Ceja

Enrique is a research scientist at SINTEF, Norway. Previously, he worked as a postdoc at the University of Oslo. He also worked as a software engineer at Huawei. For the last 10 years, he has been conducting research on behavior analysis with machine learning.

About the Contributors

Vance Capley
Vance Capley

Vance Capley is responsible for the front cover and summary-comics illustrations. You can visit his website here.

Table of Contents

  • Welcome
  • Preface
    • Supplemental Material
    • Conventions
    • Acknowledgments
  • 1. Introduction
    • 1.1 What is Machine Learning?
    • 1.2 Types of Machine Learning
    • 1.3 Terminology
      • 1.3.1 Tables
      • 1.3.2 Variable Types
      • 1.3.3 Predictive Models
    • 1.4 Data Analysis Pipeline
    • 1.5 Evaluating Predictive Models
    • 1.6 Simple Classification Example
      • 1.6.1 K-fold Cross-Validation Example
    • 1.7 Simple Regression Example
    • 1.8 Underfitting and Overfitting
    • 1.9 Bias and Variance
  • 2. Predicting Behavior with Classification Models
    • 2.1 k-nearest Neighbors
      • 2.1.1 Indoor Location with Wi-Fi Signals
    • 2.2 Performance Metrics
      • 2.2.1 Confusion Matrix
    • 2.3 Decision Trees
      • 2.3.1 Activity Recognition with Smartphones
    • 2.4 Naive Bayes
      • 2.4.1 Activity Recognition with Naive Bayes
    • 2.5 Dynamic Time Warping
      • 2.5.1 Hand Gesture Recognition
    • 2.6 Dummy Models
      • 2.6.1 Most-frequent-class Classifier
      • 2.6.2 Uniform Classifier
      • 2.6.3 Frequecy-based Classifier
      • 2.6.4 Other Dummy Classifiers
  • 3. Predicting Behavior with Ensemble Learning
    • 3.1 Bagging
      • 3.1.1 Activity recognition with Bagging
    • 3.2 Random Forest
    • 3.3 Stacked Generalization
    • 3.4 Multi-view Stacking for Home Tasks Recognition
  • 4. Exploring and Visualizing Behavioral Data
    • 4.1 Talking with Field Experts
    • 4.2 Summary Statistics
    • 4.3 Class Distributions
    • 4.4 User-Class Sparsity Matrix
    • 4.5 Boxplots
    • 4.6 Correlation Plots
      • 4.6.1 Interactive Correlation Plots
    • 4.7 Timeseries
      • 4.7.1 Interactive Timeseries
    • 4.8 Multidimensional Scaling (MDS)
    • 4.9 Heatmaps
    • 4.10 Automated EDA
  • 5. Preprocessing Behavioral Data
    • 5.1 Missing Values
      • 5.1.1 Imputation
    • 5.2 Smoothing
    • 5.3 Normalization
    • 5.4 Imbalanced Classes
      • 5.4.1 Random Oversampling
      • 5.4.2 SMOTE
    • 5.5 Information Injection
    • 5.6 One-hot Encoding
  • 6. Discovering Behaviors with Unsupervised Learning
    • 6.1 K-means Clustering
      • 6.1.1 Grouping Student Responses
    • 6.2 The Silhouette Index
    • 6.3 Mining Association Rules
      • 6.3.1 Finding Rules for Criminal Behavior
  • 7. Encoding Behavioral Data
    • 7.1 Feature Vectors
    • 7.2 Timeseries
    • 7.3 Transactions
    • 7.4 Images
    • 7.5 Recurrence Plots
      • 7.5.1 Computing Recurence Plots
      • 7.5.2 Recurrence Plots of Hand Gestures
    • 7.6 Bag-of-Words
      • 7.6.1 BoW for Complex Activities
    • 7.7 Graphs
      • 7.7.1 Complex Activities as Graphs
  • 8. Predicting Behavior with Deep Learning
    • 8.1 Introduction to Artificial Neural Networks
      • 8.1.1 Sigmoid and ReLU Units
      • 8.1.2 Assembling Units into Layers
      • 8.1.3 Deep Neural Networks
      • 8.1.4 Learning the Parameters
      • 8.1.5 Parameter Learning Example in R
      • 8.1.6 Stochastic Gradient Descent
    • 8.2 Keras and TensorFlow with R
      • 8.2.1 Keras Example
    • 8.3 Classification with Neural Networks
      • 8.3.1 Classification of Electromyography Signals
    • 8.4 Overfitting
      • 8.4.1 Early Stopping
      • 8.4.2 Dropout
    • 8.5 Fine-Tuning a Neural Network
    • 8.6 Convolutional Neural Networks
      • 8.6.1 Convolutions
      • 8.6.2 Pooling Operations
    • 8.7 CNNs with Keras
      • 8.7.1 Example 1
      • 8.7.2 Example 2
    • 8.8 Smiles Detection with a CNN
  • 9. Multi-User Validation
    • 9.1 Mixed Models
      • 9.1.1 Skeleton Action Recognition with Mixed Models
    • 9.2 User-Independent Models
    • 9.3 User-Dependent Models
    • 9.4 User-Adaptive Models
      • 9.4.1 Transfer Learning
      • 9.4.2 A User-Adaptive Model for Activity Recognition
  • 10. Detecting Abnormal Behaviors
    • 10.1 Isolation Forests
    • 10.2 Detecting Abnormal Fish Behaviors
      • 10.2.1 Explore and Visualize Trajectories
      • 10.2.2 Preprocessing and Feature Extraction
      • 10.2.3 Training the Model
      • 10.2.4 ROC curve and AUC
    • 10.3 Autoencoders
      • 10.3.1 Autoencoders for Anomaly Detection
  • Appendix A: Setup your Environment
  • Appendix B: Datasets

Authors have earned$10,098,681writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub