patrickloeber/MLfromscratch ? reverse-engineered prompt

Reverse engineered prompt

Build me a small Python project that teaches and demonstrates classic machine learning algorithms built from scratch.

I want a package with clean, easy to read implementations of KNN, linear regression, logistic regression, naive Bayes, perceptron, SVM, decision tree, random forest, PCA, k means, AdaBoost, and LDA. Keep the actual algorithm logic in pure numpy, and use scikit learn, pandas, and matplotlib only for testing, sample data, and plots. Include simple example scripts I can run from the command line, like python -m mlfromscratch.linear_regression, so each algorithm can be tried on a small dataset and compared against expected results.

Please make it educational, with readable code and comments that explain what is happening. Add a requirements file, basic package structure, and enough examples so someone can learn from the code without needing a full app. If you need to check current library usage or best practices, look up the latest docs online.