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

Converting a pandas Interval into a string (and back again)

I'm relatively new to Python and am trying to get some data prepped to train a RandomForest. For various reasons, we want the data to be discrete, so there are a few continuous variables that need to be discretized. I found qcut in pandas, which…
Amanda
  • 422
  • 2
  • 6
  • 14
12
votes
5 answers

How to do discretization of continuous attributes in sklearn?

My data consists of a mix of continuous and categorical features. Below is a small snippet of how my data looks like in the csv format (Consider it as data collected by a super store chain that operates stores in different…
data_learner
  • 123
  • 1
  • 1
  • 5
7
votes
4 answers

Binning continuous values with round() creates artifacts

In Python, suppose that I have continuous variables x and y, whose values are bounded between 0 and 1 (to make it easier). My assumption has always been that if I want to convert those variables into ordinal values with bins going like…
RAs
  • 377
  • 3
  • 13
7
votes
1 answer

Discretizing a Pandas column based on custom ranges

Is there a way to discretize a column from a Pandas dataframe based on custom limits (meaning the ranges are not of equal length)? Previous questions asked here don't cover this case. For example, assume we want to convert numeric grades (out of 4)…
Tapal Goosal
  • 361
  • 4
  • 13
6
votes
1 answer

Discretizing the log of a continuous variable

I am trying to discretize a continuous variable, cutting it into three levels. I want to do the same thing for the log of the positive continuous variable (in this case, income). require(dplyr) set.seed(3) mydata = data.frame(realinc =…
Hatshepsut
  • 5,962
  • 8
  • 44
  • 80
5
votes
1 answer

OpenAI Gym custom environment: Discrete observation space with real values

I would like to create custom openai gym environment that has discrete state space, but with float values. To be more precise, it should be a range of values with 0.25 step: 10.0, 10.25, 10.5, 10.75, 11.0, ..., 19.75, 20.0 Is there a way to do this…
5
votes
1 answer

INTENT(IN) dummy argument in variable definition context

I am getting an error message in my subroutine when I run my code. This code is from an exercise in Kincaid & Cheney's book on Gauss Seidel methods to solve elliptic partial differential equations. The error message is: dummy argument 'u' with…
Jeff Faraci
  • 403
  • 13
  • 28
5
votes
3 answers

discretization in R with arules package

I am using arules package to discretize my continuous variables in data frame. I am using this particular line discretize(data1,categories = 3) but its giving me an error Error in cut.default(x,k2) : k2 must be numeric I am just trying to convert…
Ankit Bhatia
  • 99
  • 1
  • 1
  • 8
4
votes
2 answers

How to find the index position on ZedGraph

Is there any ways around to find the index position of a curve, based on the current xPosition, let's say I have a curve Item - MyCurve, which has 20k points and when the mouse moves I could get the mouse location & then I could get the x & y…
SanVEE
  • 2,009
  • 5
  • 34
  • 55
3
votes
1 answer

Problem with 3-D meshing of a hollow torus in Gmsh

I would like to create a hollow or thick semi-torus, for this, I use the following commands: SetFactory ("OpenCASCADE"); Torus (1) = {0,0,0, 170,30, Pi}; Torus (2) = {0,0,0, 170,20, Pi}; BooleanDifference (8) = {Volume {1}; Delete; } {Volume {2};…
F.Mark
  • 147
  • 6
3
votes
1 answer

Sklearn Binning Process - It is possible to return a interval?

I'm trying to use KBinsDiscretizer from sklearn.preprocessing, but it returns integer values as 1,2,..,N (representing the interval). Is it possible to return a correct interval as (0.2, 0.5) or this is not implemented yet?
3
votes
1 answer

Why are the results obtained by using the spark's QuantileDiscretizer grouped unevenly?

I have a Dataset. The feature columns are grouped using the org.apache.spark.ml.feature.QuantileDiscretizer class of spark 2.3.1, and the resulting model grouping results are not uniform. The data reflected in the last packet is almost twice as…
3
votes
2 answers

Changing my finite difference model from 2D to 3D causes unstable behavior

I've been writing a finite difference code for the simulation and detection of cracks using laser-induced thermography. The crack is implemented by factors a and b, which are "damping" the heat flow through the air filled crack using a…
3
votes
1 answer

Octave Matrix of discretized Legendre polynomials

I need to get N x columns(L) matrix of legendre polynomials evaluated over L for arbitrary N. Is there a better way of computing the matrix than just explicitly evaluating the polynomial vector for each row? The code snippet for this approach (N =…
3
votes
0 answers

Programming a Z-Domain Function

I'm trying to create a simple PID simulator in C. It is a simple cruise control system and I have chosen to model my system as a low pas filter. I'm having difficulty writing my mathematical model in C. I found a very similar question and a somewhat…
David
  • 31
  • 1
  • 2
1
2 3
8 9