Table 26.
Time and Space Complexities of Machine Learning Algorithms.
| Model Name | Time Complexity | Space Complexity |
|---|---|---|
| KNN | O(knd) | O(nd) |
| Logistic Regression | O(nd) | O(d) |
| SVM | O(n²) | O(kd) |
| Naive Bayes | O(nd) | O(cd) |
| Random Forest | O(nlog(n)dk) | O(depth of tree ∗ k) |
Time and Space Complexities of Machine Learning Algorithms.
| Model Name | Time Complexity | Space Complexity |
|---|---|---|
| KNN | O(knd) | O(nd) |
| Logistic Regression | O(nd) | O(d) |
| SVM | O(n²) | O(kd) |
| Naive Bayes | O(nd) | O(cd) |
| Random Forest | O(nlog(n)dk) | O(depth of tree ∗ k) |