Skip to content

fredcommo/kernel_smoother

Repository files navigation

To perform kernel smoothing

Test & Build coverage python version Linux Windows

Install

Either clone the repo, or install from git as follows:

python -m pip install git+https://github.com/fredcommo/kernel_smoother.git

Quick example:

import numpy as np
import matplotlib.pyplot as plt
from kernel_smoother.smoother import kern_smooth

x = np.linspace(0, 10, num=200)
noise = np.random.normal(loc=0, scale=0.25, size=len(x))
y = np.sin(x) + noise

plt.scatter(x, y, s=10, c='grey')

kernels = ["gaussian", "triangular", "Epanechnikov"]
for k in kernels:
    plt.plot(x, kern_smooth(x, y, K=k), linewidth=3)
plt.xlabel('x')
plt.ylabel('y')
plt.legend(kernels, title="Kernels")
plt.show()

illustrations

Other examples:

illustrations

About

To perform kernel-based smoothing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •