Questions tagged [sliding-window]

In data analysis, sliding windows are advancing sub-lists inside lists which allow, e.g., computation of a record's change from the previous record or next record. In networking, a sliding window may refer to a flow control technique that maintains windows of sequential frames sent or received without a corresponding acknowledgement.

In data analysis, sliding windows are advancing sub-lists inside lists which allow, e.g., computation of a record's change from the previous record or next record. In SQL in particular, the analytic functions LEAD(), LAG(), and computations OVER() a changing subset of query results involve sliding windows.

In networking, a sliding window may refer to a flow control technique that maintains windows of sequential frames sent or received without a corresponding acknowledgement.

441 questions
0
votes
1 answer

How to use lead() and lag() on varchar2 fields?

Oracle 11g My work so far on SQL Fiddle I'm using lead() and lag() functions on varchar2 columns. Using the following rules, I'd like to generate the desired results. If lag_val is null then '(' If lag_val is same as set_a then 'and' If lag_val…
zundarz
  • 1,430
  • 3
  • 21
  • 38
0
votes
2 answers

Taking the sum of a sliding window of indices in python

I have looked around but have been unable to find out why my code is failing, and how to do it right. I'm new (3 days) to coding, so forgive my noobishness. I start with a list of integers, and essentially I want to make a new or updated list…
0
votes
2 answers

Reuse an XML layout file to show different information (Android Application)

I’m new to Android and have a simple question. Currently I’m working on a products application that allows users to add, remove and browse variety of products. The application uses a predefined XML-based layout file as a template that fills the…
0
votes
0 answers

Sliding "cards" effect -- slides out, but not in

I'm using the following code to create a sliding card effect where each "card" is a list element and they slide across the screen. They are only visible within the "stage" I've set with specific height and width. It's working great -- except that,…
-1
votes
0 answers

Sliding window algorithm failing on corner cases

Working on LeetCode 438 which is here My sample code with explanation is pasted below. The most optimized solution uses little less space and mine uses just little extra space but is still linear. However, I am unable to figure out with some small…
-1
votes
1 answer

Longest substring with repeating characters in cpp

In one of my recent interviews I was given a question as follows - Divide the string into substrings with repeating characters, such that Example 1 Input : ababccdecfg Output : [abab, ccdec, f, g] Example 2 Input : bbbb Output : [bbbb] Example…
-1
votes
1 answer

Sliding Window Algorithm

I know that the time complexity of the sliding window algorithm is o(N) but what is the time complexity of a variable-sized sliding window algorithm. For eg- array = [1,2,3,4,5,6] when size of sliding window is = 1 window - [1], [2], [3], [4], [5],…
-1
votes
1 answer

Python - Iterate through a list and append n values every nth iteration to a vector

I am dealing with a deep reinforcement learning problem and the state I need to feed to my agent is contained in a vector of binary numbers. The list looks like that: [7.0, 1.0, 1.0, 0.0, 1.0, 5.0, 0.0, 1.0, 0.0, 1.0, 7.0, 1.0, 1.0, 0.0, 1.0,…
-1
votes
2 answers

sliding window to find minimums in matlab 2014a

I am new to matlab and i wonder is there any way for me to do the following: get a list of indices of minimum values in each 180samples of my data wich is 18000samples length this is how i, this is how i used to do it in python (with numpy.where),…
user10497058
-1
votes
2 answers

Count distinct elements in every window of size k*k

I found this on: http://www.geeksforgeeks.org/count-distinct-elements-in-every-window-of-size-k/ Given an array of size n and an integer k, return the of count of distinct numbers in all windows of size k. (...) An Efficient Solution is to use…
Tom
  • 29
  • 2
-1
votes
1 answer

Sliding window over numerical sequence

I am trying to build a sliding window approach that will slide over the numerical sequence of the elements in a list. This is important and, I believe, different from other sliding window approaches found in SO, in which the slide is usually made…
PedroA
  • 1,453
  • 2
  • 21
  • 40
-1
votes
1 answer

If I have a 15 min sliding window, how can I collect daily/weekly aggregates?

I have a 15 min sliding window, and can aggregate at any given time over this data within this window. Due to memory constraints, I can't increase the size of the window. I still think I should be able to get aggregates (like trending items which is…
-2
votes
0 answers

Sliding Window Coding Pattern not working as intended

''' Edit: Solved! Needed to add one more max() after the entire loop. The solution below works now. I'm trying to code a solution that returns the longest consecutive ones in an array in Python. for example in [1,0,1,1,1,0,1,1], the solution would…
legendary
  • 1
  • 3
-2
votes
1 answer

How to build a dataset for time-series classification?

I am beginning with time series classification and have some trouble understanding how my training set should be constructed. My current data look like this: Timestamp User ID Feature 1 Feature 2 ... Feature N target 2002-10-30 …
erup
  • 141
  • 2
  • 10
-2
votes
1 answer

Python: Sliding Window to compare words in my list with words in the given lexicon

I want to use slide window to check if the word in the 'document' is matched with the word in the 'lexicon'. My question is: which main function is doing this kind of thing? I saw several sliding window example and it seems that they are not what I…
user3746295
  • 101
  • 2
  • 10
1 2 3
29
30