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.

583 questions
-2
votes
1 answer

Why is a sliding window algorithm considered O(n) and not O(n^2)?

On leetcode 424. Longest Repeating Character Replacement - (https://leetcode.com/problems/longest-repeating-character-replacement) You are given a string s and an integer k. You can choose any character of the string and change it to any other…
NimaKapoor
  • 119
  • 6
-2
votes
1 answer

Leetcode 219. My python solution not working

Question is : Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such that nums[i] == nums[j] and abs(i - j) <= k Ex 1: Input: nums = [1,2,3,1], k = 3 Output: true My solution is def…
-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 …
-2
votes
1 answer

Sliding windows by timestamp R

I have a dataframe "data" where the column V11 contains the timestamp for each row. I want to add a sliding windows to select the appropriate rows respect the timestamp. The sliding windows has a length of 200 ms and it should move each 100 ms.…
Ruser
  • 85
  • 1
  • 7
-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
  • 11
-2
votes
1 answer

Sliding window for determining local datapoint desity (AWK)

I reckon my question wasn't all clear. So, time for another approach in explaining my quest. I've got a single data file that contains about 27,500 data points. Every datapoint has a unique integers between 0 and 46041637 in the first column and a…
Elmer
  • 255
  • 1
  • 2
  • 10
-3
votes
1 answer

Implementing 2D sliding window in Tensorflow

I have a 3-dim shape tensor and I'm trying to transverse it using 2D sliding window as illustrated below: in this image, each letter represents an n-elements array and the window size is 3x3. The window is always squared such as 3x3, 5x5, etc I'm…
Duloren
  • 2,395
  • 1
  • 25
  • 36
-3
votes
1 answer

How to calculate column mean at intervals of row values in R?

I have dataframe which has 253 rows(locations on a chromosome in Mbps) and 1 column (Allele score at each location). I need to produce a dataframe which contains the mean of the allele score at every 0.5 Mbps on the chromosome. Please help with R…
Ahmed
  • 3
  • 1
-3
votes
1 answer

How to create a sliding window and put the values of the sliding window into a hash?

I needed to create a sliding window of size 15, go through a Fasta file and store all of the values of the sliding window into a hash. When I try to print I get the error Global symbol "$sequence" requires explicit package name at…
-3
votes
2 answers

How do I port this code to Java?

I am implementing 2 applications that use the sliding window protocol as a data link protocol and UDP Sockets to communicate. I am trying to implement the sliding window protocol using the Tanembaum's book as reference. Here's the code I found in…
Bruno Calza
  • 2,732
  • 2
  • 23
  • 25
-4
votes
1 answer

python is inexplicably shortening the step size with each iteration of a sliding window analysis

I am working on a program that estimates the statistic Tajima's D in a series of sliding windows across a chromosome. The chromosome itself is also divided into a number of different regions with (hopefully) functional significance. The sliding…
gwilymh
  • 415
  • 1
  • 7
  • 20
-5
votes
1 answer

How to apply sliding window for subtracting two different images in matlab?

How to apply sliding window for subtracting two different images in matlab, the window size must be 4X4, please help me i want to find similarity value between two different images.if A and B are two 2 images take difference between each 4x4 matrix…
sara
  • 13
  • 1
  • 5
1 2 3
38
39