Category Python

Machine Learning – K-means

K-means K-means is an unsupervised learning method for clustering data points. The algorithm iteratively divides data points into K clusters by minimizing the variance in each cluster. Here, we will show you how to estimate the best value for K…

Preprocessing – Categorical Data

Categorical Data When your data has categories represented by strings, it will be difficult to use them to train machine learning models which often only accepts numeric data. Instead of ignoring the categorical data and excluding the information from our…

Machine Learning – Grid Search

Grid Search The majority of machine learning models contain parameters that can be adjusted to vary how the model learns. For example, the logistic regression model, from sklearn, has a parameter C that controls regularization,which affects the complexity of the…

Machine Learning – Logistic Regression

Logistic Regression Logistic regression aims to solve classification problems. It does this by predicting categorical outcomes, unlike linear regression that predicts a continuous outcome. In the simplest case there are two outcomes, which is called binomial, an example of which…

Machine Learning – Hierarchical Clustering

Hierarchical Clustering Hierarchical clustering is an unsupervised learning method for clustering data points. The algorithm builds clusters by measuring the dissimilarities between data. Unsupervised learning means that a model does not have to be trained, and we do not need…

Machine Learning – Confusion Matrix

What is a confusion matrix? It is a table that is used in classification problems to assess where errors in the model were made. The rows represent the actual classes the outcomes should have been. While the columns represent the…

Machine Learning – Decision Tree

Decision Tree In this chapter we will show you how to make a “Decision Tree”. A Decision Tree is a Flow Chart, and can help you make decisions based on previous experience. In the example, a person will try to…

Machine Learning – Train/Test

Evaluate Your Model In Machine Learning we create models to predict the outcome of certain events, like in the previous chapter where we predicted the CO2 emission of a car when we knew the weight and engine size. To measure…

Machine Learning – Scale

Scale Features When your data has different values, and even different measurement units, it can be difficult to compare them. What is kilograms compared to meters? Or altitude compared to time? The answer to this problem is scaling. We can…