Image Blurring Example with OpenCV in Python

    Image blur refers to the effect of making an image less sharp and more difficult to distinguish the details. Although blurring is typically a negative effect in photographs, it is useful method in image processing tasks. Image blur is used in image processing for a variety of reasons, such as image smoothing, edge detection, obscuring sensitive information, and preprocessing steps. 

    Image blur is achieved by convolving the image with a specific kernel or filter. A kernel is a small matrix that is applied to each pixel in the image. The value of each pixel in the output image is calculated by multiplying the corresponding values in the kernel with the values of the pixels in the neighborhood of the current pixel, and then summing the results.

    In this tutorial, you'll briefly learn how to blur image with OpenCV API in Python.   

    The tutorial covers;

  1. Gaussian blur
  2. Median blur
  3. Bilateral filter method
  4. Averaging method
  5. Source code listing

    We'll start by loading the required libraries.


import cv2
import matplotlib.pyplot as plt 
 
 

Univariate Interpolation Examples in Python (part-2)

    In this tutorial, you'll briefly learn how to use SciPy API's BarycentricInterpolator and KroghInterpolator classes in Python.  

    Interpolation is a method of estimating unknown data points in a known range to make the curve smoother. Univariate interpolation is a type of curve fitting that seeks the curve that best fits a set of two-dimensional data points. Since the data points are sampled from a single variable function, it is called univariate interpolation.  

    The tutorial covers;

  1. Preparing test data
  2. BarycentricInterpolator  method
  3. KroghInterpolator method
  4. Source code listing

    We'll start by loading the required libraries.

 
from scipy import interpolate
import matplotlib.pyplot as plt
import numpy as np 
 
 

Univariate Interpolation Examples in Python (part-1)

     Interpolation is a method of estimating unknown data points in a known range to make the curve smoother. Univariate interpolation is a type of curve fitting that seeks the curve that best fits a set of two-dimensional data points. Since the data points are sampled from a single variable function, it is called univariate interpolation.

     SciPy API provides several functions to implement the interpolation method for a given data. In this tutorial, you'll learn how to apply interpolation for a given data by using interp1d, CubicSpline, PchipInterpolator, and Akima1DInterplator methods in Python. The tutorial covers;

  1. Preparing test data
  2. interp1d  method
  3. CubicSpline method
  4. PchipInterpolator  method
  5. Akima1DInterpolator method
  6. Source code listing

    We'll start by loading the required libraries.

 
from scipy import interpolate
import matplotlib.pyplot as plt
import numpy as np 
 
 

Feature Selection Example with RFECV in Python

      RFECV (Recursive Feature Elimination with Cross-Validation) performs recursive feature elimination with cross-validation loop to extract the optimal features. Scikit-learn provides RFECV class to implement RFECV method to find the most important features in a given dataset.

    Selecting optimal features is important part of data preparation in machine learning. It helps us to eliminate less important part of the data and reduce a training time in large datasets.

    In this tutorial, we'll briefly learn how to select best features of classification and regression data by using the RFECV in Python. The tutorial covers:
  1. RFECV for classification data
  2. RFECV for regression data
  3. Source code listing
   We'll start by loading the required libraries and functions.

Dual Annealing Optimization Example in Python

     Dual annealing is a stochastic global optimization algorithm based on combined Classical Simulated Annealing and Fast Simulated Annealing algorithms. Simulated annealing is an optimization algorithm for approximating the global optima of a given function.

    SciPy provides dual_annealing() function to implement dual annealing method in Python. In this tutorial, we'll briefly learn how to implement and solve optimization problem with dual annealing by using this SciPy function.

    The tutorial covers:

  1. Dual annealing with 2D function
  2. Dual annealing with 3D function
  3. Source code listing

 We'll start by loading the required libraries.


from scipy.optimize import dual_annealing
import matplotlib.pyplot as plt
import numpy as np
 

Clustering Example with Gaussian Mixture in Python

   The Gaussian Mixture is a probabilistic model to represent a mixture of multiple Gaussian distributions on population data. The model is widely used in clustering problems. The Scikit-learn API provides the GaussianMixture class to implement Gaussian Mixture model. 

    In this tutorial, you'll briefly learn how to cluster data by using Scikit Gaussian Mixture class in Python. The tutorial covers:

  1. Preparing data.
  2. Clustering with Gaussian Mixture
  3. Source code listing
We'll start by loading the required modules.


from sklearn.mixture import GaussianMixture
from sklearn.datasets.samples_generator import make_blobs
import matplotlib.pyplot as plt
from numpy import random 
from pandas import DataFrame