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

Build a Speech-Text Transcriptor with Nvidia Quartznet Model
In this Deep Learning Project, you will leverage transfer learning from Nvidia QuartzNet pre-trained models to develop a speech-to-text transcriptor.

Customer Market Basket Analysis using Apriori and Fpgrowth algorithms
In this data science project, you will learn how to perform market basket analysis with the application of Apriori and FP growth algorithms based on the concept of association rule learning.

Build a Text Generator Model using Amazon SageMaker
In this Deep Learning Project, you will train a Text Generator Model on Amazon Reviews Dataset using LSTM Algorithm in PyTorch and deploy it on Amazon SageMaker.

PyTorch Project to Build a LSTM Text Classification Model
In this PyTorch Project you will learn how to build an LSTM Text Classification model for Classifying the Reviews of an App .

Build Real Estate Price Prediction Model with NLP and FastAPI
In this Real Estate Price Prediction Project, you will learn to build a real estate price prediction machine learning model and deploy it on Heroku using FastAPI Framework.

Learn Object Tracking (SOT, MOT) using OpenCV and Python
Get Started with Object Tracking using OpenCV and Python - Learn to implement Multiple Instance Learning Tracker (MIL) algorithm, Generic Object Tracking Using Regression Networks Tracker (GOTURN) algorithm, Kernelized Correlation Filters Tracker (KCF) algorithm, Tracking, Learning, Detection Tracker (TLD) algorithm for single and multiple object tracking from various video clips.

Recommender System Machine Learning Project for Beginners-1
Recommender System Machine Learning Project for Beginners - Learn how to design, implement and train a rule-based recommender system in Python

Digit Recognition using CNN for MNIST Dataset in Python
In this deep learning project, you will build a convolutional neural network using MNIST dataset for handwritten digit recognition.

Build ARCH and GARCH Models in Time Series using Python
In this Project we will build an ARCH and a GARCH model using Python

A/B Testing Approach for Comparing Performance of ML Models
The objective of this project is to compare the performance of BERT and DistilBERT models for building an efficient Question and Answering system. Using A/B testing approach, we explore the effectiveness and efficiency of both models and determine which one is better suited for Q&A tasks.