Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/AssemblyAI-Community/Machine-Learning-From-Scratch
/ functions
Functions
73 in github.com/AssemblyAI-Community/Machine-Learning-From-Scratch
⨍
Functions
73
◇
Types & classes
13
↓ 8 callers
Method
plot
(self)
10 KMeans/kmeans.py:89
↓ 6 callers
Function
get_hyperplane_value
(x, w, b, offset)
09 SVM/svm.py:63
↓ 3 callers
Method
_entropy
(self, y)
04 Decision Trees/DecisionTree.py:93
↓ 3 callers
Method
_entropy
(self, y)
05 Random Forests/DecisionTree.py:93
↓ 2 callers
Method
_split
(self, X_column, split_thresh)
04 Decision Trees/DecisionTree.py:88
↓ 2 callers
Method
_split
(self, X_column, split_thresh)
05 Random Forests/DecisionTree.py:88
↓ 2 callers
Function
euclidean_distance
(x1, x2)
10 KMeans/kmeans.py:4
↓ 2 callers
Method
fit
(self, X, y)
05 Random Forests/DecisionTree.py:23
↓ 2 callers
Method
predict
(self, X)
02 Linear Regression/LinearRegression.py:26
↓ 2 callers
Function
sigmoid
(x)
03 Logistic Regression/LogisticRegression.py:3
↓ 1 callers
Method
_best_split
(self, X, y, feat_idxs)
04 Decision Trees/DecisionTree.py:48
↓ 1 callers
Method
_best_split
(self, X, y, feat_idxs)
05 Random Forests/DecisionTree.py:48
↓ 1 callers
Method
_bootstrap_samples
(self, X, y)
05 Random Forests/RandomForest.py:23
↓ 1 callers
Method
_closest_centroid
(self, sample, centroids)
10 KMeans/kmeans.py:69
↓ 1 callers
Method
_create_clusters
(self, centroids)
10 KMeans/kmeans.py:61
↓ 1 callers
Method
_get_centroids
(self, clusters)
10 KMeans/kmeans.py:76
↓ 1 callers
Method
_get_cluster_labels
(self, clusters)
10 KMeans/kmeans.py:51
↓ 1 callers
Method
_grow_tree
(self, X, y, depth=0)
04 Decision Trees/DecisionTree.py:27
↓ 1 callers
Method
_grow_tree
(self, X, y, depth=0)
05 Random Forests/DecisionTree.py:27
↓ 1 callers
Method
_information_gain
(self, y, X_column, threshold)
04 Decision Trees/DecisionTree.py:68
↓ 1 callers
Method
_information_gain
(self, y, X_column, threshold)
05 Random Forests/DecisionTree.py:68
↓ 1 callers
Method
_is_converged
(self, centroids_old, centroids)
10 KMeans/kmeans.py:84
↓ 1 callers
Method
_most_common_label
(self, y)
04 Decision Trees/DecisionTree.py:99
↓ 1 callers
Method
_most_common_label
(self, y)
05 Random Forests/DecisionTree.py:99
↓ 1 callers
Method
_most_common_label
(self, y)
05 Random Forests/RandomForest.py:28
↓ 1 callers
Method
_pdf
(self, class_idx, x)
06 NaiveBayes/naive_bayes.py:39
↓ 1 callers
Method
_predict
(self, x)
01 KNN/KNN.py:20
↓ 1 callers
Method
_predict
(self, x)
06 NaiveBayes/naive_bayes.py:26
↓ 1 callers
Method
_traverse_tree
(self, x, node)
04 Decision Trees/DecisionTree.py:107
↓ 1 callers
Method
_traverse_tree
(self, x, node)
05 Random Forests/DecisionTree.py:107
↓ 1 callers
Function
accuracy
(y_true, y_pred)
09 SVM/svm.py:56
↓ 1 callers
Function
accuracy
(y_true, y_pred)
08 Perceptron/perceptron.py:51
↓ 1 callers
Function
accuracy
(y_pred, y_test)
03 Logistic Regression/train.py:15
↓ 1 callers
Function
accuracy
(y_test, y_pred)
04 Decision Trees/train.py:17
↓ 1 callers
Function
accuracy
(y_true, y_pred)
05 Random Forests/train.py:15
↓ 1 callers
Function
accuracy
(y_true, y_pred)
06 NaiveBayes/naive_bayes.py:53
↓ 1 callers
Function
euclidean_distance
(x1, x2)
01 KNN/KNN.py:4
↓ 1 callers
Method
fit
(self, X, y)
01 KNN/KNN.py:12
↓ 1 callers
Method
fit
(self, X, y)
09 SVM/svm.py:12
↓ 1 callers
Method
fit
(self, X, y)
02 Linear Regression/LinearRegression.py:12
↓ 1 callers
Method
fit
(self, X, y)
08 Perceptron/perceptron.py:17
↓ 1 callers
Method
fit
(self, X, y)
03 Logistic Regression/LogisticRegression.py:14
↓ 1 callers
Method
fit
(self, X, y)
04 Decision Trees/DecisionTree.py:23
↓ 1 callers
Method
fit
(self, X, y)
06 NaiveBayes/naive_bayes.py:5
↓ 1 callers
Method
fit
(self, X)
07 PCA/pca.py:11
↓ 1 callers
Method
is_leaf_node
(self)
04 Decision Trees/DecisionTree.py:12
↓ 1 callers
Method
is_leaf_node
(self)
05 Random Forests/DecisionTree.py:12
↓ 1 callers
Function
mse
(y_test, predictions)
02 Linear Regression/train.py:18
↓ 1 callers
Method
predict
(self, X)
01 KNN/KNN.py:16
↓ 1 callers
Method
predict
(self, X)
09 SVM/svm.py:31
↓ 1 callers
Method
predict
(self, X)
08 Perceptron/perceptron.py:38
↓ 1 callers
Method
predict
(self, X)
10 KMeans/kmeans.py:21
↓ 1 callers
Method
predict
(self, X)
03 Logistic Regression/LogisticRegression.py:30
↓ 1 callers
Method
predict
(self, X)
04 Decision Trees/DecisionTree.py:104
↓ 1 callers
Method
predict
(self, X)
05 Random Forests/DecisionTree.py:104
↓ 1 callers
Method
predict
(self, X)
06 NaiveBayes/naive_bayes.py:22
↓ 1 callers
Method
transform
(self, X)
07 PCA/pca.py:32
↓ 1 callers
Function
visualize_svm
()
09 SVM/svm.py:62
Method
__init__
(self, k=3)
01 KNN/KNN.py:9
Method
__init__
(self, learning_rate=0.001, lambda_param=0.01, n_iters=1000)
09 SVM/svm.py:5
Method
__init__
(self, lr = 0.001, n_iters=1000)
02 Linear Regression/LinearRegression.py:6
Method
__init__
(self, learning_rate=0.01, n_iters=1000)
08 Perceptron/perceptron.py:9
Method
__init__
(self, K=5, max_iters=100, plot_steps=False)
10 KMeans/kmeans.py:9
Method
__init__
(self, lr=0.001, n_iters=1000)
03 Logistic Regression/LogisticRegression.py:8
Method
__init__
(self, feature=None, threshold=None, left=None, right=None,*,value=None)
04 Decision Trees/DecisionTree.py:5
Method
__init__
(self, min_samples_split=2, max_depth=100, n_features=None)
04 Decision Trees/DecisionTree.py:17
Method
__init__
(self, feature=None, threshold=None, left=None, right=None,*,value=None)
05 Random Forests/DecisionTree.py:5
Method
__init__
(self, min_samples_split=2, max_depth=100, n_features=None)
05 Random Forests/DecisionTree.py:17
Method
__init__
(self, n_trees=10, max_depth=10, min_samples_split=2, n_feature=None)
05 Random Forests/RandomForest.py:6
Method
__init__
(self, n_components)
07 PCA/pca.py:6
Method
fit
(self, X, y)
05 Random Forests/RandomForest.py:13
Method
predict
(self, X)
05 Random Forests/RandomForest.py:33
Function
unit_step_func
(x)
08 Perceptron/perceptron.py:4