mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-24 05:21:09 +00:00
4590363806
* 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 ``` |
||
---|---|---|
.. | ||
dbscan | ||
random_forest_classification | ||
random_forest_regression | ||
decision_tree.py | ||
gradient_descent.py | ||
k_means_clust.py | ||
k_nearest_neighbours.py | ||
knn_sklearn.py | ||
linear_regression.py | ||
logistic_regression.py | ||
naive_bayes.ipynb | ||
polymonial_regression.py | ||
reuters_one_vs_rest_classifier.ipynb | ||
scoring_functions.py | ||
sequential_minimum_optimization.py | ||
support_vector_machines.py |