DSMA Admission cheat sheet
DSMA Admission · Keep the key ideas within reach.
Data Governance and Ethics
Data minimization: collect only data that is adequate, relevant, and limited to what is necessary for the stated purpose.
Purpose limitation: personal data may be processed only for specified, explicit, and legitimate purposes; further processing must be compatible with the original purpose.
Lawful bases under GDPR: consent, contract, legal obligation, vital interests, public task, legitimate interests; consent must be freely given, specific, informed, and unambiguous.
Data subject rights include access, rectification, erasure, restriction, portability, and objection; requests must be fulfilled within one month (extendable by two).
Personal data breach notification: notify the supervisory authority within 72 hours of awareness unless unlikely to result in risk; notify affected individuals when high risk.
Anonymization removes identifiability irreversibly; pseudonymization replaces identifiers but remains personal data under GDPR.
Data retention: define and enforce retention periods based on legal requirements and business need; delete or anonymize data when no longer needed.
Role distinction: data controller determines purposes and means; data processor acts on behalf of controller and must have a written contract.
Ethical principles: fairness, transparency, accountability, beneficence, non-maleficence; conduct impact assessments for high-risk processing.
Statistics and Probability
Bayes' theorem: P(A|B) = P(B|A)P(A)/P(B); posterior is proportional to likelihood times prior.
Central limit theorem: for independent, identically distributed variables with finite variance, the sampling distribution of the mean approaches normal as n increases.
Confidence interval for a mean (known variance): x̄ ± z*(σ/√n); for unknown variance use t* with n-1 degrees of freedom.
Type I error (α) is rejecting a true null; Type II error (β) is failing to reject a false null; power = 1-β.
p-value: probability of observing a test statistic at least as extreme as the one computed, assuming the null hypothesis is true; it is not the probability the null is true.
Correlation coefficient r ranges from -1 to 1; r measures linear association only and does not imply causation.
Expected value of a discrete random variable: E[X] = Σ x·P(x); variance: Var(X) = E[X²] - (E[X])².
Law of total probability: P(B) = Σ P(B|A_i)P(A_i) for a partition {A_i}.
Standard error of the mean = σ/√n; decreases with larger sample size.
Data Management and SQL
Logical order of SQL execution: FROM → WHERE → GROUP BY → HAVING → SELECT → ORDER BY → LIMIT.
INNER JOIN returns rows with matches in both tables; LEFT JOIN returns all left rows plus matches; RIGHT JOIN the reverse; FULL OUTER JOIN all rows.
WHERE filters rows before grouping; HAVING filters groups after GROUP BY.
NULL represents unknown; use IS NULL / IS NOT NULL; NULL = NULL yields UNKNOWN, and aggregates except COUNT(*) ignore NULLs.
Primary key uniquely identifies each row and cannot be NULL; foreign key references a primary key in another table and enforces referential integrity.
Normalization: 1NF atomic values; 2NF no partial dependency on a composite key; 3NF no transitive dependency on non-key attributes.
Window functions (ROW_NUMBER, RANK, DENSE_RANK, SUM OVER) compute across a partition without collapsing rows.
ACID: Atomicity, Consistency, Isolation, Durability; isolation levels include READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SERIALIZABLE.
Indexes speed reads but slow writes and consume space; a composite index is usable for queries filtering on its leading column(s).
Programming and Data Manipulation
Python list comprehension: [expr for item in iterable if condition]; creates a new list.
Mutable vs immutable: lists and dicts are mutable; tuples, strings, and numbers are immutable.
Pandas: df.loc selects by label; df.iloc selects by integer position; df.groupby().agg() aggregates.
Handling missing data: df.isna() detects; df.dropna() removes; df.fillna() imputes; use inplace=True to modify the original.
Merge vs join in pandas: pd.merge combines on columns/keys; DataFrame.join combines on index by default.
Vectorization: NumPy operations on whole arrays are faster than Python loops because they run in compiled code.
Function arguments: positional, keyword, *args (tuple), **kwargs (dict); default arguments are evaluated once at definition time.
String formatting: f-strings (f"{x}") embed expressions; .format() and % are older alternatives.
Reproducibility: set random seeds (e.g., numpy.random.seed, random_state) before stochastic operations.
Machine Learning Fundamentals
Supervised learning uses labeled data; unsupervised learning finds structure in unlabeled data; reinforcement learning learns from reward signals.
Bias-variance tradeoff: high bias underfits; high variance overfits; regularization and more data reduce variance.
Train/validation/test split: train fits parameters, validation tunes hyperparameters, test estimates generalization once.
k-fold cross-validation: split data into k folds; train on k-1, validate on 1; repeat k times and average.
Classification metrics: accuracy, precision = TP/(TP+FP), recall = TP/(TP+FN), F1 = 2·precision·recall/(precision+recall).
ROC curve plots true positive rate vs false positive rate; AUC measures ranking ability across thresholds.
Regression metrics: MSE, RMSE, MAE, R² = 1 - SS_res/SS_tot.
Overfitting signs: low training error, high validation error; remedies include more data, simpler model, dropout, early stopping, L1/L2 regularization.
Confusion matrix layout: rows actual, columns predicted; accuracy = (TP+TN)/total.
Data Visualization and Communication
Chart choice: bar chart for categorical comparisons; line chart for trends over time; scatter plot for relationship between two quantitative variables; histogram for distribution.
Pie charts are poor for many categories or precise comparison; use bar charts instead.
Axis integrity: bar charts should start at zero; truncated axes can exaggerate differences.
Color encoding: use sequential palettes for ordered data, diverging for data with a meaningful midpoint, qualitative for categories.
Data-ink ratio (Tufte): maximize the proportion of ink devoted to data; remove chartjunk and unnecessary gridlines.
Accessibility: ensure sufficient contrast, avoid red-green only encoding, label axes and units, provide alt text.
Narrative structure: lead with the key message, support with evidence, state limitations and uncertainty.
Labeling: include title, axis labels with units, legend, and data source; annotate outliers or key points.
Avoid dual axes unless necessary; they can imply false correlations.