R Machine Learning Projects

Book description

Master a range of machine learning domains with real-world projects using TensorFlow for R, H2O, MXNet, and more

Key Features

  • Master machine learning, deep learning, and predictive modeling concepts in R 3.5
  • Build intelligent end-to-end projects for finance, retail, social media, and a variety of domains
  • Implement smart cognitive models with helpful tips and best practices

Book Description

R is one of the most popular languages when it comes to performing computational statistics (statistical computing) easily and exploring the mathematical side of machine learning. With this book, you will leverage the R ecosystem to build efficient machine learning applications that carry out intelligent tasks within your organization.

This book will help you test your knowledge and skills, guiding you on how to build easily through to complex machine learning projects. You will first learn how to build powerful machine learning models with ensembles to predict employee attrition. Next, you'll implement a joke recommendation engine and learn how to perform sentiment analysis on Amazon reviews. You'll also explore different clustering techniques to segment customers using wholesale data. In addition to this, the book will get you acquainted with credit card fraud detection using autoencoders, and reinforcement learning to make predictions and win on a casino slot machine.

By the end of the book, you will be equipped to confidently perform complex tasks to build research and commercial projects for automated operations.

What you will learn

  • Explore deep neural networks and various frameworks that can be used in R
  • Develop a joke recommendation engine to recommend jokes that match users' tastes
  • Create powerful ML models with ensembles to predict employee attrition
  • Build autoencoders for credit card fraud detection
  • Work with image recognition and convolutional neural networks
  • Make predictions for casino slot machine using reinforcement learning
  • Implement NLP techniques for sentiment analysis and customer segmentation

Who this book is for

If you're a data analyst, data scientist, or machine learning developer who wants to master machine learning concepts using R by building real-world projects, this is the book for you. Each project will help you test your skills in implementing machine learning algorithms and techniques. A basic understanding of machine learning and working knowledge of R programming is necessary to get the most out of this book.

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. R Machine Learning Projects
  3. About Packt
    1. Why subscribe?
    2. Packt.com
  4. Dedication
  5. Contributors
    1. About the author
    2. About the reviewers
    3. Packt is searching for authors like you
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  7. Exploring the Machine Learning Landscape
    1. ML versus software engineering
    2. Types of ML methods
      1. Supervised learning
      2. Unsupervised learning
      3. Semi-supervised learning
      4. Reinforcement learning
      5. Transfer learning
    3. ML terminology – a quick review
      1. Deep learning
      2. Big data
      3. Natural language processing
      4. Computer vision
      5. Cost function
      6. Model accuracy
      7. Confusion matrix
      8. Predictor variables
      9. Response variable
      10. Dimensionality reduction
      11. Class imbalance problem
      12. Model bias and variance
      13. Underfitting and overfitting
      14. Data preprocessing
      15. Holdout sample
      16. Hyperparameter tuning
      17. Performance metrics
      18. Feature engineering
      19. Model interpretability
    4. ML project pipeline
      1. Business understanding
      2. Understanding and sourcing the data
      3. Preparing the data 
      4. Model building and evaluation
      5. Model deployment
    5. Learning paradigm
    6. Datasets
    7. Summary
  8. Predicting Employee Attrition Using Ensemble Models
    1. Philosophy behind ensembling 
    2. Getting started
    3. Understanding the attrition problem and the dataset 
    4. K-nearest neighbors model for benchmarking the performance
    5. Bagging
      1. Bagged classification and regression trees (treeBag) implementation
      2. Support vector machine bagging (SVMBag) implementation
      3. Naive Bayes (nbBag) bagging implementation
    6. Randomization with random forests
      1. Implementing an attrition prediction model with random forests
    7. Boosting 
      1. The GBM implementation
      2. Building attrition prediction model with XGBoost
    8. Stacking 
      1. Building attrition prediction model with stacking
    9. Summary
  9. Implementing a Jokes Recommendation Engine
    1. Fundamental aspects of recommendation engines
      1. Recommendation engine categories
        1. Content-based filtering
        2. Collaborative filtering
        3. Hybrid filtering
    2. Getting started
    3. Understanding the Jokes recommendation problem and the dataset
      1. Converting the DataFrame
      2. Dividing the DataFrame
    4. Building a recommendation system with an item-based collaborative filtering technique
    5. Building a recommendation system with a user-based collaborative filtering technique
    6. Building a recommendation system based on an association-rule mining technique
      1. The Apriori algorithm
    7. Content-based recommendation engine
      1. Differentiating between ITCF and content-based recommendations
    8. Building a hybrid recommendation system for Jokes recommendations
    9. Summary
    10. References
  10. Sentiment Analysis of Amazon Reviews with NLP
    1. The sentiment analysis problem
    2. Getting started
    3. Understanding the Amazon reviews dataset
    4. Building a text sentiment classifier with the BoW approach
      1. Pros and cons of the BoW approach
    5. Understanding word embedding
    6. Building a text sentiment classifier with pretrained word2vec word embedding based on Reuters news corpus
    7. Building a text sentiment classifier with GloVe word embedding
    8. Building a text sentiment classifier with fastText
    9. Summary
  11. Customer Segmentation Using Wholesale Data
    1. Understanding customer segmentation
    2. Understanding the wholesale customer dataset and the segmentation problem
      1. Categories of clustering algorithms
    3. Identifying the customer segments in wholesale customer data using k-means clustering
      1. Working mechanics of the k-means algorithm
    4. Identifying the customer segments in the wholesale customer data using DIANA
    5. Identifying the customer segments in the wholesale customers data using AGNES
    6. Summary
  12. Image Recognition Using Deep Neural Networks
    1. Technical requirements
    2. Understanding computer vision
    3. Achieving computer vision with deep learning
      1. Convolutional Neural Networks
        1. Layers of CNNs
    4. Introduction to the MXNet framework
    5. Understanding the MNIST dataset
    6. Implementing a deep learning network for handwritten digit recognition
      1. Implementing dropout to avoid overfitting
      2. Implementing the LeNet architecture with the MXNet library
    7. Implementing computer vision with pretrained models
    8. Summary
  13. Credit Card Fraud Detection Using Autoencoders
    1. Machine learning in credit card fraud detection
    2. Autoencoders explained
      1. Types of AEs based on hidden layers
      2. Types of AEs based on restrictions
      3. Applications of AEs
    3. The credit card fraud dataset
    4. Building AEs with the H2O library in R
      1. Autoencoder code implementation for credit card fraud detection
    5. Summary
  14. Automatic Prose Generation with Recurrent Neural Networks
    1. Understanding language models
    2. Exploring recurrent neural networks
      1. Comparison of feedforward neural networks and RNNs
    3. Backpropagation through time
    4. Problems and solutions to gradients in RNN
      1. Exploding gradients
      2. Vanishing gradients
    5. Building an automated prose generator with an RNN
      1. Implementing the project
    6. Summary
  15. Winning the Casino Slot Machines with Reinforcement Learning
    1. Understanding RL
      1. Comparison of RL with other ML algorithms
      2. Terminology of RL
      3. The multi-arm bandit problem
      4. Strategies for solving MABP
        1. The epsilon-greedy algorithm
        2. Boltzmann or softmax exploration
        3. Decayed epsilon greedy
        4. The upper confidence bound algorithm
        5. Thompson sampling
    2. Multi-arm bandit – real-world use cases
    3. Solving the MABP with UCB and Thompson sampling algorithms
    4. Summary
  16. The Road Ahead
  17. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: R Machine Learning Projects
  • Author(s): Dr. Sunil Kumar Chinnamgari
  • Release date: January 2019
  • Publisher(s): Packt Publishing
  • ISBN: 9781789807943