Preface
Chapter 1: Givin Com uters the Ability to Learn from DataBuilding intelligent machines to transform data into knowledgeThe three different types of machine learningMaking predictions about the future with supervised learningClassification for predicting class labelsRegression for predicting continuous outcomesSolving interactive problems with reinforcement learningDiscovering hidden structures with unsupervised learningFinding subgroups with clusteringDimensionality reduction for data compressionAn introduction to the basic terminology and notationsA roadmap for building machine learning systemsPreprocessing - getting data into shapeTraining and selecting a predictive modelEvaluating models and predicting unseen data instancesUsing Python for machine learningInstalling Python packagesSummary
Chapter 2: Training Machine Learning Algorithms
for ClassificationArtificial neurons - a brief glimpse into the early historyof machine learningImplementing a perceptron learning algorithm in PythonTraining a perceptron model on the Iris datasetAdaptive linear neurons and the convergence of learningMinimizing cost functions with gradient descentImplementing an Adaptive Linear Neuron in PythonLarge scale machine learning and stochastic gradient descentSummary
Chapter 3: A Tour of Machine Learning Classifiers Using
Scikit-learnChoosing a classification algorithmFirst steps with scikit-learnTraining a perceptron via scikit-learnModeling class probabilities via logistic regressionLogistic regression intuition and conditional probabilitiesLearning the weights of the logistic cost functionTraining a logistic regression model with scikit-learnTackling overfitting via regularizationMaximum margin classification with support vector machinesMaximum margin intuitionDealing with the nonlinearly separablecase using slack variablesAlternative implementations in scikit-learnSolving nonlinear problems using a kernel SMMUsing the kernel trick to find separating hyperplanes in higherdimensional spaceDecision tree learningMaximizing information gain - getting the most bang for the buckBuilding a decision treeCombining weak to strong learners via random forestsK-nearest neighbors - a lazy learning algorithmSummary
Chapter 4: Building Good Training Sets - Data PreprocessingDealing with missing dataEliminating samples or features with missing valuesImputing missing valuesUnderstanding the scikit-learn estimator APIHandling categorical dataMapping ordinal featuresEncoding class labelsPerforming one-hot encoding on nominal featuresPartitioning a dataset in training and test setsBringing features onto the same scaleSelecting meaningful featuresSparse solutions with L1 regularizationSequential feature selection algorithmsAssessing feature importance with random forestsSummary
Chapter 5: Com~ Data via Di~ ReductionUnsupervised dimensionality reduction via principalcomponent analysisTotal and explained varianceFeature transformationPrincipal component analysis in scikit-learnSupervised data compression via linear discriminant analysisComputing the scatter matricesSelecting linear discriminants for the new feature subspaceProjecting samples onto the new feature spaceLDA via scikit-learnUsing kernel principal component analysis for nonlinear mappingsKernel functions and the kernel trickImplementing a kernel principal component analysis in PythonExample 1 - separating half-moon shapesExample 2 - separating concentric circlesProjecting new data pointsKernel principal component analysis in scikit-learnSummary
Chapter 6: Learning Best Practices for Model Evaluation
and Hyperparameter Tuni~Streamlining workflows with pipelinesLoading the Breast Cancer Wisconsin datasetCombining transformers and estimators in a pipelineUsing k-fold cross-validation to assess model performanceThe holdout methodK-fold cross-validationDebugging algorithms with learning and validation curvesDiagnosing bias and variance problems with learning curvesAddressing overfitting and underfitting with validation curvesFine-tuning machine learning models via grid searchTuning hyperparameters via grid searchAlgorithm selection with nested cross-validationLooking at different performance evaluation metricsReading a confusion matrixOptimizing the precision and recall of a classification modelPlotting a receiver operating characteristicThe scoring metrics for multiclass classificationSummary
Chapter 7: Combining Different Models for Ensemble LearningLearning with ensemblesImplementing a simple majority vote classifierCombining different algorithms for classification with majority voteEvaluating and tuning the ensemble classifierBagging - building an ensemble of classifiers frombootstrap samplesLeveraging weak learners via adaptive boostingSummary
Chapter 8: Applying Machine Learning to Sentiment AnalysisObtaining the IMDb movie review datasetIntroducing the bag-of-words modelTransforming words into feature vectorsAssessing word relevancy via term frequency-inversedocument frequencyCleaning text dataProcessing documents into tokensTraining a logistic regression model for document classificationWorking with bigger data - online algorithms andout-of-core learningSummary
Chapter 9: Embedding a Machine Learning Model into
a Web ApplicationSerializing fitted scikit-learn estimatorsSetting up a SQLite database for data storageDeveloping a web application with FlaskOur first Flask web applicationForm validation and renderingTurning the movie classifier into a web applicationDeploying the web application to a public sewerUpdating the movie review classifierSummary
Chapter 10: Predicting Continuous Target Variables
with R_Re_gression AnalysisIntroducing a simple linear regression modelExploring the Housing DatasetVisualizing the important characteristics of a datasetImplementing an ordinary least squares linear regression modelSolving regression for regression parameters with gradient descentEstimating the coefficient of a regression model via scikit-learnFitting a robust regression model using RANSACEvaluating the performance of linear regression modelsUsing regularized methods for regressionTurning a linear regression model into a curve - polynomialregressionModeling nonlinear relationships in the Housing DatasetDealing with nonlinear relationships using random forestsDecision tree regressionRandom forest regressionSummary
Chapter 11: Working with Unlabeled Data- Cluste~Grouping objects by similarity using k-meansK-means Hard versus soft clusteringUsing the elbow method to find the optimal number of clustersQuantifying the quality of clustering via silhouette plotsOrganizing clusters as a hierarchical treePerforming hierarchical clustering on a distance matrixAttaching dendrograms to a heat mapApplying agglomerative clustering via scikit-learnLocating regions of high density via DBSCANSummary
Chapter 12: Training Artificial Neural Networks for Image
RecognitionModeling complex functions with artificial neural networksSingle-layer neural network recapIntroducing the multi-layer neural network architectureActivating a neural network via forward propagationClassifying handwritten digitsObtaining the MNIST datasetImplementing a multi-layer perceptronTraining an artificial neural networkComputing the logistic cost functionTraining neural networks via backpropagationDeveloping your intuition for backpropagationDebugging neural networks with gradient checkingConvergence in neural networksOther neural network architecturesConvolutional Neural NetworksRecurrent Neural NetworksA few last words about neural network implementationSummary
Chapter 13: Parallelizing Neural Network Training with TheanoBuilding, compiling, and running expressions with TheanoWhat is Theano?First steps with TheanoConfiguring TheanoWorking with array structuresWrapping things up - a linear regression exampleChoosing activation functions for feedforward neural networksLogistic function recapEstimating probabilities in multi-class classification via thesoftmax functionBroadening the output spectrum by using a hyperbolic tangentTraining neural networks efficiently using KerasSummary
Index