Here I use stumpy.stumped to find the matrix profile

This is my time-series(Entire data)

 Entire_data= spark.sql('SELECT Closw from rk02_eurusd_candlestick_1_m_bid_01_01_2018_31_12_2018_csv where Closw is not null  order by Gmt_time').toPandas()
    ECG_data= Entire_data['Close']
    ECG_data_values=ECG_data.values
    print('The ecg data values are \n',ECG_data_values)
output:
The ecg data values are 
 [1.19985 1.19985 1.19985 ... 1.14627 1.14627 1.14627]

The time series have minutes data for the year 2018 I calculate matrix profile with 60 minute window for this data using Stumpy.stumped

    start = time.time()
    mp =stumpy.stumped(dask_client,ECG_data_values,60)

    end = time.time()
    print('mp is \n',mp)
    print('timetaken for stumpy \n', end - start)

Output:

mp is 
 [[0.05810642702033023 504378 -1 504378]
 [0.04393523046509543 345806 -1 345806]
 [0.07967330055954358 504378 -1 504378]
 ...
 [8.9131475674334 441593 441593 -1]
 [8.9131475674334 441594 441594 -1]
 [8.9131475674334 441595 441595 -1]]
timetaken for stumpy 
 2083.619256258011


    mparr = np.array(mp)
    print(mparr)
    mparr1 = ((mparr[:, 0], mparr[:, 1]))
    print(mparr1)

Output:
(array([0.05810642702033023, 0.04393523046509543, 0.07967330055954358, ...,
       8.9131475674334, 8.9131475674334, 8.9131475674334], dtype=object), array([504378, 345806, 504378, ..., 441593, 441594, 441595], dtype=object))

This is where I get problem, I'm trying find out 10 motifs

motifs ,motif_distance  = motifs.motifs(ECG_data_values,mparr1, max_motifs=10)
print('top motifs: \n',motifs)

We expect 10 motifs i.e, 10 lists but it returns only 4 Lists(motifs) is this correct? Have I done any mistake?

Output:
[[356, 342497], [8, 39, 410,.......525115, 525178, 525209, 525301, 525332, 525366, 525397], [201362, 332401], [9901, 40141, 120721, 161041, 382802, 413041, 463501, 503821, 516782]]

pls help me with this, Thanks in advance!

0

There are 0 best solutions below