tezvyn:

Data Science & Analytics

Analysis, notebooks, visualization, pandas, statistics

283 bites

More in Data Science & Analytics — page 3

Data Science & Analytics2 min read

Diagnosing Spark executor OutOfMemoryError

WHAT IT TESTS: systematic Spark memory debugging. OUTLINE: check the Spark UI for skew and spills, inspect executor memory and partition count, find culprits like wide collect, huge shuffles, or skewed keys, and fix via more partitions, memory tuning, or…

Data Science & Analytics88 sec read

Spark RDDs, DataFrames, and Datasets

WHAT IT TESTS: knowledge of Spark's APIs and the optimizer. OUTLINE: RDDs are low-level typed object collections with no built-in optimization; DataFrames are named columns optimized by Catalyst and Tungsten; Datasets add compile-time type safety in…

Data Science & Analytics2 min read

Data skew in Spark and salting

WHAT IT TESTS: diagnosing and fixing skewed distributed work. OUTLINE: data skew is uneven key distribution sending most rows to one partition and straggler task; salting appends a random suffix to hot keys to spread them across partitions, joining in two…

Data Science & Analytics2 min read

Spark broadcast join versus shuffle join

WHAT IT TESTS: Spark join optimization. OUTLINE: a broadcast join sends the small table to every executor so the large table joins locally with no shuffle of its rows; the default sort-merge join shuffles both tables across the network, which is costly.

Data Science & Analytics88 sec read

The MapReduce paradigm explained

WHAT IT TESTS: distributed batch processing basics. OUTLINE: map applies a function to each input record emitting key-value pairs in parallel; a shuffle groups values by key; reduce aggregates each key's values into a result.

Data Science & Analytics88 sec read

HDFS purpose and fault tolerance

WHAT IT TESTS: distributed storage fundamentals. OUTLINE: HDFS stores huge files across many commodity machines as large blocks, replicating each block across nodes for fault tolerance; unlike NTFS or ext4 it is distributed, write-once, and optimized for…

Data Science & Analytics84 sec read

Spark transformations versus actions

WHAT IT TESTS: Spark's lazy execution model. OUTLINE: transformations like map and filter are lazy and build a lineage DAG returning a new RDD; actions like count or collect trigger execution and return a value to the driver.

Data Science & Analytics88 sec read

Mode collapse in GANs and how to fix it

WHAT IT TESTS: understanding GAN training failures. OUTLINE: mode collapse is the generator producing few similar outputs, missing data diversity to fool the discriminator; fixes include Wasserstein loss, minibatch discrimination, unrolled GANs, and feature…

Data Science & Analytics88 sec read

Why Transformers use multi-head attention

WHAT IT TESTS: understanding of attention design. OUTLINE: a single head averages into one representation subspace; multiple heads attend in parallel to different subspaces, letting the model capture diverse relations like syntax and coreference at once, then…

Data Science & Analytics2 min read

Exploration versus exploitation: epsilon-greedy and UCB

WHAT IT TESTS: balancing trying new actions against using known good ones. OUTLINE: exploit current best to earn reward, explore to discover better options; epsilon-greedy explores randomly with probability epsilon; UCB explores by an uncertainty bonus…

Data Science & Analytics2 min read

RL components and how Q-learning works

WHAT IT TESTS: foundational RL vocabulary and the Q-learning update. OUTLINE: agent acts on the environment, observes state and reward, seeking to maximize cumulative discounted reward; Q-learning iteratively updates Q(s,a) toward reward plus discounted best…

Data Science & Analytics87 sec read

Analyzing skewed revenue-per-user experiments

WHAT IT TESTS: handling skewed metrics in A/B tests. OUTLINE: heavy tails inflate variance and slow significance, and the mean is dominated by whales; mitigate via winsorization or capping, log transforms, CUPED variance reduction, or bootstrap and rank tests.

Data Science & Analytics85 sec read

Interpreting a black-box gradient boosting model

WHAT IT TESTS: model interpretability methods. OUTLINE: global tools like permutation importance or aggregated SHAP rank overall feature influence; local tools like per-instance SHAP or LIME explain one prediction; SHAP unifies both via additive…

Data Science & Analytics87 sec read

Random Forest versus Gradient Boosting

WHAT IT TESTS: understanding bagging versus boosting. OUTLINE: Random Forest trains deep trees in parallel and averages to cut variance; boosting builds shallow trees sequentially, each correcting prior errors to cut bias, often higher accuracy but…

Data Science & Analytics81 sec read

Stemming versus lemmatization in text preprocessing

WHAT IT TESTS: NLP normalization trade-offs. OUTLINE: stemming chops affixes fast but crudely, yielding non-words; lemmatization maps to real dictionary base forms using POS, slower but accurate; skip both for embedding or transformer models.

Data Science & Analytics84 sec read

Handling missing numerical values

WHAT IT TESTS: judgment about imputation trade-offs. OUTLINE: dropping rows is simple but loses data and can bias if missingness is non-random; mean or median imputation keeps rows but shrinks variance and ignores correlations; model-based imputation is…

Data Science & Analytics74 sec read

Pandas loc versus iloc indexing

WHAT IT TESTS: practical pandas selection fluency. OUTLINE: loc selects by label and is inclusive of both endpoints; iloc selects by integer position and is exclusive of the stop; passing a string label to iloc fails.

Data Science & Analytics77 sec read

MLE versus MAP estimation and the role of priors

WHAT IT TESTS: Bayesian versus frequentist parameter estimation. OUTLINE: MLE maximizes likelihood alone; MAP maximizes likelihood times a prior, acting as regularization that shrinks toward prior beliefs; with abundant data they converge.

Data Science & Analytics83 sec read

Eigenvalues, eigenvectors, and their role in PCA

WHAT IT TESTS: linear algebra intuition behind dimensionality reduction. OUTLINE: an eigenvector keeps direction under a matrix, its eigenvalue scales it; PCA finds eigenvectors of the covariance matrix as principal axes.

Data Science & Analytics2 min read

How gradient descent and the learning rate work

WHAT IT TESTS: optimization fundamentals. OUTLINE: gradient descent steps downhill along the negative gradient to minimize cost; the learning rate sets step size; too high diverges or oscillates, too low converges painfully slowly.