What are Linear time MMD and Quadratic time MMD in Shogun

In this recipe, we shall learn what are Linear time MMD and Quadratic time MMD in Shogun with the help of simple examples.

Recipe Objective: What are Linear time MMD and Quadratic time MMD in Shogun?

This recipe explains what Linear time MMD and Quadratic time MMD in Shogun are.
For more related projects-
Project 1
Project 2

Learn About the Application of ARCH and GARCH models in Real-World

Linear Time MMD

The linear time MMD implements a nonparametric statistical hypothesis test to reject the null hypothesis that to distributions p and q, only observed via n samples are the same.

# Linear Time MMD
MMD = LinearTimeMMD()
w = 1000
k = GaussianKernel(10, 1)
MMD.set_kernel(k)
MMD.set_p(p)
MMD.set_q(q)
MMD.set_num_samples_p(w)
MMD.set_num_samples_q(w)
a = 0.05

Quadratic Time MMD

The quadratic time MMD implements a nonparametric statistical hypothesis test to reject the null hypothesis that distributions p and q, only observed via n and m samples, respectively, are the same.

# Quadratic Time MMD
p = RealFeatures(f_p)
q = RealFeatures(f_q)

MMD = QuadraticTimeMMD(p, q)
k = GaussianKernel(10, 1)
MMD.set_kernel(k)

MMD.set_statistic_type(ST_BIASED_FULL)
stats = MMD.compute_statistic()

MMD.set_null_approximation_method(NAM_PERMUTATION)
MMD.set_num_null_samples(200)
val = MMD.compute_p_value(stats)

What Users are saying..

profile image

Abhinav Agarwal

Graduate Student at Northwestern University
linkedin profile url

I come from Northwestern University, which is ranked 9th in the US. Although the high-quality academics at school taught me all the basics I needed, obtaining practical experience was a challenge.... Read More

Relevant Projects

Avocado Machine Learning Project Python for Price Prediction
In this ML Project, you will use the Avocado dataset to build a machine learning model to predict the average price of avocado which is continuous in nature based on region and varieties of avocado.

End-to-End ML Model Monitoring using Airflow and Docker
In this MLOps Project, you will learn to build an end to end pipeline to monitor any changes in the predictive power of model or degradation of data.

Hands-On Approach to Master PyTorch Tensors with Examples
In this deep learning project, you will learn how to perform various operations on the building block of PyTorch : Tensors.

Time Series Classification Project for Elevator Failure Prediction
In this Time Series Project, you will predict the failure of elevators using IoT sensor data as a time series classification machine learning problem.

ML Model Deployment on AWS for Customer Churn Prediction
MLOps Project-Deploy Machine Learning Model to Production Python on AWS for Customer Churn Prediction

Classification Projects on Machine Learning for Beginners - 1
Classification ML Project for Beginners - A Hands-On Approach to Implementing Different Types of Classification Algorithms in Machine Learning for Predictive Modelling

Expedia Hotel Recommendations Data Science Project
In this data science project, you will contextualize customer data and predict the likelihood a customer will stay at 100 different hotel groups.

Build an Image Segmentation Model using Amazon SageMaker
In this Machine Learning Project, you will learn to implement the UNet Architecture and build an Image Segmentation Model using Amazon SageMaker

Linear Regression Model Project in Python for Beginners Part 2
Machine Learning Linear Regression Project for Beginners in Python to Build a Multiple Linear Regression Model on Soccer Player Dataset.

OpenCV Project for Beginners to Learn Computer Vision Basics
In this OpenCV project, you will learn computer vision basics and the fundamentals of OpenCV library using Python.