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
2
votes
3 answers

How to bin an integer column with group_by() |> tally() and show all bins, even if no values in them?

I want to bin an integer column and count how many values in each bin. I have a working solution, but it's limited as it wouldn't show bins that have no values in them. Consider the hp column in mtcars. I want to bin it by intervals of 40, to get…
Emman
  • 3,695
  • 2
  • 20
  • 44
2
votes
1 answer

In python, how to discretize continuous variable using accuracy as a criterion taking class into consideration

For a set of subjects I have a continuous variable with range 0-100 representing a quantification of a subject's state cont_attribute. For each subject I also have an ordinal variable representing reader annotation of subject's state as one of four…
2
votes
1 answer

LTI state-space model discretization using Modelica integralExp function not working

I need to perform a ZOH discretization of a continuous LTI state-space model in OpenModelica (OMEdit). I tried two ways of doing this: using matrix exponential (Matrices.exp function) for calculating discretized A matrix (Ad) and subsequent…
2
votes
0 answers

R caret discretization within cross validation

I'm using R caret package and I want to apply a discretization function to all predictive variables within cross-validation. For example using this code: # load the library library(caret) # load the iris dataset data(iris) # define training…
juyt
  • 21
  • 1
2
votes
1 answer

Riding the wave Numerical schemes for hyperbolic PDEs, lorena barba lessons, assistance needed

I am a beginner python user who is trying to get a feel for computer science, I've been learning how to use it by studying concepts/subjects I'm already familiar with, such as Computation Fluid Mechanics & Finite Element Analysis. I got my degree in…
2
votes
1 answer

Factor data frame values into quartile/decile ranges

I'm trying to create decile factors corresponding to my dataframe's values. I would like the factors to appear as a range e.g. if the value is "164" then the factored result should be "160 - 166". In the past I would do…
gm007
  • 547
  • 4
  • 11
2
votes
0 answers

Discretize one column in R

Let's say that there is such data frame: a b c 1. 2 2 3 2. 5 4 4 3. 1 7 4 4. 1 9 4 5. 2 14 0 6. 9 10 6 I would like to discretize data in column b and input means of received ranges as discrete values for instances in…
2
votes
0 answers

Pandas qcut "ValueError: Bin edges must be unique"

Yes I know there are many questions like this. This question is about a specific behavior: import pandas as pd x = [ 0,0,0,0, 1,1,1, 2,2,2, 3,3,3 ] print pd.qcut(x, 4) # ValueError: Bin edges must be unique: array([0, 0, 1, 2,…
Nolan Conaway
  • 2,639
  • 1
  • 26
  • 42
2
votes
2 answers

Quickly assign an array to n bins with equal length

For example, I have a stream of array with numbers ranging from 0.0 to 10.0 inclusive. I want to assign the numbers in arr to 5 bins of equal length quickly. By equal length I mean the bin intervals are [0.0, 2.0), [2.0, 4.0), [4.0, 6.0), [6.0,…
hamster on wheels
  • 2,771
  • 17
  • 50
2
votes
2 answers

Scikit Learn - Random Forest: How continuous feature is handled?

Random Forest accepts numerical data. Usually features with text data is converted to numerical categories and continuous numerical data is fed as it is without discretization. How the RF treat the continuous data for creating nodes? Will it bin the…
Sachinmm
  • 551
  • 1
  • 5
  • 8
2
votes
1 answer

Interval Based Data Structure(similar to boost icl)

My goal is to represent a 3D space which is discretized inhomogeneous into bins. A bin contains elements of an arbitrary type (the type is determined). When adding a bin ( or the interval in which the bin lies ) and it intersects with a previous…
Michael Latz
  • 101
  • 8
2
votes
1 answer

selected column discretize in weka

Is it possible to discretize selected column in weka ? I have 42 columns in my data set and I want to discretize (divide in intervals) only longitude and latitude but all columns are discretizing.
user2895589
  • 1,010
  • 4
  • 20
  • 33
1
vote
1 answer

Discretizing continuous variables with Pandas

I have the following dataset data = {"Amount": ["216.00","30.00","30.00","36.00","25.00","38.00","78.8","189.00","43.00","110.00"]} dataset = pd.DataFrame(data) I want to discretize these variables,create a new variable that has clear division of…
Almosino
  • 89
  • 7
1
vote
0 answers

How do I discretise a continuous observation and action space in Python?

My professor has asked me to apply a Policy Iteration method on the Pendulum-V1 gym environment in OpenAI. Pendulum-V1 has the following Environment: Observation Type:…
1
vote
0 answers

Numerical diagonalization of Hamiltonian using MATLAB

I am trying to diagonalize the Bogoliubov-de Gennes Hamiltonian. The problem is that the Hamiltonian contains a Laplacian. This could be solved by using a discretized Laplacian If I use a simple Hamiltonian (just the Laplacian) and use…
1
2
3
8 9