Owing to his vast expertise in this ield, I am conident that Sebastian's insights into the world of Machine Learning in Python will be invaluable to users of all. Paperback: pages; ebook available in Kindle format, Epub, PDF Packt Sebastian Raschka's new book, Python Machine Learning, has just been released. of your data, pick up Python Machine Learning—whether you want start from scratch or want .. at venloportledis.gq~zkolter/course/linalg/linalg_ notes. pdf.
|Language:||English, Spanish, French|
|Genre:||Science & Research|
|Distribution:||Free* [*Sign up for free]|
In this book, we'll continue where we left off in "Python Machine Learning" and implement deep learning algorithms in TensorFlow. [venloportledis.gq81] Python Machine Learning Python Machine Learning Sebastian Raschka epub. Python Machine Learning Sebastian Raschka pdf download. Python. The "Python Machine Learning (1st edition)" book code repository and info Introduction to NumPy [PDF] [EPUB] [Code Notebook] Sebastian Raschka's new book, Python Machine Learning, has just been released. I got a.
Let us now plot the cost against the number of epochs for the two different learning rates: The left chart shows what could happen if we choose a learning rate that is too large—instead of minimizing the cost function, the error becomes larger in every epoch because we overshoot the global minimum: The following igure illustrates how we change the value of a particular weight parameter to minimize the cost function J left subigure. The subigure on the right illustrates what happens if we choose a learning rate that is too large, we overshoot the global minimum: Gradient descent is one of the many algorithms that beneit from feature scaling.
Here, we will use a feature scaling method called standardization, which gives our data the property of a standard normal distribution. The mean of each feature is centered at value 0 and the feature column has a standard deviation of 1. Standardization can easily be achieved using the NumPy methods mean and std: However, note that the SSE remains non-zero even though all samples were classiied correctly. Large scale machine learning and stochastic gradient descent In the previous section, we learned how to minimize a cost function by taking a step into the opposite direction of a gradient that is calculated from the whole training set; this is why this approach is sometimes also referred to as batch gradient descent.
Now imagine we have a very large dataset with millions of data points, which is not uncommon in many machine learning applications. Running batch gradient descent can be computationally quite costly in such scenarios since we need to reevaluate the whole training dataset each time we take one step towards the global minimum.
A popular alternative to the batch gradient descent algorithm is stochastic gradient descent, sometimes also called iterative or on-line gradient descent.
Instead of updating i the weights based on the sum of the accumulated errors over all samples x: Since each gradient is calculated based on a single training example, the error surface is noisier than in gradient descent, which can also have the advantage that stochastic gradient descent can escape shallow local minima more readily. To obtain accurate results via stochastic gradient descent, it is important to present it with data in a random order, which is why we want to shufle the training set for every epoch to prevent cycles.
Note that stochastic gradient descent does not reach the global minimum but an area very close to it. By using an adaptive learning rate, we can achieve further annealing to a better global minimum Another advantage of stochastic gradient descent is that we can use it for online learning.
In online learning, our model is trained on-the-ly as new training data arrives. This is especially useful if we are accumulating large amounts of data—for example, customer data in typical web applications. Using online learning, the system can immediately adapt to changes and the training data can be discarded after updating the model if storage space in an issue.
A compromise between batch gradient descent and stochastic gradient descent is the so-called mini-batch learning. Mini-batch learning can be understood as applying batch gradient descent to smaller subsets of the training data—for example, 50 samples at a time.
The advantage over batch gradient descent is that convergence is reached faster via mini-batches because of the more frequent weight updates. Furthermore, mini-batch learning allows us to replace the for-loop over the training samples in Stochastic Gradient Descent SGD by vectorized operations, which can further improve the computational eficiency of our learning algorithm.
Inside the fit method, we will now update the weights after each training sample. In order to check if our algorithm converged after training, we will calculate the cost as the average cost of the training samples in each epoch.
True Shuffles training data every epoch if True to prevent cycles. None Set random state for shuffling and initializing the weights. Those numbers can then be used as indices to shufle our feature matrix and class label vector.
As we can see, the average cost goes down pretty quickly, and the inal decision boundary after 15 epochs looks similar to the batch gradient descent with Adaline.
Summary In this chapter, we gained a good understanding of the basic concepts of linear classiiers for supervised learning. After we implemented a perceptron, we saw how we can train adaptive linear neurons eficiently via a vectorized implementation of gradient descent and on-line learning via stochastic gradient descent. Now that we have seen how to implement simple classiiers in Python, we are ready to move on to the next chapter where we will use the Python scikit-learn machine learning library to get access to more advanced and powerful off-the-shelf machine learning classiiers that are commonly used in academia as well as in industry.
While learning about the differences between several supervised learning algorithms for classiication, we will also develop an intuitive appreciation of their individual strengths and weaknesses. Also, we will take our irst steps with the scikit-learn library, which offers a user-friendly interface for using those algorithms eficiently and productively. The topics that we will learn about throughout this chapter are as follows: To restate the "No Free Lunch" theorem: In practice, it is always recommended that you compare the performance of at least a handful of different learning algorithms to select the best model for the particular problem; these may differ in the number of features or samples, the amount of noise in a dataset, and whether the classes are linearly separable or not.
The ive main steps that are involved in training a machine learning algorithm can be summarized as follows: Selection of features. Choosing a performance metric.
Choosing a classiier and optimization algorithm. Evaluating the performance of the model. Tuning the algorithm. Since the approach of this book is to build machine learning knowledge step by step, we will mainly focus on the principal concepts of the different algorithms in this chapter and revisit topics such as feature selection and preprocessing, performance metrics, and hyperparameter tuning for more detailed discussions later in this book.
First steps with scikit-learn In Chapter 2, Training Machine Learning Algorithms for Classiication, you learned about two related learning algorithms for classiication: Now we will take a look at the scikit-learn API, which combines a user-friendly interface with a highly optimized implementation of several classiication algorithms.
However, the scikit-learn library offers not only a large variety of learning algorithms, but also many convenient functions to preprocess data and to ine-tune and evaluate our models. Training a perceptron via scikit-learn To get started with the scikit-learn library, we will train a perceptron model similar to the one that we implemented in Chapter 2, Training Machine Learning Algorithms for Classiication.
For simplicity, we will use the already familiar Iris dataset throughout the following sections.
Conveniently, the Iris dataset is already available via scikit-learn, since it is a simple yet popular dataset that is frequently used for testing and experimenting with algorithms. Also, we will only use two features from the Iris lower dataset for visualization purposes. To evaluate how well a trained model performs on unseen data, we will further split the dataset into separate training and test datasets. Later in Chapter 5, Compressing Data via Dimensionality Reduction, we will discuss the best practices around model evaluation in more detail: Many machine learning and optimization algorithms also require feature scaling for optimal performance, as we remember from the gradient descent example in Chapter 2, Training Machine Learning Algorithms for Classiication.
Here, we will standardize the features using the StandardScaler class from scikit-learn's preprocessing module: Note that we used the same scaling parameters to standardize the test set so that both the values in the training and test dataset are comparable to each other.
Having standardized the training data, we can now train a perceptron model. Most algorithms in scikit-learn already support multiclass classiication by default via the One-vs. The code is as follows: As we remember from Chapter 2, Training Machine Learning Algorithms for Classiication, inding an appropriate learning rate requires some experimentation.
If the learning rate is too large, the algorithm will overshoot the global cost minimum.
If the learning rate is too small, the algorithm requires more epochs until convergence, which can make the learning slow—especially for large datasets.
Having trained a model in scikit-learn, we can make predictions via the predict method, just like in our own perceptron implementation in Chapter 2, Training Machine Learning Algorithms for Classiication. Thus, the misclassiication error on the test dataset is 0. Instead of the misclassiication error, many machine learning practitioners report the classiication accuracy of a model, which is simply calculated as follows: Scikit-learn also implements a large variety of different performance metrics that are available via the metrics module.
For example, we can calculate the classiication accuracy of the perceptron on the test set as follows: Note that we evaluate the performance of our models based on the test set in this chapter. In Chapter 5, Compressing Data via Dimensionality Reduction, you will learn about useful techniques, including graphical analysis such as learning curves, to detect and prevent overitting.
Overitting means that the model captures the patterns in the training data well, but fails to generalize well to unseen data. However, let's add a small modiication to highlight the samples from the test dataset via small circles: We remember from our discussion in Chapter 2, Training Machine Learning Algorithms for Classiication, that the perceptron algorithm never converges on datasets that aren't perfectly linearly separable, which is why the use of the perceptron algorithm is typically not recommended in practice.
In the following sections, we will look at more powerful linear classiiers that converge to a cost minimum even if the classes are not perfectly linearly separable. The Perceptron as well as other scikit-learn functions and classes have additional parameters that we omit for clarity. You can read more about those parameters using the help function in Python for example, help Perceptron or by going through the excellent scikit-learn online documentation at http: The classiication task in the previous section would be an example of such a scenario.
Intuitively, we can think of the reason as the weights are continuously being updated since there is always at least one misclassiied sample present in each epoch. Of course, you can change the learning rate and increase the number of epochs, but be warned that the perceptron will never converge on this dataset. To make better use of our time, we will now take a look at another simple yet more powerful algorithm for linear and binary classiication problems: Note that, in spite of its name, logistic regression is a model for classiication, not regression.
Logistic regression intuition and conditional probabilities Logistic regression is a classiication model that is very easy to implement but performs very well on linearly separable classes.
It is one of the most widely used algorithms for classiication in industry. Similar to the perceptron and Adaline, the logistic regression model in this chapter is also a linear model for binary classiication that can be extended to multiclass classiication via the OvR technique.
To explain the idea behind logistic regression as a probabilistic model, let's irst introduce the odds ratio, which is the odds in favor of a particular event. We can then further deine the logit function, which is simply the logarithm of the odds ratio log-odds: Now what we are actually interested in is predicting the probability that a certain sample belongs to a particular class, which is the inverse form of the logit function. It is also called the logistic function, sometimes simply abbreviated as sigmoid function due to its characteristic S-shape.
Now let's simply plot the sigmoid function for some values in the range -7 to 7 to see what it looks like: To build some intuition for the logistic regression model, we can relate it to our previous Adaline implementation in Chapter 2, Training Machine Learning Algorithms for Classiication. In logistic regression, this activation function simply becomes the sigmoid function that we deined earlier, which is illustrated in the following igure: The predicted probability can then simply be converted into a binary outcome via a quantizer unit step function: Logistic regression is used in weather forecasting, for example, to not only predict if it will rain on a particular day but also to report the chance of rain.
Similarly, logistic regression can be used to predict the chance that a patient has a particular disease given certain symptoms, which is why logistic regression enjoys wide popularity in the ield of medicine. Learning the weights of the logistic cost function You learned how we could use the logistic regression model to predict probabilities and class labels. Now let's briely talk about the parameters of the model, for example, weights w. In the previous chapter, we deined the sum-squared-error cost function: To explain how we can derive the cost function for logistic regression, let's irst deine the likelihood L that we want to maximize when we build a logistic regression model, assuming that the individual samples in our dataset are independent of one another.
The formula is as follows: Secondly, we can convert the product of factors into a summation of factors, which makes it easier to obtain the derivative of this function via the addition trick, as you may remember from calculus.
Now we could use an optimization algorithm such as gradient ascent to maximize this log-likelihood function. Alternatively, let's rewrite the log-likelihood as a cost function J that can be minimized using gradient descent as in Chapter 2, Training Machine Learning Algorithms for Classiication: We can see that the cost approaches 0 plain blue line if we correctly predict that a sample belongs to class 1.
However, if the prediction is wrong, the cost goes towards ininity. The moral is that we penalize wrong predictions with an increasingly larger cost. However, since scikit-learn implements a highly optimized version of logistic regression that also supports multiclass settings off-the-shelf, we will skip the implementation and use the sklearn.
LogisticRegression class as well as the familiar fit method to train the model on the standardized lower training dataset: For example, we can predict the probabilities of the irst Iris-Setosa sample: We can show that the weight update in logistic regression via gradient descent is indeed equal to the equation that we used in Adaline in Chapter 2, Training Machine Learning Algorithms for Classiication. Let's start by calculating the partial derivative of the log-likelihood function with respect to the jth weight: Tackling overitting via regularization Overitting is a common problem in machine learning, where a model performs well on training data but does not generalize well to unseen data test data.
If a model suffers from overitting, we also say that the model has a high variance, which can be caused by having too many parameters that lead to a model that is too complex given the underlying data. Similarly, our model can also suffer from underitting high bias , which means that our model is not complex enough to capture the pattern in the training data well and therefore also suffers from low performance on unseen data.
Variance measures the consistency or variability of the model prediction for a particular sample instance if we would retrain the model multiple times, for example, on different subsets of the training dataset. We can say that the model is sensitive to the randomness in the training data.
In contrast, bias measures how far off the predictions are from the correct values in general if we rebuild the model multiple times on different training datasets; bias is the measure of the systematic error that is not due to randomness. One way of inding a good bias-variance tradeoff is to tune the complexity of the model via regularization. Regularization is a very useful method to handle collinearity high correlation among features , ilter out noise from data, and eventually prevent overitting.
The concept behind regularization is to introduce additional information bias to penalize extreme parameter weights.
The most common form of regularization is the so-called L2 regularization sometimes also called L2 shrinkage or weight decay , which can be written as follows: Regularization is another reason why feature scaling such as standardization is important.
For regularization to work properly, we need to ensure that all our features are on comparable scales. In order to apply regularization, we just need to add the regularization term to the cost function that we deined for logistic regression to shrink the weights: The parameter C that is implemented for the LogisticRegression class in scikit-learn comes from a convention in support vector machines, which will be the topic of the next section.
For the purposes of illustration, we only collected the weight coeficients of the class 2 vs. Remember that we are using the OvR technique for multiclass classiication. As we can see in the resulting plot, the weight coeficients shrink if we decrease the parameter C, that is, if we increase the regularization strength: Scott Menard's Logistic Regression: From Introductory to Advanced Concepts and Applications, Sage Publications, to readers who want to learn more about logistic regression.
Maximum margin classiication with support vector machines Another powerful and widely used learning algorithm is the support vector machine SVM , which can be considered as an extension of the perceptron.
Using the perceptron algorithm, we minimized misclassiication errors. However, in SVMs, our optimization objective is to maximize the margin. The margin is deined as the distance between the separating hyperplane decision boundary and the training samples that are closest to this hyperplane, which are the so-called support vectors.
This is illustrated in the following igure: To get an intuition for the margin maximization, let's take a closer look at those positive and negative hyperplanes that are parallel to the decision boundary, which can be expressed as follows: This can also be written more compactly as follows: It was introduced by Vladimir Vapnik in and led to the so-called soft-margin classiication.
Large values of C correspond to large error penalties whereas we are less strict about misclassiication errors if we choose smaller values for C. We can then we use the parameter C to control the width of the margin and therefore tune the bias-variance trade-off as illustrated in the following igure: This concept is related to regularization, which we discussed previously in the context of regularized regression where increasing the value of C increases the bias and lowers the variance of the model.
Logistic regression tries to maximize the conditional likelihoods of the training data, which makes it more prone to outliers than SVMs. The SVMs mostly care about the points that are closest to the decision boundary support vectors. On the other hand, logistic regression has the advantage that it is a simpler model that can be implemented more easily.
Furthermore, logistic regression models can be easily updated, which is attractive when working with streaming data. However, sometimes our datasets are too large to it into computer memory.
We could initialize the stochastic gradient descent version of the perceptron, logistic regression, and support vector machine with default parameters as follows: Before we discuss the main concept behind kernel SVM, let's irst deine and create a sample dataset to see how such a nonlinear classiication problem may look.
As shown in the next igure, we can transform a two-dimensional dataset onto a new three-dimensional feature space where the classes become separable via the following projection: However, one problem with this mapping approach is that the construction of the new features is computationally very expensive, especially if we are dealing with high-dimensional data.
This is where the so-called kernel trick comes into play. In order to save the expensive step of calculating T this dot product between two points explicitly, we deine a so-called kernel function: The minus sign inverts the distance measure into a similarity score and, due to the exponential term, the resulting similarity score will fall into a range between 1 for exactly similar samples and 0 for very dissimilar samples. Decision tree learning Decision tree classiiers are attractive models if we care about interpretability.
Like the name decision tree suggests, we can think of this model as breaking down our data by making decisions based on asking a series of questions. Work to do? Yes No Stay in Outlook? Yes No Stay in Go to movies Based on the features in our training set, the decision tree model learns a series of questions to infer the class labels of the samples. Although the preceding igure illustrated the concept of a decision tree based on categorical variables, the same concept applies if our features are real numbers like in the Iris dataset.
In an iterative process, we can then repeat this splitting procedure at each child node until the leaves are pure. This means that the samples at each node all belong to the same class. In practice, this can result in a very deep tree with many nodes, which can easily lead to overitting. Thus, we typically want to prune the tree by setting a limit for the maximal depth of the tree.
Here, our objective function is to maximize the information gain at each split, which we deine as follows: As we can see, the information gain is simply the difference between the impurity of the parent node and the sum of the child node impurities—the lower the impurity of the child nodes, the larger the information gain. However, for simplicity and to reduce the combinatorial search space, most libraries including scikit-learn implement binary decision trees.
This means that each parent node is split into two child nodes, Dleft and Dright: The entropy is therefore 0 if all samples at a node belong to the same class, and the entropy is maximal if we have a uniform class distribution.
Therefore, we can say that the entropy criterion attempts to maximize the mutual information in the tree. Intuitively, the Gini impurity can be understood as a criterion to minimize the probability of misclassiication: Another impurity measure is the classiication error: We can illustrate this by looking at the two possible splitting scenarios shown in the following igure: A B 40, 40 40, 40 30, 10 10, 30 20, 40 20, 0 We start with a dataset D p at the parent node D p that consists of 40 samples from class 1 and 40 samples from class 2 that we split into two datasets Dleft and Dright , respectively.
However, we have to be careful since the deeper the decision tree, the more complex the decision boundary becomes, which can easily result in overitting. Using scikit-learn, we will now train a decision tree with a maximum depth of 3 using entropy as a criterion for impurity.
Although feature scaling may be desired for visualization purposes, note that feature scaling is not a requirement for decision tree algorithms. This program is freely available at http: First, we create the. The further splits on the right are then used to separate the samples from the Iris-Versicolor and Iris-Virginica classes. Intuitively, a random forest can be considered as an ensemble of decision trees. The idea behind ensemble learning is to combine weak learners to build a more robust model, a strong learner, that has a better generalization error and is less susceptible to overitting.
The random forest algorithm can be summarized in four simple steps: Draw a random bootstrap sample of size n randomly choose n samples from the training set with replacement. Grow a decision tree from the bootstrap sample. At each node: Randomly select d features without replacement. Split the node using the feature that provides the best split according to the objective function, for instance, by maximizing the information gain.
Repeat the steps 1 to 2 k times. Aggregate the prediction by each tree to assign the class label by majority vote. There is a slight modiication in step 2 when we are training the individual decision trees: Although random forests don't offer the same level of interpretability as decision trees, a big advantage of random forests is that we don't have to worry so much about choosing good hyperparameter values.
We typically don't need to prune the random forest since the ensemble model is quite robust to noise from the individual decision trees. The only parameter that we really need to care about in practice is the number of trees k step 3 that we choose for the random forest. Typically, the larger the number of trees, the better the performance of the random forest classiier at the expense of an increased computational cost.
Via the sample size n of the bootstrap sample, we control the bias-variance tradeoff of the random forest.
By choosing a larger value for n, we decrease the randomness and thus the forest is more likely to overit. On the other hand, we can reduce the degree of overitting by choosing smaller values for n at the expense of the model performance.
In most implementations, including the RandomForestClassifier implementation in scikit-learn, the sample size of the bootstrap sample is chosen to be equal to the number of samples in the original training set, which usually provides a good bias-variance tradeoff. For the number of features d at each split, we want to choose a value that is smaller than the total number of features in the training set.
Conveniently, we don't have to construct the random forest classiier from individual decision trees by ourselves; there is already an implementation in scikit-learn that we can use: K-nearest neighbors — a lazy learning algorithm The last supervised learning algorithm that we want to discuss in this chapter is the k-nearest neighbor classiier KNN , which is particularly interesting because it is fundamentally different from the learning algorithms that we have discussed so far.
KNN is a typical example of a lazy learner. It is called lazy not because of its apparent simplicity, but because it doesn't learn a discriminative function from the training data but memorizes the training dataset instead.
Using parametric models, we estimate parameters from the training dataset to learn a function that can classify new data points without requiring the original training dataset anymore. Typical examples of parametric models are the perceptron, logistic regression, and the linear SVM. In contrast, nonparametric models can't be characterized by a ixed set of parameters, and the number of parameters grows with the training data. KNN belongs to a subcategory of nonparametric models that is described as instance-based learning.
Models based on instance-based learning are characterized by memorizing the training dataset, and lazy learning is a special case of instance-based learning that is associated with no zero cost during the learning process.
The KNN algorithm itself is fairly straightforward and can be summarized by the following steps: Choose the number of k and a distance metric. Find the k nearest neighbors of the sample that we want to classify. Assign the class label by majority vote. The following igure illustrates how a new data point? The class label of the new data point is then determined by a majority vote among its k nearest neighbors.
The main advantage of such a memory-based approach is that the classiier immediately adapts as we collect new training data. However, the downside is that the computational complexity for classifying new samples grows linearly with the number of samples in the training dataset in the worst-case scenario—unless the dataset has very few dimensions features and the algorithm has been implemented using eficient data structures such as KD-trees.
Friedman, J. Bentley, and R. An algorithm for inding best matches in logarithmic expected time. Furthermore, we can't discard training samples since no training step is involved. Thus, storage space can become a challenge if we are working with large datasets. By executing the following code, we will now implement a KNN model in scikit-learn using an Euclidean distance metric: If the neighbors have a similar distance, the algorithm will choose the class label that comes irst in the training dataset.
The right choice of k is crucial to ind a good balance between over- and underitting. We also have to make sure that we choose a distance metric that is appropriate for the features in the dataset.
Often, a simple Euclidean distance measure is used for real-valued samples, for example, the lowers in our Iris dataset, which have features measured in centimeters.
However, if we are using a Euclidean distance measure, it is also important to standardize the data so that each feature contributes equally to the distance. The 'minkowski' distance that we used in the previous code is just a generalization of the Euclidean and Manhattan distance that can be written as follows: Many other distance metrics are available in scikit-learn and can be provided to the metric parameter. They are listed at http: The curse of dimensionality It is important to mention that KNN is very susceptible to overitting due to the curse of dimensionality.
The curse of dimensionality describes the phenomenon where the feature space becomes increasingly sparse for an increasing number of dimensions of a ixed-size training dataset. Intuitively, we can think of even the closest neighbors being too far away in a high-dimensional space to give a good estimate. We have discussed the concept of regularization in the section about logistic regression as one way to avoid overitting. However, in models where regularization is not applicable such as decision trees and KNN, we can use feature selection and dimensionality reduction techniques to help us avoid the curse of dimensionality.
This will be discussed in more detail in the next chapter. Summary In this chapter, you learned about many different machine algorithms that are used to tackle linear and nonlinear problems. We have seen that decision trees are particularly attractive if we care about interpretability.
What is Machine Learning and how does it work? How can I use Machine Learning to take a glimpse into the unknown, power my business, or just find out what the Internet at large thinks about my favorite movie? All of this and more will be covered in the following chapters authored by my good friend and colleague, Sebastian Raschka. When away from taming my otherwise irascible pet dog, Sebastian has tirelessly devoted his free time to the open source Machine Learning community.
Over the past several years, Sebastian has developed dozens of popular tutorials that cover topics in Machine Learning and data visualization in Python.
He has also developed and contributed to several open source Python packages, several of which are now part of the core Python Machine Learning workflow. Owing to his vast expertise in this field, I am confident that Sebastian's insights into the world of Machine Learning in Python will be invaluable to users of all experience levels.
I wholeheartedly recommend this book to anyone looking to gain a broader and more practical understanding of Machine Learning. Randal S. He has been ranked as the number one most influential data scientist on GitHub by Analytics Vidhya. He has a yearlong experience in Python programming and he has conducted several seminars on the practical applications of data science and machine learning.
Talking and writing about data science, machine learning, and Python really motivated Sebastian to write this book in order to help people develop data-driven solutions without necessarily needing to have a machine learning background. He has also actively contributed to open source projects and methods that he implemented, which are now successfully used in machine learning competitions, such as Kaggle.
In his free time, he works on models for sports predictions, and if he is not in front of the computer, he enjoys playing sports.
I would like to thank my professors, Arun Ross and Pang-Ning Tan, and many others who inspired me and kindled my great interest in pattern classification, machine learning, and data mining.
Giving Computers the Ability to Learn from Data. Building intelligent machines to transform data into knowledge. Chapter 2: Artificial neurons — a brief glimpse into the early history of machine learning. Implementing a perceptron learning algorithm in Python. Adaptive linear neurons and the convergence of learning.
Chapter 3: Maximum margin classification with support vector machines. Chapter 4: Partitioning a dataset into separate training and test sets. Chapter 5: Compressing Data via Dimensionality Reduction. Unsupervised dimensionality reduction via principal component analysis. Supervised data compression via linear discriminant analysis. Using kernel principal component analysis for nonlinear mappings.
Chapter 6: Using k-fold cross-validation to assess model performance. Debugging algorithms with learning and validation curves.
Chapter 7: Combining Different Models for Ensemble Learning. Bagging — building an ensemble of classifiers from bootstrap samples. Chapter 8: Applying Machine Learning to Sentiment Analysis. Preparing the IMDb movie review data for text processing. Training a logistic regression model for document classification.
Working with bigger data — online algorithms and out-of-core learning. Chapter 9: Turning the movie review classifier into a web application. Chapter Implementing an ordinary least squares linear regression model. Evaluating the performance of linear regression models. Turning a linear regression model into a curve — polynomial regression.
Dealing with nonlinear relationships using random forests. Working with Unlabeled Data — Clustering Analysis. Modeling complex functions with artificial neural networks. A few last words about the neural network implementation.
Executing objects in a TensorFlow graph using their names. Implementing a deep convolutional neural network using TensorFlow. What You Will Learn Understand the key frameworks in data science, machine learning, and deep learning Harness the power of the latest Python open source libraries in machine learning Master machine learning techniques using challenging real-world data Master deep neural network implementation using the TensorFlow library Ask new questions of your data through machine learning models and neural networks Learn the mechanics of classification algorithms to implement the best tool for the job Predict continuous target outcomes using regression analysis Uncover hidden patterns and structures in data with clustering Delve deeper into textual and social media data using sentiment analysis.
Authors Sebastian Raschka. Vahid Mirjalili. Read More. Read More Reviews. Recommended for You. End-to-end Data Analysis.