How assemblyai-community/machine-learning-from-scratch works
This is an educational collection of machine-learning algorithms implemented from scratch, with small runnable demonstrations for several models. The typical demonstrated workflow loads a sample dataset, splits it into training and test data, fits an algorithm, predicts on held-out data, and reports a metric; some demos also plot results. The README describes the collection broadly but does not document a shared runtime or common pipeline. The remaining algorithm implementations are included as independent capabilities; their internal relationships are not inferred from unsampled code.
Main entry points: 01 KNN/train.py KNN demo · 02 Linear Regression/train.py Linear regression demo · 03 Logistic Regression/train.py Logistic regression demo · 04 Decision Trees/train.py Decision tree demo
Components 18
Runnable demos
- KNN demo
01 KNN/train.py - Linear regression demo
02 Linear Regression/train.py - Logistic regression demo
03 Logistic Regression/train.py - Decision tree demo
04 Decision Trees/train.py - Random forest demo
05 Random Forests/train.py
Supervised learning
- KNN classifier
01 KNN/KNN.py - Linear regression
02 Linear Regression/LinearRegression.py - Logistic regression
03 Logistic Regression/LogisticRegression.py - Decision tree
04 Decision Trees/DecisionTree.py - Random forest
05 Random Forests/RandomForest.py - Forest tree
05 Random Forests/DecisionTree.py - Naive Bayes
06 NaiveBayes/naive_bayes.py - Perceptron
08 Perceptron/perceptron.py - Support vector machine
09 SVM/svm.py
Unsupervised learning
- K-means clustering
10 KMeans/kmeans.py
Representation learning
- PCA
07 PCA/pca.py
Other components
- Sample datasets
- Predictions and metrics
Connections 16
- Sample datasets → KNN demo: loads and splits
01 KNN/train.py - KNN demo → KNN classifier: fits and predicts
01 KNN/train.py - KNN demo → Predictions and metrics: reports accuracy
01 KNN/train.py - Sample datasets → Linear regression demo: generates and splits
02 Linear Regression/train.py - Linear regression demo → Linear regression: fits and predicts
02 Linear Regression/train.py - Linear regression demo → Predictions and metrics: reports error and plots
02 Linear Regression/train.py - Sample datasets → Logistic regression demo: loads and splits
03 Logistic Regression/train.py - Logistic regression demo → Logistic regression: fits and predicts
03 Logistic Regression/train.py - Logistic regression demo → Predictions and metrics: reports accuracy
03 Logistic Regression/train.py - Sample datasets → Decision tree demo: loads and splits
04 Decision Trees/train.py - Decision tree demo → Decision tree: fits and predicts
04 Decision Trees/train.py - Decision tree demo → Predictions and metrics: reports accuracy
04 Decision Trees/train.py - Sample datasets → Random forest demo: loads and splits
05 Random Forests/train.py - Random forest demo → Random forest: fits and predicts
05 Random Forests/train.py - Random forest demo → Predictions and metrics: reports accuracy
05 Random Forests/train.py - Random forest → Forest tree: instantiates and trains
05 Random Forests/RandomForest.py