A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/signals-dev/Orion/issues/276 below:

Fix tutorial testing issue · Issue #276 · sintel-dev/Orion · GitHub

Description

When executing the tutorial, we sometimes run into this issue

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-1-77114f63db44> in <module>
      9     j = i
     10     start = index[i]
---> 11     while error[i] > thresh:
     12         i += 1
     13 

IndexError: index 10321 is out of bounds for axis 0 with size 10321
IndexError: index 10321 is out of bounds for axis 0 with size 10321
Fix proposal

Change error calculation code to not exceed the size of the array

# threshold
thresh = 10

intervals = list()

i = 0
max_start = len(error)
while i < max_start:
    j = i
    start = index[i]
    while i < len(error) and error[i] > thresh:
        i += 1
    
    end = index[i]
    if start != end:
        intervals.append((start, end, np.mean(error[j: i+1])))
        
    i += 1        

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4