Should you take a sample when doing EDA? Suppose i have a large dataset, such that python graphing libraries are unable to handle. Is it a good idea to take a random sample? Specifically if it's a classification task, and where the target is imbalanced. Could anyone point me to a rigorous resource to give this a theoretical explanation. Thanks
EDIT : I'm aware of oversampling or undersampling techniques before creating a machine learning model. Im curious about
Should i take a sample, before plotting the relationship of my variables? 
 A: Here is an article which discusses classification with imbalanced data: https://www.worldscientific.com/doi/abs/10.1142/S0218001409007326.
The article mentions that: 

Classification of data with imbalanced class distribution has
  encountered a significant drawback of the performance attainable by
  most standard classifier learning algorithms which assume a relatively
  balanced class distribution and equal misclassification costs.

I can propose three options that I know of:


*

*Create a balanced data set if you have plenty of data for each class, undersampling.

*Synthesize samples for your classes with few samples, oversampling.

*Make use of stratified sampling.

Stratified sampling refers to a type of sampling method . With
  stratified sampling, the researcher divides the population into
  separate groups, called strata. Then, a probability sample (often a
  simple random sample ) is drawn from each group.

On another note. you might be able to iteratively train your model by importing just parts of the data.
A: If your dataset is so large that working with the entire thing is intractable then I'm not sure you have a choice other than sampling it (unless you're asking if a simple random sample, compared to other sampling techniques, is a good choice).
Another sampling technique specifically for imbalanced data is SMOTE (Synthetic Minority Over-sampling Technique).  The quick basic idea is that you take some number of Nearest Neighbors for an arbitrary member of your minority class and randomly 'create' new data points linearly between the pairs.  The paper describing this technique can be found here: https://arxiv.org/pdf/1106.1813.pdf
There's also a python implementation which can be found here:
https://imbalanced-learn.readthedocs.io/en/stable/user_guide.html
The imbalanced-learn documentation has some pretty good illustrations/examples showing that SMOTE can pretty profoundly affect the decision boundary and is a good supplement to the paper even if you aren't planning on using it. 
