def smooth(self, smoothing_factor):
forward_smooth = {}<EOL>backward_smooth = {}<EOL>output = {}<EOL>if self:<EOL><INDENT>pre = self.values[<NUM_LIT:0>]<EOL>next = self.values[-<NUM_LIT:1>]<EOL>for key, value in self.items():<EOL><INDENT>forward_smooth[key] = smoothing_factor * pre + (<NUM_LIT:1> - smoothing_factor) * value<EOL>pre = forward_smooth[key]<EOL><DEDENT>for key, value in reversed(self.items()):<EOL><INDENT>backward_smooth[key] = smoothing_factor * next + (<NUM_LIT:1> - smoothing_factor) * value<EOL>next = backward_smooth[key]<EOL><DEDENT>for key in forward_smooth.keys():<EOL><INDENT>output[key] = (forward_smooth[key] + backward_smooth[key]) / <NUM_LIT:2><EOL><DEDENT><DEDENT>return TimeSeries(output)<EOL>
return a new time series which is a exponential smoothed version of the original data series.
soomth forward once, backward once, and then take the average.

:param float smoothing_factor: smoothing factor
:return: :class:`TimeSeries` object.