CoderzColumn : Machine Learning Tutorials (Page: 2)

Machine Learning Tutorials


The term 'machine learning' (ML) describes a system's capacity to gather and synthesize knowledge through extensive observation, as well as to develop and extend itself by picking up new information rather than having it preprogrammed into it. At CoderzColumn, you get a glimpse of the vast Machine Learning Field. We cover various concepts through tutorials. The concepts are:

  • Visualize ML Metrics
  • Gradient Boosted Decision Trees
  • Interpret Predictions Of ML Models
  • Hyperparameters Tuning / Optimization

For an in-depth understanding of the above concepts, check out the sections below.

Recent Machine Learning Tutorials


Tags lime, interpret-ml-models
How to Use LIME to Interpret Predictions of ML Models [Python]?
Machine Learning

How to Use LIME to Interpret Predictions of ML Models [Python]?

A detailed guide on how to use Python library lime (implements LIME algorithm) to interpret predictions made by Machine Learning (scikit-learn) models. LIME is commonly used to explain black-box as well as white-box ML models. We have explained usage for structured (tabular) as well as unstructured (image & text) data and classification as well as regression problems.

Sunny Solanki  Sunny Solanki
Tags shap, interpret-ml-models
SHAP Values - Interpret Machine Learning Model Predictions using Game Theoretic Approach [Python]
Machine Learning

SHAP Values - Interpret Machine Learning Model Predictions using Game Theoretic Approach [Python]

A detailed guide to use Python library SHAP to generate Shapley values (shap values) that can be used to interpret/explain predictions made by our ML models. Tutorial creates various charts using shap values interpreting predictions made by classification and regression models trained on structured data.

Sunny Solanki  Sunny Solanki
Tags bayesian-optimization, hyperparameters-tuning
bayes_opt: Bayesian Optimization for Hyperparameters Tuning
Machine Learning

bayes_opt: Bayesian Optimization for Hyperparameters Tuning

bayes_opt: Bayesian Optimization for Hyperparameters Tuning

Sunny Solanki  Sunny Solanki
Tags scikit-optimize, hyperparameters-optimization
Scikit-Optimize: Simple Guide to Hyperparameters Tuning / Optimization
Machine Learning

Scikit-Optimize: Simple Guide to Hyperparameters Tuning / Optimization

Scikit-Optimize: Simple Guide to Hyperparameters Optimization/Tunning

Sunny Solanki  Sunny Solanki
Tags interpret-text, nlp, interpret-ml-models
interpret-text - Interpret NLP Models and Their Predictions [Python]
Machine Learning

interpret-text - Interpret NLP Models and Their Predictions [Python]

interpret-text - Interpret NLP Models and Their Predictions [Python]

Sunny Solanki  Sunny Solanki
Tags dice-ml, interpret-ml-models
dice-ml - Diverse Counterfactual Explanations for ML Models [Python]
Machine Learning

dice-ml - Diverse Counterfactual Explanations for ML Models [Python]

dice-ml - Diverse Counterfactual Explanations for ML Models [Python]

Sunny Solanki  Sunny Solanki
Tags interpret-ml, interpret-predictions
interpret-ml - Explain Machine Learning Models And Their Predictions [Python]
Machine Learning

interpret-ml - Explain Machine Learning Models And Their Predictions [Python]

interpret-ml - Explain Machine Learning Models And Their Predictions [Python]

Sunny Solanki  Sunny Solanki
Tags yellobrick, ml-metrics, visualization, text-data
Yellowbrick - Text Data Visualizations [Python]
Machine Learning

Yellowbrick - Text Data Visualizations [Python]

Yellowbrick - Text Data Visualizations [Python]

Sunny Solanki  Sunny Solanki
Tags treeinterpreter, tree-models
Treeinterpreter - Interpreting Tree-Based Model's Prediction of Individual Sample [Python]
Machine Learning

Treeinterpreter - Interpreting Tree-Based Model's Prediction of Individual Sample [Python]

Treeinterpreter - Interpreting Tree-Based Model's Prediction of Individual Sample [Python]

Sunny Solanki  Sunny Solanki
Tags yellobrick, ml-metrics, visualization
Yellowbrick - Visualize Sklearn's Classification & Regression Metrics in Python
Machine Learning

Yellowbrick - Visualize Sklearn's Classification & Regression Metrics in Python

Yellowbrick - Visualize Sklearn's Classification & Regression Metrics in Python

Sunny Solanki  Sunny Solanki
Visualize Machine Learning Metrics

Visualize Machine Learning Metrics


Once our Machine Learning model is trained, we need some way to evaluate its performance. We need to know whether our model has generalized or not.

For this, various metrics (confusion matrix, ROC AUC curve, precision-recall curve, silhouette Analysis, elbow method, etc) are designed over time. These metrics help us understand the performance of our models trained on various tasks like classification, regression, clustering, etc.

Python has various libraries (scikit-learn, scikit-plot, yellowbrick, interpret-ml, interpret-text, etc) to calculate and visualize these metrics.

Interpret Predictions Of ML Models

Interpret Predictions Of ML Models


After training ML Model, we generally evaluate the performance of model by calculating and visualizing various ML Metrics (confusion matrix, ROC AUC curve, precision-recall curve, silhouette Analysis, elbow method, etc).

These metrics are normally a good starting point. But in many situations, they don’t give a 100% picture of model performance. E.g., A simple cat vs dog image classifier can be using background pixels to classify images instead of actual object (cat or dog) pixels.

In these situations, our ML metrics will give good results. But we should always be a little skeptical of model performance.

We can dive further deep and try to understand how our model is performing on an individual example by interpreting results. Various algorithms have been developed over time to interpret predictions of ML models and many Python libraries (lime, eli5, treeinterpreter, shap, etc) provide their implementation.

Hyperparameters Tuning / Optimization

Hyperparameters Tuning / Optimization


Machine Learning models generally have many parameters that need to be tuned to get the best performing model. E.g., a decision tree has parameters like tree depth, min samples per leaf, maximum leaf nodes, criteria to evaluate split, etc whose different values can be tried to get the best-performing decision tree model.

These parameters of ML models are generally referred to as Hyperparameters. Over the years, various approaches have been developed to get best performing Hyperparameters for ML Model. The process of finding best performing Hyperparameters is referred to as Hyperparameters tuning or Hyperparameters Optimization.

Python has many libraries (optuna, hyperopt, scikit-optimize, scikit-learn, etc) that let us perform Hyperparameters tuning to find best settings for our model.

Gradient Boosting

Gradient Boosting


Gradient boosting is a machine learning algorithm based on an ensemble of estimators and is used for regression and classification tasks. The ensemble consists of list of weak predictors / estimators whose predictions are combined to make final model predictions.

Majority of the time, these weak predictors are decision trees, and an algorithm is referred to as gradient-boosted trees or gradient-boosted decision trees. They are best suited for structured tabular datasets.

Python has many libraries (XGBoost, CatBoost, LightGBM, scikit-learn, etc) that provide an implementation of gradient boosting. Apart from implementation, these libraries provide many extra features like parallelization, GPU training, distributed training, command line training / evaluation, higher accuracy, etc.