Data Science

Date Engineering, Statistics, AI/ML, Operations Research, Visualization

  • |

    Univariate Feature Selection

    Each feature is scored on its own against the target, ranked, and cut at the top k or a p-value threshold. The right test follows from the data types: chi-square, ANOVA F, Pearson correlation, mutual information. Cheap and model-free, but blind to interactions and to variables carrying the same information.

  • |

    Regularization

    When the cross-product matrix cannot be inverted, or barely can, a penalty added to the loss stabilizes the coefficients. Which penalty matters: Ridge shrinks toward zero but never reaches it, Lasso drives useless variables exactly to zero, and ElasticNet handles groups of correlated variables. Dropping variables outright, by VIF or PCA, is the alternative.

  • | |

    Ordinary Least Squares

    Fitting a linear regression means solving one matrix equation, not one equation per observation. Stacking the data into a design matrix and minimizing the residual sum of squares gives the normal equation, whose closed-form solution fixes the coefficients uniquely whenever the cross-product matrix can be inverted. NumPy reproduces the computation.

  • |

    Single Predicted Value From Two Models

    🇺🇸🇰🇷 Two models each emit a prediction and a probability. A weighted average of the probabilities gives the class, and the same weights average the predicted values into one. The weight itself comes from a grid search on a validation dataset, scored by F1, ROC-AUC or log loss.

  • |

    Polynomial Feature Expansion

    🇺🇸🇰🇷 Three defaults make polynomial expansion cheap and safe: degree two, centring the variables before expanding, and a ridge or lasso penalty on the new columns. Skipping the last two shows up as coefficients flipping sign, not as poor fit. Beyond a few dozen variables, or for repeated bends, splines and kernels replace it.

  • |

    Overfitting In Wide Data

    When columns outnumber rows a model can fit the training set exactly and still carry no signal. This document sets out the three sources of that failure, the families of defense against each — regularization, projection, subspace sampling, honest selection — and the nested protocol that has to confirm the choice before any number is reported.

  • |

    Overfitting In Long Data

    Overfitting in long data does not come from having too many parameters. It comes from model capacity, from rows that resemble each other inside a group, and from leakage in the procedure. A random split hides the second one: capacity must stop where held-out error turns, and the split must follow the groups.

  • | |

    The Chi-Squared Distribution

    🇺🇸🇰🇷 It is met not as a model of data but as the distribution of a statistic, and it earns its place because two unrelated quantities follow it: the scaled sample variance of a normal population, and Pearson’s gap between observed and expected counts. Both reduce to a sum of squares of approximately standard normal terms.

  • |

    Feature Importance

    Two methods can differ by an order of magnitude on the same feature and both be correct, because they answer different questions. One measures how much a fitted model relies on the feature, the other how much the data carries about the target, and most are read as the second while answering the first.

  • | | | |

    TVC (Time-Varying Coefficient) Regression

    Letting a regression coefficient become a function of time fits data where the same predictor matters differently depending on when it was observed. The gain is an effect read straight off its trajectory; the cost is that degrees of freedom grow with the sample, so what ties them together is the real design problem.

  • | |

    Standard Deviation of a Population and of Its Sample Mean

    🇺🇸🇰🇷 Two quantities are both called a standard deviation and both written with a sigma: the spread of individual values in a population, and the spread of the sample mean over repeated samples. The sample size alone connects them, as sigma over root n. Separates the symbols that share the name.

  • | |

    Design of Experiments

    🇺🇸🇰🇷 Passive data cannot separate factors that move together, so the settings are chosen deliberately instead. Because the covariance of the estimates follows from the design alone, designing an experiment is choosing the rows of the model matrix against a run budget. Full factorial, fractional factorial, response surface and D-optimal, in Python.