22 lines
430 B
Python
22 lines
430 B
Python
from service.api.generate import generate_sine_series
|
|
|
|
import matplotlib.pylab as plt
|
|
import warnings
|
|
warnings.filterwarnings('ignore')
|
|
|
|
df = generate_sine_series(length=500, frequency=50, amplitude=100)
|
|
plt.plot(df)
|
|
|
|
data = df.values
|
|
|
|
|
|
from pyFTS.partitioners import CMeans
|
|
|
|
fs = CMeans.CMeansPartitioner(data=data,npart=10)
|
|
|
|
fig, ax = plt.subplots(nrows=1, ncols=1, figsize=[15,5])
|
|
|
|
fs.plot(ax)
|
|
|
|
|
|
plt.show() |