Scala for Machine Learning - Second Edition : Leverage Scala and Machine Learning to Study and Construct Systems That Can Learn from Data.
Nicolas, Patrick R.
Scala for Machine Learning - Second Edition : Leverage Scala and Machine Learning to Study and Construct Systems That Can Learn from Data. - 2nd ed. - 1 online resource (740 pages)
Cover -- Copyright -- Credits -- About the Author -- About the Reviewers -- www.PacktPub.com -- Customer Feedback -- Table of Contents -- Preface -- Chapter 1: Getting Started -- Mathematical notations for the curious -- Why machine learning? -- Classification -- Prediction -- Optimization -- Regression -- Why Scala? -- Scala as a functional language -- Abstraction -- Higher kinded types -- Functors -- Monads -- Scala as an object oriented language -- Scala as a scalable language -- Model categorization -- Taxonomy of machine learning algorithms -- Unsupervised learning -- Clustering -- Dimension reduction -- Supervised learning -- Generative models -- Discriminative models -- Semi-supervised learning -- Reinforcement learning -- Leveraging Java libraries -- Tools and frameworks -- Java -- Scala -- Eclipse Scala IDE -- IntelliJ IDEA Scala plugin -- Simple build tool -- Apache Commons Math -- Description -- Licensing -- Installation -- JFreeChart -- Description -- Licensing -- Installation -- Other libraries and frameworks -- Source code -- Convention -- Context bounds -- Presentation -- Primitives and implicits -- Immutability -- Let's kick the tires -- Writing a simple workflow -- Step 1 - scoping the problem -- Step 2 - loading data -- Step 3 - preprocessing data -- Step 4 - discovering patterns -- Step 5 - implementing the classifier -- Step 6 - evaluating the model -- Summary -- Chapter 2: Data Pipelines -- Modeling -- What is a model? -- Model versus design -- Selecting features -- Extracting features -- Defining a methodology -- Monadic data transformation -- Error handling -- Monads to the rescue -- mplicit models -- Explicit models -- Workflow computational model -- Supporting mathematical abstractions -- Step 1 - variable declaration -- Step 2 - model definition -- Step 3 - instantiation -- Composing mixins to build workflow. Understanding the problem -- Defining modules -- Instantiating the workflow -- Modularizing -- Profiling data -- Immutable statistics -- Z-score and Gauss -- Assessing a model -- Validation -- Key quality metrics -- F-score for binomial classification -- F-score for multinomial classification -- Area under the curves -- Area under PRC -- Area under ROC -- Cross-validation -- One-fold cross-validation -- K-fold cross-validation -- Bias-variance decomposition -- Overfitting -- Summary -- Chapter 3: Data Preprocessing -- Time series in Scala -- Context bounds -- Types and operations -- Transpose operator -- Differential operator -- Lazy views -- Moving averages -- Simple moving average -- Weighted moving average -- Exponential moving average -- Fourier analysis -- Discrete Fourier transform (DFT) -- DFT-based filtering -- Detection of market cycles -- The discrete Kalman filter -- The state space estimation -- The transition equation -- The measurement equation -- The recursive algorithm -- Prediction -- Correction -- Kalman smoothing -- Fixed lag smoothing -- Experimentation -- Benefits and drawbacks -- Alternative preprocessing techniques -- Summary -- Chapter 4: Unsupervised Learning -- K-mean clustering -- K-means -- Measuring similarity -- Defining the algorithm -- Step 1 - Clusters configuration -- Step 2 - Clusters assignment -- Step 3 - Reconstruction error minimization -- Step 4 - Classification -- Curse of dimensionality -- Evaluation -- The results -- Tuning the number of clusters -- Validation -- Expectation-Maximization (EM) -- Gaussian mixture model -- EM overview -- Implementation -- Classification -- Testing -- Online EM -- Summary -- Chapter 5: Dimension Reduction -- Challenging model complexity -- The divergences -- The Kullback-Leibler divergence -- Overview -- Implementation -- Testing -- The mutual information. Principal components analysis (PCA) -- Algorithm -- Implementation -- Test case -- Evaluation -- Extending PCA -- Validation -- Categorical features -- Performance -- Nonlinear models -- Kernel PCA -- Manifolds -- Summary -- Chapter 6: Naïve Bayes Classifiers -- Probabilistic graphical models -- Naïve Bayes classifiers -- Introducing the multinomial Naïve Bayes -- Formalism -- The frequentist perspective -- The predictive model -- The zero-Frequency problem -- Implementation -- Design -- Training -- Classification -- F1 Validation -- Features extraction -- Testing -- Multivariate Bernoulli classification -- Model -- Implementation -- Naïve Bayes and text mining -- Basics information retrieval -- Implementation -- Analyzing documents -- Extracting relative terms frequency -- Generating the features -- Testing -- Retrieving textual information -- Evaluating text mining classifier -- Pros and cons -- Summary -- Chapter 7: Sequential Data Models -- Markov decision processes -- The Markov property -- The first-order discrete Markov chain -- The hidden Markov model (HMM) -- Notation -- The lambda model -- Design -- Evaluation (CF-1) -- Alpha (forward pass) -- Beta (backward pass) -- Training (CF-2) -- Baum-Welch estimator (EM) -- Decoding (CF-3) -- The Viterbi algorithm -- Putting it all together -- Test case 1 - Training -- HMM as filtering technique -- Conditional random fields -- Introduction to CRF -- Linear chain CRF -- Regularized CRF and text analytics -- The feature functions model -- Design -- Implementation -- Configuring the CRF classifier -- Training the CRF model -- Applying the CRF model -- Tests -- The training convergence profile -- Impact of the size of the training set -- Impact of L2 regularization factor -- Comparing CRF and HMM -- Performance consideration -- Summary -- Chapter 8: Monte Carlo Inference -- The purpose of sampling. Gaussian sampling -- Box-Muller transform -- Monte Carlo approximation -- Overview -- Implementation -- Bootstrapping with replacement -- Overview -- Resampling -- Implementation -- Pros and cons of bootstrap -- Markov Chain Monte Carlo (MCMC) -- Overview -- Metropolis-Hastings (MH) -- Implementation -- Test -- Summary -- Chapter 9: Regression and Regularization -- Linear regression -- Univariate linear regression -- Implementation -- Test case -- Ordinary least squares (OLS) regression -- Design -- Implementation -- Test case 1 - trending -- Test case 2 - features selection -- Regularization -- Ln roughness penalty -- Ridge regression -- Design -- Implementation -- Test case -- Numerical optimization -- Logistic regression -- Logistic function -- Design -- Training workflow -- Step 1 - configuring the optimizer -- Step 2 - computing the Jacobian matrix -- Step 3 - managing the convergence of optimizer -- Step 4 - defining the least squares problem -- Step 5 - minimizing the sum of square errors -- Test -- Classification -- Summary -- Chapter 10: Multi-Layer Perceptron -- Feed-forward neural networks (FFNN) -- The biological background -- Mathematical background -- The multilayer perceptron (MLP) -- Activation function -- Network topology -- Design -- Configuration -- Network components -- Network topology -- Input and hidden layers -- Output layer -- Synapses -- Connections -- Weights initialization -- Model -- Problem types (modes) -- Online versus batch training -- Training epoch -- Step 1 - input forward propagation -- Step 2 - error backpropagation -- Step 3 - exit condition -- Putting it all together -- Training and classification -- Regularization -- Model generation -- Fast Fisher-Yates shuffle -- Prediction -- Model fitness -- Evaluation -- Execution profile -- Impact of learning rate -- Impact of the momentum factor. Impact of the number of hidden layers -- Test case -- Implementation -- Models evaluation -- Impact of hidden layers' architecture -- Benefits and limitations -- Summary -- Chapter 11: Deep Learning -- Sparse autoencoder -- Undercomplete autoencoder -- Deterministic autoencoder -- Categorization -- Feed-forward sparse, undercomplete autoencoder -- Sparsity updating equations -- Implementation -- Restricted Boltzmann Machines (RBMs) -- Boltzmann machine -- Binary restricted Boltzmann machines -- Conditional probabilities -- Sampling -- Log-likelihood gradient -- Contrastive divergence -- Configuration parameters -- Unsupervised learning -- Convolution neural networks -- Local receptive fields -- Weight sharing -- Convolution layers -- Sub-sampling layers -- Putting it all together -- Summary -- Chapter 12: Kernel Models and SVM -- Kernel functions -- Overview -- Common discriminative kernels -- Kernel monadic composition -- The support vector machine (SVM) -- The linear SVM -- The separable case (hard margin) -- The non-separable case (soft margin) -- The nonlinear SVM -- Max-margin classification -- The kernel trick -- Support vector classifier (SVC) -- The binary SVC -- Anomaly detection with one-class SVC -- Support vector regression (SVR) -- Overview -- SVR versus linear regression -- Performance considerations -- Summary -- Chapter 13: Evolutionary Computing -- Evolution -- The origin -- NP problems -- Evolutionary computing -- Genetic algorithms and machine learning -- Genetic algorithm components -- Encodings -- Value encoding -- Predicate encoding -- Solution encoding -- The encoding scheme -- Genetic operators -- Selection -- Crossover -- Mutation -- Fitness score -- Implementation -- Software design -- Key components -- Population -- Chromosomes -- Genes -- Selection -- Controlling population growth -- GA configuration -- Crossover. Population.
9781787126206
Scala (Computer program language).
Electronic books.
QA76.73.S28.N53 2017
Scala for Machine Learning - Second Edition : Leverage Scala and Machine Learning to Study and Construct Systems That Can Learn from Data. - 2nd ed. - 1 online resource (740 pages)
Cover -- Copyright -- Credits -- About the Author -- About the Reviewers -- www.PacktPub.com -- Customer Feedback -- Table of Contents -- Preface -- Chapter 1: Getting Started -- Mathematical notations for the curious -- Why machine learning? -- Classification -- Prediction -- Optimization -- Regression -- Why Scala? -- Scala as a functional language -- Abstraction -- Higher kinded types -- Functors -- Monads -- Scala as an object oriented language -- Scala as a scalable language -- Model categorization -- Taxonomy of machine learning algorithms -- Unsupervised learning -- Clustering -- Dimension reduction -- Supervised learning -- Generative models -- Discriminative models -- Semi-supervised learning -- Reinforcement learning -- Leveraging Java libraries -- Tools and frameworks -- Java -- Scala -- Eclipse Scala IDE -- IntelliJ IDEA Scala plugin -- Simple build tool -- Apache Commons Math -- Description -- Licensing -- Installation -- JFreeChart -- Description -- Licensing -- Installation -- Other libraries and frameworks -- Source code -- Convention -- Context bounds -- Presentation -- Primitives and implicits -- Immutability -- Let's kick the tires -- Writing a simple workflow -- Step 1 - scoping the problem -- Step 2 - loading data -- Step 3 - preprocessing data -- Step 4 - discovering patterns -- Step 5 - implementing the classifier -- Step 6 - evaluating the model -- Summary -- Chapter 2: Data Pipelines -- Modeling -- What is a model? -- Model versus design -- Selecting features -- Extracting features -- Defining a methodology -- Monadic data transformation -- Error handling -- Monads to the rescue -- mplicit models -- Explicit models -- Workflow computational model -- Supporting mathematical abstractions -- Step 1 - variable declaration -- Step 2 - model definition -- Step 3 - instantiation -- Composing mixins to build workflow. Understanding the problem -- Defining modules -- Instantiating the workflow -- Modularizing -- Profiling data -- Immutable statistics -- Z-score and Gauss -- Assessing a model -- Validation -- Key quality metrics -- F-score for binomial classification -- F-score for multinomial classification -- Area under the curves -- Area under PRC -- Area under ROC -- Cross-validation -- One-fold cross-validation -- K-fold cross-validation -- Bias-variance decomposition -- Overfitting -- Summary -- Chapter 3: Data Preprocessing -- Time series in Scala -- Context bounds -- Types and operations -- Transpose operator -- Differential operator -- Lazy views -- Moving averages -- Simple moving average -- Weighted moving average -- Exponential moving average -- Fourier analysis -- Discrete Fourier transform (DFT) -- DFT-based filtering -- Detection of market cycles -- The discrete Kalman filter -- The state space estimation -- The transition equation -- The measurement equation -- The recursive algorithm -- Prediction -- Correction -- Kalman smoothing -- Fixed lag smoothing -- Experimentation -- Benefits and drawbacks -- Alternative preprocessing techniques -- Summary -- Chapter 4: Unsupervised Learning -- K-mean clustering -- K-means -- Measuring similarity -- Defining the algorithm -- Step 1 - Clusters configuration -- Step 2 - Clusters assignment -- Step 3 - Reconstruction error minimization -- Step 4 - Classification -- Curse of dimensionality -- Evaluation -- The results -- Tuning the number of clusters -- Validation -- Expectation-Maximization (EM) -- Gaussian mixture model -- EM overview -- Implementation -- Classification -- Testing -- Online EM -- Summary -- Chapter 5: Dimension Reduction -- Challenging model complexity -- The divergences -- The Kullback-Leibler divergence -- Overview -- Implementation -- Testing -- The mutual information. Principal components analysis (PCA) -- Algorithm -- Implementation -- Test case -- Evaluation -- Extending PCA -- Validation -- Categorical features -- Performance -- Nonlinear models -- Kernel PCA -- Manifolds -- Summary -- Chapter 6: Naïve Bayes Classifiers -- Probabilistic graphical models -- Naïve Bayes classifiers -- Introducing the multinomial Naïve Bayes -- Formalism -- The frequentist perspective -- The predictive model -- The zero-Frequency problem -- Implementation -- Design -- Training -- Classification -- F1 Validation -- Features extraction -- Testing -- Multivariate Bernoulli classification -- Model -- Implementation -- Naïve Bayes and text mining -- Basics information retrieval -- Implementation -- Analyzing documents -- Extracting relative terms frequency -- Generating the features -- Testing -- Retrieving textual information -- Evaluating text mining classifier -- Pros and cons -- Summary -- Chapter 7: Sequential Data Models -- Markov decision processes -- The Markov property -- The first-order discrete Markov chain -- The hidden Markov model (HMM) -- Notation -- The lambda model -- Design -- Evaluation (CF-1) -- Alpha (forward pass) -- Beta (backward pass) -- Training (CF-2) -- Baum-Welch estimator (EM) -- Decoding (CF-3) -- The Viterbi algorithm -- Putting it all together -- Test case 1 - Training -- HMM as filtering technique -- Conditional random fields -- Introduction to CRF -- Linear chain CRF -- Regularized CRF and text analytics -- The feature functions model -- Design -- Implementation -- Configuring the CRF classifier -- Training the CRF model -- Applying the CRF model -- Tests -- The training convergence profile -- Impact of the size of the training set -- Impact of L2 regularization factor -- Comparing CRF and HMM -- Performance consideration -- Summary -- Chapter 8: Monte Carlo Inference -- The purpose of sampling. Gaussian sampling -- Box-Muller transform -- Monte Carlo approximation -- Overview -- Implementation -- Bootstrapping with replacement -- Overview -- Resampling -- Implementation -- Pros and cons of bootstrap -- Markov Chain Monte Carlo (MCMC) -- Overview -- Metropolis-Hastings (MH) -- Implementation -- Test -- Summary -- Chapter 9: Regression and Regularization -- Linear regression -- Univariate linear regression -- Implementation -- Test case -- Ordinary least squares (OLS) regression -- Design -- Implementation -- Test case 1 - trending -- Test case 2 - features selection -- Regularization -- Ln roughness penalty -- Ridge regression -- Design -- Implementation -- Test case -- Numerical optimization -- Logistic regression -- Logistic function -- Design -- Training workflow -- Step 1 - configuring the optimizer -- Step 2 - computing the Jacobian matrix -- Step 3 - managing the convergence of optimizer -- Step 4 - defining the least squares problem -- Step 5 - minimizing the sum of square errors -- Test -- Classification -- Summary -- Chapter 10: Multi-Layer Perceptron -- Feed-forward neural networks (FFNN) -- The biological background -- Mathematical background -- The multilayer perceptron (MLP) -- Activation function -- Network topology -- Design -- Configuration -- Network components -- Network topology -- Input and hidden layers -- Output layer -- Synapses -- Connections -- Weights initialization -- Model -- Problem types (modes) -- Online versus batch training -- Training epoch -- Step 1 - input forward propagation -- Step 2 - error backpropagation -- Step 3 - exit condition -- Putting it all together -- Training and classification -- Regularization -- Model generation -- Fast Fisher-Yates shuffle -- Prediction -- Model fitness -- Evaluation -- Execution profile -- Impact of learning rate -- Impact of the momentum factor. Impact of the number of hidden layers -- Test case -- Implementation -- Models evaluation -- Impact of hidden layers' architecture -- Benefits and limitations -- Summary -- Chapter 11: Deep Learning -- Sparse autoencoder -- Undercomplete autoencoder -- Deterministic autoencoder -- Categorization -- Feed-forward sparse, undercomplete autoencoder -- Sparsity updating equations -- Implementation -- Restricted Boltzmann Machines (RBMs) -- Boltzmann machine -- Binary restricted Boltzmann machines -- Conditional probabilities -- Sampling -- Log-likelihood gradient -- Contrastive divergence -- Configuration parameters -- Unsupervised learning -- Convolution neural networks -- Local receptive fields -- Weight sharing -- Convolution layers -- Sub-sampling layers -- Putting it all together -- Summary -- Chapter 12: Kernel Models and SVM -- Kernel functions -- Overview -- Common discriminative kernels -- Kernel monadic composition -- The support vector machine (SVM) -- The linear SVM -- The separable case (hard margin) -- The non-separable case (soft margin) -- The nonlinear SVM -- Max-margin classification -- The kernel trick -- Support vector classifier (SVC) -- The binary SVC -- Anomaly detection with one-class SVC -- Support vector regression (SVR) -- Overview -- SVR versus linear regression -- Performance considerations -- Summary -- Chapter 13: Evolutionary Computing -- Evolution -- The origin -- NP problems -- Evolutionary computing -- Genetic algorithms and machine learning -- Genetic algorithm components -- Encodings -- Value encoding -- Predicate encoding -- Solution encoding -- The encoding scheme -- Genetic operators -- Selection -- Crossover -- Mutation -- Fitness score -- Implementation -- Software design -- Key components -- Population -- Chromosomes -- Genes -- Selection -- Controlling population growth -- GA configuration -- Crossover. Population.
9781787126206
Scala (Computer program language).
Electronic books.
QA76.73.S28.N53 2017