Questions tagged [subsampling]

103 questions
63
votes
14 answers

Scikit-learn balanced subsampling

I'm trying to create N balanced random subsamples of my large unbalanced dataset. Is there a way to do this simply with scikit-learn / pandas or do I have to implement it myself? Any pointers to code that does this? These subsamples should be random…
mikkom
  • 3,158
  • 4
  • 23
  • 35
15
votes
3 answers

Subsample pandas dataframe

I have a DataFrame loaded from a .tsv file. I wanted to generate some exploratory plots. The problem is that the data set is large (~1 million rows), so there are too many points on the plot to see a trend. Plus, it is taking a while to plot. I…
Nishant
  • 49,257
  • 12
  • 102
  • 116
9
votes
3 answers

Subsampling/averaging over a numpy array

I have a numpy array with floats. What I would like to have (if it is not already existing) is a function that gives me a new array of the average of every x points in the given array, like sub sampling (and opposite of interpolation(?)). E.g.…
Michel Keijzers
  • 13,956
  • 24
  • 83
  • 111
7
votes
3 answers

How to subsample a 2D polygon?

I have polygons that define the contour of counties in the UK. These shapes are very detailed (10k to 20k points each), thus rendering the related computations (is point X in polygon P?) quite computationaly expensive. Thus, I would like to…
Wookai
  • 18,747
  • 16
  • 70
  • 85
6
votes
3 answers

How can SciKit-Learn Random Forest sub sample size may be equal to original training data size?

In the documentation of SciKit-Learn Random Forest classifier , it is stated that The sub-sample size is always the same as the original input sample size but the samples are drawn with replacement if bootstrap=True (default). What I dont…
TAK
  • 61
  • 1
  • 3
5
votes
1 answer

Subsampling scale image view - make pin markers clickable on Imageview

I'm using Dave Morrissey's Subsampling Scale Image View. I modified the Pinview example (as shown here:…
5
votes
2 answers

How to compress YUYV raw data to JPEG using libjpeg?

I'm looking for an example of how to save a YUYV format frame to a JPEG file using the libjpeg library.
vdm
  • 175
  • 4
  • 16
4
votes
4 answers

R (and dplyr?) - Sampling from a dataframe by group, up to a maximum sample size of n

I have a dataframe which contains multiple samples (1-n) per group. I would like to sample this dataset, without replacement, so that I have a maximum of 5 samples per group (1-5). This problem has previously been described and answered here. In…
4
votes
1 answer

Sample to Create Uniform Distribution from Non-Uniform Data

Given a dataset with a non-uniform distribution (highly peaked) I want to resample to create a new dataset with an approximately uniform distribution. My approach: Divide the data into bins. Target bin level = Smallest number of samples per bin,…
Ron Cohen
  • 2,475
  • 4
  • 28
  • 43
4
votes
1 answer

Box filter size in relation to Gaussian filter sigma

In order to evaluate the performance impact (both computational and quality-wise) of using a box filter / mean filter vs using a gaussian filter, I an wondering if there is a proper relationship between the size of the box filter and the sigma of a…
4
votes
0 answers

Difference between subsampling and downscaling (image)?

I know that there are many ways to upscale (interpolate) an image using bilinear, bicubic,... Somehow, these same algorithms can also be used to downscale an image. But when it comes to subsampling, I've come across only two methods: Gaussian-blur…
Myath
  • 463
  • 1
  • 6
  • 17
4
votes
1 answer

Importing and extracting a random sample from a large .CSV in R

I'm doing some analysis in R where I need to work with some large datasets (10-20GB, stored in .csv, and using the read.csv function). As I will also need to merge and transform the large .csv files with other data frames, I don't have the computing…
RMAkh
  • 103
  • 9
3
votes
1 answer

How can I subsample a SpatialPointsDataFrame in R

I am working on running RandomForest. I've imported point data representing used and unused sites and created a raster stack from raster GIS layers. I've created a SpatialPointDataFrame with all of my used and unused points with their underlying…
user3088823
  • 81
  • 2
  • 5
3
votes
1 answer

Disable Java ImageIO Chroma Subsampling

I'm attempting to save a BufferedImage as JPEG using ImageIO. But even when saving using 100 quality, I am suffering quality loss due to Chroma SubSampling. I have successfully fixed this issue by reverting to the older JAI libraries and explicitly…
ejthurgo
  • 45
  • 1
  • 6
2
votes
1 answer

In Matlab, how can I use chroma subsampling to downscale a 4:4:4 image to 4:1:1 when the image is in YCbCr?

Following this exact question In Matlab, how can I use chroma subsampling to downscale a 4:4:4 image to 4:2:0 when the image is in YCbCr? where he is performing chroma downscaling from 4:4:4 to 4:2:0, I wanna dowscale from 4:4:4 to 4:1:1. Im not…
Sanam
  • 113
  • 9
1
2 3 4 5 6 7