Questions tagged [discretization]

Discretization concerns the process of transferring continuous models and equations into discrete counterparts. This process is usually carried out as a first step toward making them suitable for numerical evaluation and implementation on digital computers.

Discretization is used everywhere in DSP (digital signal processing) to represent analog data, e.g. sound, in binary format to allow computer processing and editing.

131 questions
1
vote
4 answers

Creating a discretized version of an array

I have a list that describes a profile, such as the next one: dat=[(0, 5),(1, 1),(3,1)] I need to create a discretized version of that profile give a step of time 'dt=0.2'. For instance, the firs column of 'dat' would be: dt = 0.2 time =…
nekovolta
  • 496
  • 2
  • 14
1
vote
1 answer

Discretize normal distribution to get prob of a random variable

Suppose I draw randomly from a normal distribution with mean zero and standard deviation represented by a vector of, say, dimension 3 with scale_rng=np.array([1,2,3]) eps=np.random.normal(0,scale_rng) I need to compute a weighted average based on…
1
vote
1 answer

"Class variable needs to be a factor" error for csv-read datasets

I am looking to discretise continuous features in machine-learning datasets, in particular, using supervised discretisation. It turns out that r [has a package/method for this]1, great! But since I am not proficient in R I have some issues and I…
1
vote
0 answers

Getting level from factor column in data frame based on numeric range

I'm trying to get the level of a number based on where it is in the range of values of a factor column in a dataframe. library(bnlearn) i <- iris idata4 <- i[,c(1:4)] #only first four columns, which are continuous diris <- discretize(idata4, method…
Oleg
  • 303
  • 2
  • 14
1
vote
1 answer

Mesh rectangular structure

What is the best way, to mesh a rectangular structure as you can see it here: What is special here, is the large difference in size between the thin grey structures and the large white gaps. Hence, a regular recangle-grid might not be the best…
Pixel_95
  • 954
  • 2
  • 9
  • 21
1
vote
1 answer

discretise domain of x and y with 0.01 separation between points

I am looking to calculate an array from a formula using x and y variables, the domain of x is (0,50) and y is (0,30) . I am asked to discretise the domain of x and y with 0.01 separation between points, then compute L(x,y) (which I have a formula…
Ryan
  • 15
  • 3
1
vote
1 answer

D3.JS: Discrete filter for image processing

I have an arbitrary raster pattern where blue is -1.0, white is 0.0 and orange is 1.0 (left image). Need to develop an SVG filter, similar to this reference Graying out an image in D3js), but for discretizing (right image). Eventually, values for…
VVK
  • 435
  • 2
  • 27
1
vote
2 answers

Finding equal frequency from discrete data

i have to find equal width from time series data. So far,i could do it by manually selecting every single column,and then applying the condition. But i need a faster way to do it. The time-series data: Time ulaR trxA 0 0.6457325 …
user10626935
1
vote
0 answers

First how to discretize the filter and signal by specific discretization amount and then apply the filter on the signal in Python?

I want to know if I have the first-order Chebyshev filter response as below: H_filter(s) = 1/(-1-s) = real_H_filter (s) + j Imag_H_filter(s) and also I have my signal as below: G(s)= Gr (s) + j Gi (s) How can I discretize the signal and filter by…
Hey There
  • 275
  • 3
  • 14
1
vote
1 answer

Inverse of fourier transform in 3d for non-uniform grid

My data is given by the Fourier transform of the function, where the points are distributed in a ball with uniformly distributed distances and uniformly distributed spherical angles (not Gaussian angles). So the grid in Fourier space is obviously…
1
vote
0 answers

Tag NA factor values in R

I'm discretizing the following vector in R: # Generated vector my_vector <- round(c(seq(from=0, to=50, by=0.83)), 2) # Generate 9 random indexes random_indexes <- sample(0:50, 9) # Assign NA to these indexes my_vector[random_indexes] <- NA I want…
Marco
  • 670
  • 5
  • 16
1
vote
1 answer

Make color palette of discretized values for a continuous variable (lattice levelplot)

Following up on this question, I want to make a levelplot heat map and color each cell according to the variable p.value in my data frame. I would like to have the cells colored in such way that there are only 3 colors (discretized color palette for…
DaniCee
  • 2,397
  • 6
  • 36
  • 59
1
vote
1 answer

"Target (y) not found or it is not numeric" -Package smbinning - R

I am trying to use smbinning package in R software to find optimal binnings to a certain variable. Running the command result=smbinning(df=bop,y="FLAG_TARGET",x="VL_TOTL_REND",p=0.05) returns the following error message: "Target (y) not found or…
1
vote
1 answer

Cross Validation with Orange python library

I try to do cross validation with python package "Orange". This library looks very nice, but I have some problem with it. For version information, I use Python 2.7 and Orange 2.7.8. My task is simple. I wanna validate model with cross validation…
Minsoo Choy
  • 115
  • 3
  • 8
1
vote
1 answer

Error: unused arguments in ifelse in R

I tried to discretise a column in dataframe df using ifelse statements using the following code. The column aar contains decimal values from 0 to 12 and NAs. I check if the numeric value and assign it to the categories as below. > df= df%>%…
andy
  • 643
  • 2
  • 12
  • 20
1 2
3
8 9