Posts

Day 18 - Advanced Ensemble techniques - Stacking

Image
    By  Jerin Lalichan  Advanced Ensemble techniques Here are the advanced methods in Ensemble techniques: 1. Stacking      This technique uses prediction from different models (eg. Decision tree, SVM, KNN, etc.) to form a new model. This model is used for making predictions on the test set. The concept used here is that each model can learn different parts of the problem but not the whole problem.       So, you can build multiple different learners and you use them to build an intermediate prediction, one prediction for each learned model. Then you add a new model which learns from the intermediate predictions of the same target. Steps: We split the training data into K-folds like in cross-validation. A base model is fitted on the K-1 parts and predictions are made for Kth part. We do this for each part of the training data. The base model is then fitted on the whole train data set to calculate its performance on the test set....

Day 17 - Ensemble Techniques in ML - Averaging, Weighted average

   By  Jerin Lalichan  Ensemble Techniques in ML      Ensemble methods is a machine learning technique that combines several base models in order to produce one optimal predictive model.      Ensemble methods include building multiple models and combining them to achieve better outcomes. To put it another way, they integrate the conclusions drawn from various models to enhance overall performance. Generally speaking, ensemble methods produce more accurate results than a single model would.     F or example, let's consider the case in which you need to decide if you should go to a particular movie or not. You can infer that a diverse group of people are likely to make better decisions as compared to individuals. So it's best to check online reviews since it is an aggregation of reviews of hundreds of people from different backgrounds when compared to asking a few of your friends.            Sim...

Day 16 - Ensemble Techniques in ML - Max Voting

  By  Jerin Lalichan  Ensemble Techniques in ML      Ensemble methods is a machine learning technique that combines several base models in order to produce one optimal predictive model.      Ensemble methods include building multiple models and combining them to achieve better outcomes. To put it another way, they integrate the conclusions drawn from various models to enhance overall performance. Generally speaking, ensemble methods produce more accurate results than a single model would.     F or example, let's consider the case in which you need to decide if you should go to a particular movie or not. You can infer that a diverse group of people are likely to make better decisions as compared to individuals. So it's best to check online reviews since it is an aggregation of reviews of hundreds of people from different backgrounds when compared to asking a few of your friends.            Similar i...

Day 15 - Cross Validation

Image
By  Jerin Lalichan  Cross Validation      Cross-validation is a technique for assessing how the statistical analysis generalizes to an independent data set. It is a technique for evaluating machine learning models by training several models on subsets of the available input data and evaluating them on the complementary subset of the data. We can detect overfitting easily with this technique. Different types of cross-validation techniques are:-      1. K-Fold Cross Validation      2. Leave P-out Cross Validation      3. Leave One-out Cross Validation      4. Repeated Random Sub-sampling Method      5. Holdout Method Among these K-Fold cross-validation is most commonly used. Why do we need cross-validation?     We usually split the dataset into training and testing datasets. But the accuracy and metrics are highly biased on certain factors like how the split is done, depending on ...

Day 14 - Overfitting and underfitting

Image
  By  Jerin Lalichan  Overfitting and Underfitting The degree of fitting of data points in a model directly correlates to whether it will give accurate predictions or not. Overfitting        In supervised learning, overfitting happens when our model captures the noise along with the underlying pattern in data. It happens when we train our model a lot over the noisy datasets. These models have low bias and high variance. These models are very complex like Decision trees which are prone to overfitting.    This occurs when dealing with highly complex models where the model will match almost all the given data points of the training dataset and perform well in training datasets. However, the model would not be able to generalize the data point in the test data set to predict the outcome accurately. Underfitting      In supervised learning, underfitting happens when a model is unable to capture the underlying pattern of the data. Th...

Day 13 - Bias and Variance

By  Jerin Lalichan  Bias and Variance in Machine Learning     With larger datasets, various  algorithms, implementation techniques, and learning requirements, it has become very complex to create and analyze machine learning models since all those factors directly affect the model's performance and accuracy.     This is further skewed by incorrect assumptions, outliers, and noises. So it is very important to understand prediction errors (Bias and Variance). Gaining proper knowledge about these will aid us to build accurate models with better performance, without overfitting or underfitting. Bias      It is the phenomenon that skews the output of a model in favor or against the idea. It is considered as a systematic error within the model, due to incorrect assumptions in the ML process. A model  with high bias pays very little attention to the training data and oversimplifies the model     In other words, Bias is the error ...

Day 12 - How to find the best K value in K-Means Algorithm - Elbow Curve

Image
            By  Jerin Lalichan  How to do it? Clustering algorithms like K-Means need the user to input the number of clusters to be formed. For this, we need to find the optimum number of clusters to be generated. A commonly used method is using the Elbow Curve. Elbow Curve / Knee Curve      K means works in a way to reduce the Within-cluster sum of squares (WCSS) is minimized. In this method, we vary the value of K from 1 to 10.       For each value of K, the WCSS is calculated. WCSS is nothing but the sum of squares of the distance between each value and their corresponding cluster centroid.       We start with K=1, and the highest value for WCSS  is observed for K=1. When the K goes higher, WCSS decreases. And from the above graph, we can see that WCSS shows a rapid change at a certain point (here K=5), and the line gets parallel to the X axis. And this point is called the Elbow ...