Posts

Showing posts from November, 2021

Bagging in Machine Learning

 What Is Ensemble Learning? * Machine Learning uses several techniques to build models and improve their performance. * Ensemble learning methods help improve the accuracy of classification and regression models. * Ensemble learning is a widely-used and preferred machine learning technique in which multiple individual models,    often called base models, are combined to produce an effective optimal prediction model. * The Random Forest algorithm is an example of ensemble learning. What Is Bagging in Machine Learning? * Bagging, also known as Bootstrap aggregating, is an ensemble learning technique that helps to improve the performance and  accuracy of machine learning algorithms. * It is used to deal with bias-variance trade-offs and reduces the variance of a prediction model.  * Bagging avoids overfitting of data and is used for both regression and classification models, specifically for decision tree algorithms.' What Is Bootstrapping? * Bootstrapping is the m...

Random Forest intution in Machine Learning

What is a random forest? * A random forest is a machine learning technique that’s used to solve regression and classification problems.  * It utilizes ensemble learning, which is a technique that combines many classifiers to provide solutions to complex problems. * A random forest algorithm consists of many decision trees. The ‘forest’ generated by the random forest algorithm is trained through bagging or bootstrap aggregating. * Bagging is an ensemble meta-algorithm that improves the accuracy of machine learning algorithms. * The (random forest) algorithm establishes the outcome based on the predictions of the decision trees.  * It predicts by taking the average or mean of the output from various trees. * Increasing the number of trees increases the precision of the outcome. *A random forest eradicates the limitations of a decision tree algorithm.  * It reduces the overfitting of datasets and increases precision.  * It generates predictions without requiring many co...

K Nearest Neighbors (KNN) intution

  K Nearest Neighbor (KNN) In k-NN regression, the output is the property value for the object. This value is the average of the values of k nearest neighbors. What is KNN? Machine learning models use a set of input values to predict output values. KNN is one of the simplest forms of machine learning algorithms mostly used for classification. It classifies the data point on how its neighbor is classified Introduction: K Nearest Neighbor algorithm falls under the Supervised Learning category and is used for classification (most commonly) and regression.  It is a versatile algorithm also used for imputing missing values and resampling datasets. As the name (K Nearest Neighbor) suggests it considers K Nearest Neighbors (Data points) to predict the class or continuous value for the new Datapoint. How to choose the value for K?¶ Using error curves: The figure below shows error curves for different values of K for training and test data. At low K values, there is overfitting of data...

Confusion Matrix using scikit-learn in Python

Understanding True Positive, True Negative, False Positive and False Negative in a Confusion Matrix True Positive (TP)  The predicted value matches the actual value The actual value was positive and the model predicted a positive value True Negative (TN)  The predicted value matches the actual value The actual value was negative and the model predicted a negative value False Positive (FP) – Type 1 error The predicted value was falsely predicted The actual value was negative but the model predicted a positive value Also known as the  Type 1 error False Negative (FN) – Type 2 error The predicted value was falsely predicted The actual value was positive but the model predicted a negative value Also known as the  Type 2 error GITHUB Link