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
2019-08-29 00:53:42 +05:30
2019-10-18 08:13:58 +02:00
2019-10-18 09:39:37 +02:00
2019-10-18 08:13:58 +02:00
2019-10-05 10:14:13 +05:00
2019-10-18 08:13:58 +02:00
2019-10-05 10:14:13 +05:00
2019-10-05 10:14:13 +05:00
2019-10-05 10:14:13 +05:00
2019-10-18 08:13:58 +02:00
2019-10-05 10:14:13 +05:00
2019-06-02 12:14:18 +08:00
2019-10-17 16:02:40 +02:00

The Algorithms - Python

Donate  Build Status  LGTM  Gitter chat  contributions welcome   

All algorithms implemented in Python (for education)

These implementations are for learning purposes. They may be less efficient than the implementations in the Python standard library.

Contribution Guidelines

Read our Contribution Guidelines before you contribute.

Open in Gitpod

Community Channel

We're on Gitter! Please join us.

Algorithms

See our directory.

Languages
Python 99.9%
Shell 0.1%