smoothing

Laplace correction with conditions for smoothing

Laplace correction with conditions for smoothing Question: I have a data (user_data) that represent the number of examples in each class (here we have 5 classes), for example in first row, 16 represent 16 samples in class 1 for user1, 15 represent that there is 15 samples belong to class 2 for user 1, ect. …

Total answers: 2

'Oversampling' cartesian data in a dataframe without for loop?

'Oversampling' cartesian data in a dataframe without for loop? Question: I have a 3D data in a pandas dataframe that I would like to ‘oversample’/smooth by replacing the value at each x,y point with the average value of all the points that are within 5 units of that point. I can do it using a …

Total answers: 2

NumPy version of "Exponential weighted moving average", equivalent to pandas.ewm().mean()

NumPy version of "Exponential weighted moving average", equivalent to pandas.ewm().mean() Question: How do I get the exponential weighted moving average in NumPy just like the following in pandas? import pandas as pd import pandas_datareader as pdr from datetime import datetime # Declare variables ibm = pdr.get_data_yahoo(symbols=’IBM’, start=datetime(2000, 1, 1), end=datetime(2012, 1, 1)).reset_index(drop=True)[‘Adj Close’] windowSize = …

Total answers: 15

Reducing noise on Data

Reducing noise on Data Question: I have 2 lists with data points in them. x = [“bunch of data points”] y = [“bunch of data points”] I’ve generated a graph using matplotlib in python import matplotlib.pyplot as plt plt.plot(x, y, linewidth=2, linestyle=”-“, c=”b”) plt.show() plt.close() Would I be able to reduce the noise on the …

Total answers: 4

Confidence interval for LOWESS in Python

Confidence interval for LOWESS in Python Question: How would I calculate the confidence intervals for a LOWESS regression in Python? I would like to add these as a shaded region to the LOESS plot created with the following code (other packages than statsmodels are fine as well). import numpy as np import pylab as plt …

Total answers: 3

kalman 2d filter in python

kalman 2d filter in python Question: My input is 2d (x,y) time series of a dot moving on a screen for a tracker software. It has some noise I want to remove using Kalman filter. Does someone can point me for a python code for Kalman 2d filter? In scipy cookbook I found only a …

Total answers: 2

Plot smooth line with PyPlot

Plot smooth line with PyPlot Question: I’ve got the following simple script that plots a graph: import matplotlib.pyplot as plt import numpy as np T = np.array([6, 7, 8, 9, 10, 11, 12]) power = np.array([1.53E+03, 5.92E+02, 2.04E+02, 7.24E+01, 2.72E+01, 1.10E+01, 4.70E+00]) plt.plot(T,power) plt.show() As it is now, the line goes straight from point to …

Total answers: 8