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 
 

Forecasting Time Series Data with FbProphet in Python

    FbProphet, an open source software released by Facebook, provides a procedure for forecasting time series data based on an additive model. In this tutorial, I'll briefly explain how to forecast time series data by using FbProphet API in Python.

    The tutorial covers:

  1. Preparing time series data
  2. Defining the model and forecasting
  3. Performance evaluation
  4. Source code listing

    Let's start by loading the required packages for this tutorial.

 
import yfinance as yf
import pandas as pd

from fbprophet import Prophet
from fbprophet import plot
from fbprophet.diagnostics import cross_validation, performance_metrics
  
 

Smoothing Example with Savitzky-Golay Filter in Python

     Savitzky-Golay filter is used in signal processing to eliminate noise in a signal and improve the smoothness of a signal trend. The filter calculates a polynomial fit of each window based on polynomial degree and window size. 

    SciPy API provides the savgol_filter() function to implement Savitzky-Golay filter in Python. In this tutorial, we'll briefly learn how to smooth the signal data by using savgol_filter() function in Python. 

    The tutorial covers:

  1. Preparing signal data
  2. Smoothing with Savitzky-Golay filter
  3. Source code listing

    We'll start by loading the required libraries.

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

LightGBM Multi-class Classification Example in R

     Muti-class or multinomial classification is type of classification that involves predicting the instance out of three or more available classes. 

    LightGBM is an open-source gradient boosting framework that based on tree learning algorithm and designed to process data faster and provide better accuracy. LightGBM can be used for regression, classification, ranking and other machine learning tasks.  

    In this tutorial, we'll briefly learn how to classify multi-class data by using LightGBM in R. The tutorial covers:

  1. Preparing the data
  2. Fitting the model and prediction
  3. Accuracy checking
  4. Source code listing
    We'll start by installing R interface package of LightGBM API and loading the required packages.

 
install.packages("lightgbm")

library(caret)
library(lightgbm)