Python/machine_learning
Hrishikesh Suslade 4590363806 Added Pytests for Decission Tree mean_squared_error method (#1374)
* Added Pytests for Decission Tree

Modified the mean_squared_error to be a static method

Created the Test_Decision_Tree class
Consists of two methods
1. helper_mean_squared_error_test: This method calculates the mean squared error manually without using
numpy. Instead a for loop is used for the same.
2. test_one_mean_squared_error: This method considers a simple test case and compares the results by the
helper function and the original mean_squared_error method of Decision_Tree class. This is done using asert
keyword.

Execution:
PyTest installation
pip3 install pytest OR pip install pytest

Test function execution
pytest decision_tree.py

* Modified the pytests to be compatible with the doctest
Added 2 doctest in the mean_squared_error method
For its verification a static method helper_mean_squared_error(labels, prediction) is used
It uses a for loop to calculate the error instead of the numpy inbuilt methods
Execution
```
pytest .\decision_tree.py --doctest-modules
```
2019-10-18 20:23:37 +02:00
..
dbscan DBSCAN algorithm (#1207) 2019-09-29 10:44:41 +02:00
random_forest_classification psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
random_forest_regression psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
decision_tree.py Added Pytests for Decission Tree mean_squared_error method (#1374) 2019-10-18 20:23:37 +02:00
gradient_descent.py psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
k_means_clust.py psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
k_nearest_neighbours.py Add Topological Sort (#1302) 2019-10-18 08:13:58 +02:00
knn_sklearn.py psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
linear_regression.py psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
logistic_regression.py psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
naive_bayes.ipynb Validate Python filenames (#1086) 2019-07-30 15:32:13 +05:30
polymonial_regression.py #840 adds polymonial regression program in python (#1235) 2019-10-18 08:20:22 +02:00
reuters_one_vs_rest_classifier.ipynb snake_case all the things 2018-10-19 17:14:25 -05:00
scoring_functions.py added doctests to scoring_functions.py (#1300) 2019-10-08 13:12:27 +05:00
sequential_minimum_optimization.py psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
support_vector_machines.py Rename sorted_vector_machines.py to support_vector_machines.py (#1195) 2019-09-22 16:56:32 +02:00