diff --git a/machine_learning/a_star_search.cpp b/machine_learning/a_star_search.cpp index 9f713883a..f805d09ef 100644 --- a/machine_learning/a_star_search.cpp +++ b/machine_learning/a_star_search.cpp @@ -19,15 +19,21 @@ * values having minimum F(state). * @author [Ashish Daulatabad](https://github.com/AshishYUO) */ -#include /// for `std::reverse` function -#include /// for `std::array`, representing `EightPuzzle` board -#include /// for `assert` -#include /// for `std::function` STL -#include /// for IO operations -#include /// for `std::map` STL -#include /// for `std::shared_ptr` -#include /// for `std::set` STL -#include /// for `std::vector` STL +#include // for uint32_t, int8_t + +#include // for max, min +#include // for array, operator== +#include // for assert +#include // for size_t +#include // for function +#include // for operator<<, basic_ostream, char_traits, cout +#include // for operator!=, map, operator== +#include // for shared_ptr, make_shared, operator!= +#include // for set +#include // for tie, tuple +#include // for pair, move, make_pair, swap +#include // for vector + /** * @namespace machine_learning * @brief Machine learning algorithms diff --git a/machine_learning/adaline_learning.cpp b/machine_learning/adaline_learning.cpp index 6da839a9d..55385d130 100644 --- a/machine_learning/adaline_learning.cpp +++ b/machine_learning/adaline_learning.cpp @@ -26,15 +26,14 @@ * computed using stochastic gradient descent method. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include // for abs +#include // for array +#include // for assert +#include // for rand, exit, srand, strtof, EXIT_FAILURE +#include // for time +#include // for basic_ostream, operator<<, char_traits, cout +#include // for inner_product +#include // for vector /** Maximum number of iterations to learn */ constexpr int MAX_ITER = 500; // INT_MAX diff --git a/machine_learning/k_nearest_neighbors.cpp b/machine_learning/k_nearest_neighbors.cpp index 92621862c..2ff1818fe 100644 --- a/machine_learning/k_nearest_neighbors.cpp +++ b/machine_learning/k_nearest_neighbors.cpp @@ -9,13 +9,16 @@ * the K-nearest neighbors. */ -#include /// for std::transform and std::sort -#include /// for assert -#include /// for std::pow and std::sqrt -#include /// for std::cout -#include /// for std::accumulate -#include /// for std::unordered_map -#include /// for std::vector +#include // for sort, transform +#include // for assert +#include // for sqrt, pow +#include // for size_t +#include // for basic_ostream, operator<<, char_traits, cout +#include // for back_inserter +#include // for accumulate +#include // for unordered_map, _Node_iterator +#include // for pair +#include // for vector /** * @namespace machine_learning @@ -65,7 +68,7 @@ class Knn { * @param Y labels vector */ explicit Knn(std::vector>& X, std::vector& Y) - : X_(X), Y_(Y){}; + : X_(X), Y_(Y) {}; /** * Copy Constructor for class Knn. diff --git a/machine_learning/neural_network.cpp b/machine_learning/neural_network.cpp index 7e20f7a40..e3c438849 100644 --- a/machine_learning/neural_network.cpp +++ b/machine_learning/neural_network.cpp @@ -27,18 +27,20 @@ * MSE as loss function. Bias is also not included. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include // for duration, duration_cast, high_resolution_c... +#include // for max, min +#include // for assert +#include // for exp +#include // for basic_ostream, operator<<, endl, basic_ist... +#include // for cerr, cout +#include // for basic_stringstream +#include // for char_traits, basic_string, operator<<, ope... +#include // for valarray +#include // for vector +#include // for exit, size_t, EXIT_FAILURE +#include // for pair, make_pair -#include "vector_ops.hpp" // Custom header file for vector operations +#include "vector_ops.hpp" // for argmax, apply_function, get_shape, multiply /** \namespace machine_learning * \brief Machine learning algorithms diff --git a/machine_learning/ordinary_least_squares_regressor.cpp b/machine_learning/ordinary_least_squares_regressor.cpp index 0c865761b..e9475ea44 100644 --- a/machine_learning/ordinary_least_squares_regressor.cpp +++ b/machine_learning/ordinary_least_squares_regressor.cpp @@ -9,11 +9,13 @@ * * \author [Krishna Vedala](https://github.com/kvedala) */ -#include -#include // for std::abs -#include // for print formatting -#include -#include +#include // for abs + +#include // for assert +#include // for size_t +#include // for operator<<, setfill, setw, _Setfill, _Setw +#include // for basic_ostream, operator<<, char_traits, cout +#include // for vector /** * operator to print a matrix