diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json
new file mode 100644
index 00000000..2c99a507
--- /dev/null
+++ b/.vscode/c_cpp_properties.json
@@ -0,0 +1,18 @@
+{
+ "configurations": [
+ {
+ "name": "Win32",
+ "includePath": [
+ "C:\\MinGW\\include"
+ ],
+ "defines": [
+ "_DEBUG",
+ "UNICODE",
+ "_UNICODE"
+ ],
+ "compilerPath": "C:/MinGW/bin/gcc.exe",
+ "intelliSenseMode": "${default}"
+ }
+ ],
+ "version": 4
+}
\ No newline at end of file
diff --git a/docs/html/classdetail_1_1iter__impl.html b/docs/html/classdetail_1_1iter__impl.html
index 9c7ad96e..c023bc59 100644
--- a/docs/html/classdetail_1_1iter__impl.html
+++ b/docs/html/classdetail_1_1iter__impl.html
@@ -192,7 +192,7 @@
difference_type | operator- (const iter_impl &other) const |
| return difference
|
|
-reference | operator[] (difference_type n) const |
+reference | operator[] (difference_type n) const |
| access to successor
|
|
const object_t::key_type & | key () const |
diff --git a/docs/html/classdetail_1_1json__reverse__iterator.html b/docs/html/classdetail_1_1json__reverse__iterator.html
index a5fa9b9d..45ec8552 100644
--- a/docs/html/classdetail_1_1json__reverse__iterator.html
+++ b/docs/html/classdetail_1_1json__reverse__iterator.html
@@ -152,7 +152,7 @@
| return difference
|
|
-reference | operator[] (difference_type n) const |
+reference operator[] (difference_type n) const |
| access to successor
|
|
diff --git a/docs/html/classdetail_1_1primitive__iterator__t.html b/docs/html/classdetail_1_1primitive__iterator__t.html
index 62710d48..d0cb38b1 100644
--- a/docs/html/classdetail_1_1primitive__iterator__t.html
+++ b/docs/html/classdetail_1_1primitive__iterator__t.html
@@ -106,7 +106,7 @@
|
| return whether the iterator is at end
|
|
-primitive_iterator_t | operator+ (difference_type n) noexcept |
+primitive_iterator_t operator+ (difference_type n) noexcept |
|
primitive_iterator_t & | operator++ () noexcept |
@@ -121,10 +121,10 @@
primitive_iterator_t operator-- (int) &noexcept |
|
-primitive_iterator_t & | operator+= (difference_type n) noexcept |
+primitive_iterator_t & operator+= (difference_type n) noexcept |
|
-primitive_iterator_t & | operator-= (difference_type n) noexcept |
+primitive_iterator_t & operator-= (difference_type n) noexcept |
|
diff --git a/docs/html/dir_c6827297b531e6e2845309f7363627c0.html b/docs/html/dir_c6827297b531e6e2845309f7363627c0.html
new file mode 100644
index 00000000..1fee306e
--- /dev/null
+++ b/docs/html/dir_c6827297b531e6e2845309f7363627c0.html
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+AlgoPlus: /Users/spirosmag/Documents/AlgoPlus/examples/machine_learning/polynomial_regression Directory Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+ AlgoPlus v0.1.0
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/html/dir_d09410b6ad7fc30a80642f4b107e6210.html b/docs/html/dir_d09410b6ad7fc30a80642f4b107e6210.html
index 290e2f0a..49a8c8b9 100644
--- a/docs/html/dir_d09410b6ad7fc30a80642f4b107e6210.html
+++ b/docs/html/dir_d09410b6ad7fc30a80642f4b107e6210.html
@@ -84,6 +84,8 @@
Directories
| linear_regression |
|
+ | polynomial_regression |
+ |
diff --git a/docs/html/dir_fc1b230756bbe02323cc6ab42a8d4043.html b/docs/html/dir_fc1b230756bbe02323cc6ab42a8d4043.html
new file mode 100644
index 00000000..d0afa2d6
--- /dev/null
+++ b/docs/html/dir_fc1b230756bbe02323cc6ab42a8d4043.html
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+AlgoPlus: /Users/spirosmag/Documents/AlgoPlus/src/machine_learning/regression/polynomial_regression Directory Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+ AlgoPlus v0.1.0
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/html/doxygen_crawl.html b/docs/html/doxygen_crawl.html
index 5b761750..866d7adc 100644
--- a/docs/html/doxygen_crawl.html
+++ b/docs/html/doxygen_crawl.html
@@ -62,6 +62,7 @@
+
@@ -170,6 +171,8 @@
+
+
@@ -372,16 +375,16 @@
+
+
+
+
-
-
-
-
@@ -808,6 +811,8 @@
+
+
diff --git a/docs/html/json_8hpp_source.html b/docs/html/json_8hpp_source.html
index cfde7923..2d52a5e7 100644
--- a/docs/html/json_8hpp_source.html
+++ b/docs/html/json_8hpp_source.html
@@ -4717,13 +4717,13 @@
4663template<
typename BasicJsonType>
- 4664inline void from_json(
const BasicJsonType&
j,
typename std::nullptr_t&
n)
+ 4664inline void from_json(
const BasicJsonType&
j,
typename std::nullptr_t& n)
4666 if (JSON_HEDLEY_UNLIKELY(!
j.is_null()))
4668 JSON_THROW(type_error::create(302, concat(
"type must be null, but is ",
j.type_name()), &
j));
-
+
diff --git a/docs/html/namespacedetail.html b/docs/html/namespacedetail.html
index 55193787..1aff898b 100644
--- a/docs/html/namespacedetail.html
+++ b/docs/html/namespacedetail.html
@@ -763,7 +763,7 @@
|
template<typename BasicJsonType > |
-void | from_json (const BasicJsonType &j, typename std::nullptr_t &n) |
+void | from_json (const BasicJsonType &j, typename std::nullptr_t &n) |
|
template<typename BasicJsonType , typename ArithmeticType , enable_if_t< std::is_arithmetic< ArithmeticType >::value &&!std::is_same< ArithmeticType, typename BasicJsonType::boolean_t >::value, int > = 0> |
diff --git a/docs/html/namespacedetail_1_1dtoa__impl.html b/docs/html/namespacedetail_1_1dtoa__impl.html
index 4fdb5d96..79557a49 100644
--- a/docs/html/namespacedetail_1_1dtoa__impl.html
+++ b/docs/html/namespacedetail_1_1dtoa__impl.html
@@ -107,7 +107,7 @@
|
cached_power | get_cached_power_for_binary_exponent (int e) |
|
-int | find_largest_pow10 (const std::uint32_t n, std::uint32_t &pow10) |
+int | find_largest_pow10 (const std::uint32_t n, std::uint32_t &pow10) |
|
void | grisu2_round (char *buf, int len, std::uint64_t dist, std::uint64_t delta, std::uint64_t rest, std::uint64_t ten_k) |
diff --git a/docs/html/poly__reg_8h_source.html b/docs/html/poly__reg_8h_source.html
new file mode 100644
index 00000000..84a9d20f
--- /dev/null
+++ b/docs/html/poly__reg_8h_source.html
@@ -0,0 +1,192 @@
+
+
+
+
+
+
+
+AlgoPlus: /Users/spirosmag/Documents/AlgoPlus/src/machine_learning/regression/polynomial_regression/poly_reg.h Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+ AlgoPlus v0.1.0
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
13 std::vector<double> X;
+
14 std::vector<double> Y;
+
+
+
+
18 explicit polynomial_regression(std::vector<double> X, std::vector<double> Y, int64_t n) noexcept : X(X), Y(Y), n(n) {}
+
+
20 std::vector<double> get_coeffs(){
+
21 std::vector<std::vector<double>> k = calculate_matrix(this->X, this->n);
+
22 std::vector<double> l = calculate_vector(this->X, this->Y, this->n);
+
23 std::vector<double> b_coeffs = solve_linear_system(k, l);
+
+
+
+
27 std::vector<std::vector<double>> create_matrix(int64_t rows, int64_t cols) {
+
28 return std::vector<std::vector<double>>(rows, std::vector<double>(cols, 0.0));
+
+
+
31 std::vector<std::vector<double>> calculate_matrix(
const std::vector<double>& x, int64_t n) {
+
+
33 auto matrix = create_matrix(n + 1, n + 1);
+
34 for (int64_t i = 0; i <= n; ++i) {
+
35 for (int64_t j = 0; j <= n; ++j) {
+
36 for (int64_t k = 0; k < m; ++k) {
+
37 matrix[i][j] += pow(x[k], i + j);
+
+
+
+
+
+
+
44 std::vector<double> calculate_vector(
const std::vector<double>& x,
const std::vector<double>& y, int64_t n) {
+
+
46 std::vector<double> vector(n + 1, 0.0);
+
47 for (int64_t i = 0; i <= n; ++i) {
+
48 for (int64_t k = 0; k < m; ++k) {
+
49 vector[i] += y[k] * pow(x[k], i);
+
+
+
+
+
+
+
56 std::vector<double> solve_linear_system(std::vector<std::vector<double>> A, std::vector<double> b) {
+
+
58 for (int64_t i = 0; i < n; ++i) {
+
+
+
61 for (int64_t k = i + 1; k < n; ++k) {
+
62 if (abs(A[k][i]) > abs(A[maxRow][i])) {
+
+
+
+
+
67 std::swap(A[maxRow], A[i]);
+
68 std::swap(b[maxRow], b[i]);
+
+
70 for (int64_t k = i + 1; k < n; ++k) {
+
71 double c = -A[k][i] / A[i][i];
+
72 for (int64_t j = i; j < n; ++j) {
+
+
+
+
76 A[k][j] += c * A[i][j];
+
+
+
+
+
+
+
83 std::vector<double> x(n);
+
84 for (int64_t i = n - 1; i >= 0; --i) {
+
85 x[i] = b[i] / A[i][i];
+
86 for (int64_t k = i - 1; k >= 0; --k) {
+
87 b[k] -= A[k][i] * x[i];
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/html/search/all_15.js b/docs/html/search/all_15.js
index a49d8192..d1d2edc7 100644
--- a/docs/html/search/all_15.js
+++ b/docs/html/search/all_15.js
@@ -17,34 +17,35 @@ var searchData=
['plot_5fimpl_3c_20std_3a_3atrue_5ftype_20_3e_14',['plot_impl< std::true_type >',['../structmatplotlibcpp_1_1detail_1_1plot__impl_3_01std_1_1true__type_01_4.html',1,'matplotlibcpp::detail']]],
['pluralise_15',['pluralise',['../struct_catch_1_1pluralise.html',1,'Catch']]],
['pointer_16',['pointer',['../classdetail_1_1iter__impl.html#a5f32f4fdd48a9b92ecb156af6421b1b8',1,'detail::iter_impl::pointer'],['../classbasic__json.html#a84279673ab13fb6360cf17173a29a1f1',1,'basic_json::pointer']]],
- ['pop_17',['pop',['../classstack__list.html#a1e95582086ed2d898a62c17d8a237e5d',1,'stack_list']]],
- ['pop_20strong_20_3a_18',['<strong>pop</strong>:',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2stack.html#autotoc_md146',1,'']]],
- ['pop_5fback_19',['pop_back',['../classdequeue__list.html#a06ae5994e52c6fa82995fced1555d7be',1,'dequeue_list::pop_back()'],['../classjson__pointer.html#a662118b470c87a1b564946c2602c49ce',1,'json_pointer::pop_back()']]],
- ['pop_5fback_20strong_20_3a_20',['<strong>pop_back</strong>:',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2dequeue.html#autotoc_md62',1,'']]],
- ['pop_5ffront_21',['pop_front',['../classdequeue__list.html#a30a8222a95d7ab43b78d590f1415fa41',1,'dequeue_list']]],
- ['pop_5ffront_20strong_20_3a_22',['<strong>pop_front</strong>:',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2dequeue.html#autotoc_md61',1,'']]],
- ['position_5ft_23',['position_t',['../structdetail_1_1position__t.html',1,'detail']]],
- ['postorder_24',['postorder',['../classavl__tree.html#a82a19335d79d5f6928369635278c1c24',1,'avl_tree::postorder()'],['../classbst.html#a60575db4d925e7f08202549df73d0d9b',1,'bst::postorder()'],['../classinterval__tree.html#ad9fdedfea81952b61fb60b966849d911',1,'interval_tree::postorder()'],['../classsplay__tree.html#a0a344c13f06a9f9666d8225264897553',1,'splay_tree::postorder()'],['../classtree.html#a1f3f031770fcf1490f2a8a56d8573c72',1,'tree::postorder()']]],
- ['postorder_20strong_20_3a_25',['Postorder strong :',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2avl.html#autotoc_md30',1,'<strong>postorder</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2bst.html#autotoc_md39',1,'<strong>postorder</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2interval__tree.html#autotoc_md110',1,'<strong>postorder</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2splay__tree.html#autotoc_md140',1,'<strong>postorder</strong>:']]],
- ['predicatematcher_26',['PredicateMatcher',['../class_catch_1_1_matchers_1_1_generic_1_1_predicate_matcher.html',1,'Catch::Matchers::Generic']]],
- ['preorder_27',['preorder',['../classavl__tree.html#a8b6368356a04a58f29b1f56f835b7548',1,'avl_tree::preorder()'],['../classbst.html#a4c3359b500e074fce8d1f3eae21dfdca',1,'bst::preorder()'],['../classinterval__tree.html#ab8c4a843dab72278f269ffe034f30f06',1,'interval_tree::preorder()'],['../classsplay__tree.html#a8c943a8d38b1e57f8e45686bf45c3e43',1,'splay_tree::preorder()'],['../classtree.html#a63caa8ece1a8503f591e60dd48bde102',1,'tree::preorder()']]],
- ['preorder_20strong_20_3a_28',['Preorder strong :',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2avl.html#autotoc_md29',1,'<strong>preorder</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2bst.html#autotoc_md38',1,'<strong>preorder</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2interval__tree.html#autotoc_md109',1,'<strong>preorder</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2splay__tree.html#autotoc_md139',1,'<strong>preorder</strong>:']]],
- ['prim_29',['prim',['../classweighted__graph.html#af6623f21c14c98732dc1c2595307fb7a',1,'weighted_graph']]],
- ['prim_20strong_20_3a_30',['<strong>prim</strong>:',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2graph.html#autotoc_md91',1,'']]],
- ['primitive_5fiterator_31',['primitive_iterator',['../structdetail_1_1internal__iterator.html#a8bb8034d2d35fb129e0dd742ce024e44',1,'detail::internal_iterator']]],
- ['primitive_5fiterator_5ft_32',['primitive_iterator_t',['../classdetail_1_1primitive__iterator__t.html',1,'detail']]],
- ['priority_5ftag_33',['priority_tag',['../structdetail_1_1priority__tag.html',1,'detail']]],
- ['priority_5ftag_3c_200_20_3e_34',['priority_tag< 0 >',['../structdetail_1_1priority__tag_3_010_01_4.html',1,'detail']]],
- ['purposes_20you_20can_20write_20to_20a_20json_20file_20and_20then_20use_20the_20python_20s_20matplotlib_20function_3a_20strong_20_3a_35',['<strong>optionally for visualization purposes you can write to a json file and then use the python's matplotlib function:</strong>:',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2_d_b_s_c_a_n.html#autotoc_md55',1,'']]],
- ['purposes_20you_20can_20write_20to_20a_20json_20file_20and_20then_20visualize_20it_20with_20python_20s_20matplotlib_3a_20strong_20_3a_36',['<strong>optionally for visualization purposes you can write to a json file and then visualize it with python's matplotlib:</strong>:',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2kmeans.html#autotoc_md116',1,'']]],
- ['purposes_3a_20strong_37',['<strong>Optionally you can use python's matplotlib for visualization purposes:</strong>',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2linear__regression.html#autotoc_md119',1,'']]],
- ['push_38',['push',['../classstack__list.html#a4ba916c3846e16b81bfd18194bab9808',1,'stack_list']]],
- ['push_20strong_20_3a_39',['<strong>push</strong>:',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2stack.html#autotoc_md144',1,'']]],
- ['push_5fback_40',['push_back',['../classcircular__linked__list.html#a3f7dae009cc9d2cbf634f9cad3eb3651',1,'circular_linked_list::push_back()'],['../classdoubly__linked__list.html#a0d7d611c1c937954e4fdbe866d542c23',1,'doubly_linked_list::push_back()'],['../classfrequency__list.html#aaa6570efed6d63daeeda8ca1743d0d68',1,'frequency_list::push_back()'],['../classlinked__list.html#a6ca7bbbcf82ba896aa89dde77ee48fde',1,'linked_list::push_back()'],['../classdequeue__list.html#a6bb8882f621456fea94b6023ced7c3bd',1,'dequeue_list::push_back()'],['../classjson__pointer.html#adbe97f9c00a221fb7be88d940b39a24f',1,'json_pointer::push_back(const string_t &token)'],['../classjson__pointer.html#a6fa4848eafc232ae1af91c3d2696897e',1,'json_pointer::push_back(string_t &&token)'],['../classbasic__json.html#a3d13acce4e49e0d5ee768643a7b89010',1,'basic_json::push_back(basic_json &&val)'],['../classbasic__json.html#aca01ca3a9bc310e5c5d067a39dca6933',1,'basic_json::push_back(const basic_json &val)'],['../classbasic__json.html#af17fe93acad9b0b991600225dabd42be',1,'basic_json::push_back(const typename object_t::value_type &val)'],['../classbasic__json.html#a4fcacc90f17b156f0b6c8e0430624853',1,'basic_json::push_back(initializer_list_t init)']]],
- ['push_5fback_20strong_20_3a_41',['Push_back strong :',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2circular__linked__list.html#autotoc_md43',1,'<strong>push_back</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2dequeue.html#autotoc_md57',1,'<strong>push_back</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2doubly__linked__list.html#autotoc_md65',1,'<strong>push_back</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2frequency__list.html#autotoc_md74',1,'<strong>push_back</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2linked__list.html#autotoc_md121',1,'<strong>push_back</strong>:']]],
- ['push_5ffront_42',['push_front',['../classcircular__linked__list.html#a5caccafa9f77dcfdfb1bad669877f609',1,'circular_linked_list::push_front()'],['../classdoubly__linked__list.html#a9132ebf985d2c3192cd93e91736c2bb6',1,'doubly_linked_list::push_front()'],['../classfrequency__list.html#a1eb001ee71276afe20e2b71bef50682e',1,'frequency_list::push_front()'],['../classlinked__list.html#a102388da0f9ed50e736eed9ada84a920',1,'linked_list::push_front()'],['../classdequeue__list.html#a87f40862616d3964c51aa84da8714e5e',1,'dequeue_list::push_front()']]],
- ['push_5ffront_20strong_20_3a_43',['Push_front strong :',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2circular__linked__list.html#autotoc_md44',1,'<strong>push_front</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2dequeue.html#autotoc_md58',1,'<strong>push_front</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2doubly__linked__list.html#autotoc_md66',1,'<strong>push_front</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2frequency__list.html#autotoc_md75',1,'<strong>push_front</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2linked__list.html#autotoc_md122',1,'<strong>push_front</strong>:']]],
- ['python_20s_20matplotlib_20for_20visualization_20purposes_3a_20strong_44',['<strong>Optionally you can use python's matplotlib for visualization purposes:</strong>',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2linear__regression.html#autotoc_md119',1,'']]],
- ['python_20s_20matplotlib_20function_3a_20strong_20_3a_45',['<strong>optionally for visualization purposes you can write to a json file and then use the python's matplotlib function:</strong>:',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2_d_b_s_c_a_n.html#autotoc_md55',1,'']]],
- ['python_20s_20matplotlib_3a_20strong_20_3a_46',['<strong>optionally for visualization purposes you can write to a json file and then visualize it with python's matplotlib:</strong>:',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2kmeans.html#autotoc_md116',1,'']]]
+ ['polynomial_5fregression_17',['polynomial_regression',['../classpolynomial__regression.html',1,'']]],
+ ['pop_18',['pop',['../classstack__list.html#a1e95582086ed2d898a62c17d8a237e5d',1,'stack_list']]],
+ ['pop_20strong_20_3a_19',['<strong>pop</strong>:',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2stack.html#autotoc_md146',1,'']]],
+ ['pop_5fback_20',['pop_back',['../classdequeue__list.html#a06ae5994e52c6fa82995fced1555d7be',1,'dequeue_list::pop_back()'],['../classjson__pointer.html#a662118b470c87a1b564946c2602c49ce',1,'json_pointer::pop_back()']]],
+ ['pop_5fback_20strong_20_3a_21',['<strong>pop_back</strong>:',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2dequeue.html#autotoc_md62',1,'']]],
+ ['pop_5ffront_22',['pop_front',['../classdequeue__list.html#a30a8222a95d7ab43b78d590f1415fa41',1,'dequeue_list']]],
+ ['pop_5ffront_20strong_20_3a_23',['<strong>pop_front</strong>:',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2dequeue.html#autotoc_md61',1,'']]],
+ ['position_5ft_24',['position_t',['../structdetail_1_1position__t.html',1,'detail']]],
+ ['postorder_25',['postorder',['../classavl__tree.html#a82a19335d79d5f6928369635278c1c24',1,'avl_tree::postorder()'],['../classbst.html#a60575db4d925e7f08202549df73d0d9b',1,'bst::postorder()'],['../classinterval__tree.html#ad9fdedfea81952b61fb60b966849d911',1,'interval_tree::postorder()'],['../classsplay__tree.html#a0a344c13f06a9f9666d8225264897553',1,'splay_tree::postorder()'],['../classtree.html#a1f3f031770fcf1490f2a8a56d8573c72',1,'tree::postorder()']]],
+ ['postorder_20strong_20_3a_26',['Postorder strong :',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2avl.html#autotoc_md30',1,'<strong>postorder</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2bst.html#autotoc_md39',1,'<strong>postorder</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2interval__tree.html#autotoc_md110',1,'<strong>postorder</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2splay__tree.html#autotoc_md140',1,'<strong>postorder</strong>:']]],
+ ['predicatematcher_27',['PredicateMatcher',['../class_catch_1_1_matchers_1_1_generic_1_1_predicate_matcher.html',1,'Catch::Matchers::Generic']]],
+ ['preorder_28',['preorder',['../classavl__tree.html#a8b6368356a04a58f29b1f56f835b7548',1,'avl_tree::preorder()'],['../classbst.html#a4c3359b500e074fce8d1f3eae21dfdca',1,'bst::preorder()'],['../classinterval__tree.html#ab8c4a843dab72278f269ffe034f30f06',1,'interval_tree::preorder()'],['../classsplay__tree.html#a8c943a8d38b1e57f8e45686bf45c3e43',1,'splay_tree::preorder()'],['../classtree.html#a63caa8ece1a8503f591e60dd48bde102',1,'tree::preorder()']]],
+ ['preorder_20strong_20_3a_29',['Preorder strong :',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2avl.html#autotoc_md29',1,'<strong>preorder</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2bst.html#autotoc_md38',1,'<strong>preorder</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2interval__tree.html#autotoc_md109',1,'<strong>preorder</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2splay__tree.html#autotoc_md139',1,'<strong>preorder</strong>:']]],
+ ['prim_30',['prim',['../classweighted__graph.html#af6623f21c14c98732dc1c2595307fb7a',1,'weighted_graph']]],
+ ['prim_20strong_20_3a_31',['<strong>prim</strong>:',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2graph.html#autotoc_md91',1,'']]],
+ ['primitive_5fiterator_32',['primitive_iterator',['../structdetail_1_1internal__iterator.html#a8bb8034d2d35fb129e0dd742ce024e44',1,'detail::internal_iterator']]],
+ ['primitive_5fiterator_5ft_33',['primitive_iterator_t',['../classdetail_1_1primitive__iterator__t.html',1,'detail']]],
+ ['priority_5ftag_34',['priority_tag',['../structdetail_1_1priority__tag.html',1,'detail']]],
+ ['priority_5ftag_3c_200_20_3e_35',['priority_tag< 0 >',['../structdetail_1_1priority__tag_3_010_01_4.html',1,'detail']]],
+ ['purposes_20you_20can_20write_20to_20a_20json_20file_20and_20then_20use_20the_20python_20s_20matplotlib_20function_3a_20strong_20_3a_36',['<strong>optionally for visualization purposes you can write to a json file and then use the python's matplotlib function:</strong>:',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2_d_b_s_c_a_n.html#autotoc_md55',1,'']]],
+ ['purposes_20you_20can_20write_20to_20a_20json_20file_20and_20then_20visualize_20it_20with_20python_20s_20matplotlib_3a_20strong_20_3a_37',['<strong>optionally for visualization purposes you can write to a json file and then visualize it with python's matplotlib:</strong>:',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2kmeans.html#autotoc_md116',1,'']]],
+ ['purposes_3a_20strong_38',['<strong>Optionally you can use python's matplotlib for visualization purposes:</strong>',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2linear__regression.html#autotoc_md119',1,'']]],
+ ['push_39',['push',['../classstack__list.html#a4ba916c3846e16b81bfd18194bab9808',1,'stack_list']]],
+ ['push_20strong_20_3a_40',['<strong>push</strong>:',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2stack.html#autotoc_md144',1,'']]],
+ ['push_5fback_41',['push_back',['../classcircular__linked__list.html#a3f7dae009cc9d2cbf634f9cad3eb3651',1,'circular_linked_list::push_back()'],['../classdoubly__linked__list.html#a0d7d611c1c937954e4fdbe866d542c23',1,'doubly_linked_list::push_back()'],['../classfrequency__list.html#aaa6570efed6d63daeeda8ca1743d0d68',1,'frequency_list::push_back()'],['../classlinked__list.html#a6ca7bbbcf82ba896aa89dde77ee48fde',1,'linked_list::push_back()'],['../classdequeue__list.html#a6bb8882f621456fea94b6023ced7c3bd',1,'dequeue_list::push_back()'],['../classjson__pointer.html#adbe97f9c00a221fb7be88d940b39a24f',1,'json_pointer::push_back(const string_t &token)'],['../classjson__pointer.html#a6fa4848eafc232ae1af91c3d2696897e',1,'json_pointer::push_back(string_t &&token)'],['../classbasic__json.html#a3d13acce4e49e0d5ee768643a7b89010',1,'basic_json::push_back(basic_json &&val)'],['../classbasic__json.html#aca01ca3a9bc310e5c5d067a39dca6933',1,'basic_json::push_back(const basic_json &val)'],['../classbasic__json.html#af17fe93acad9b0b991600225dabd42be',1,'basic_json::push_back(const typename object_t::value_type &val)'],['../classbasic__json.html#a4fcacc90f17b156f0b6c8e0430624853',1,'basic_json::push_back(initializer_list_t init)']]],
+ ['push_5fback_20strong_20_3a_42',['Push_back strong :',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2circular__linked__list.html#autotoc_md43',1,'<strong>push_back</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2dequeue.html#autotoc_md57',1,'<strong>push_back</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2doubly__linked__list.html#autotoc_md65',1,'<strong>push_back</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2frequency__list.html#autotoc_md74',1,'<strong>push_back</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2linked__list.html#autotoc_md121',1,'<strong>push_back</strong>:']]],
+ ['push_5ffront_43',['push_front',['../classcircular__linked__list.html#a5caccafa9f77dcfdfb1bad669877f609',1,'circular_linked_list::push_front()'],['../classdoubly__linked__list.html#a9132ebf985d2c3192cd93e91736c2bb6',1,'doubly_linked_list::push_front()'],['../classfrequency__list.html#a1eb001ee71276afe20e2b71bef50682e',1,'frequency_list::push_front()'],['../classlinked__list.html#a102388da0f9ed50e736eed9ada84a920',1,'linked_list::push_front()'],['../classdequeue__list.html#a87f40862616d3964c51aa84da8714e5e',1,'dequeue_list::push_front()']]],
+ ['push_5ffront_20strong_20_3a_44',['Push_front strong :',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2circular__linked__list.html#autotoc_md44',1,'<strong>push_front</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2dequeue.html#autotoc_md58',1,'<strong>push_front</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2doubly__linked__list.html#autotoc_md66',1,'<strong>push_front</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2frequency__list.html#autotoc_md75',1,'<strong>push_front</strong>:'],['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2linked__list.html#autotoc_md122',1,'<strong>push_front</strong>:']]],
+ ['python_20s_20matplotlib_20for_20visualization_20purposes_3a_20strong_45',['<strong>Optionally you can use python's matplotlib for visualization purposes:</strong>',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2linear__regression.html#autotoc_md119',1,'']]],
+ ['python_20s_20matplotlib_20function_3a_20strong_20_3a_46',['<strong>optionally for visualization purposes you can write to a json file and then use the python's matplotlib function:</strong>:',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2_d_b_s_c_a_n.html#autotoc_md55',1,'']]],
+ ['python_20s_20matplotlib_3a_20strong_20_3a_47',['<strong>optionally for visualization purposes you can write to a json file and then visualize it with python's matplotlib:</strong>:',['../md__2_users_2spirosmag_2_documents_2_algo_plus_2tutorial_2kmeans.html#autotoc_md116',1,'']]]
];
diff --git a/docs/html/search/classes_10.js b/docs/html/search/classes_10.js
index e2b5f3c5..7bacaa66 100644
--- a/docs/html/search/classes_10.js
+++ b/docs/html/search/classes_10.js
@@ -7,9 +7,10 @@ var searchData=
['plot_5fimpl_3c_20std_3a_3afalse_5ftype_20_3e_4',['plot_impl< std::false_type >',['../structmatplotlibcpp_1_1detail_1_1plot__impl_3_01std_1_1false__type_01_4.html',1,'matplotlibcpp::detail']]],
['plot_5fimpl_3c_20std_3a_3atrue_5ftype_20_3e_5',['plot_impl< std::true_type >',['../structmatplotlibcpp_1_1detail_1_1plot__impl_3_01std_1_1true__type_01_4.html',1,'matplotlibcpp::detail']]],
['pluralise_6',['pluralise',['../struct_catch_1_1pluralise.html',1,'Catch']]],
- ['position_5ft_7',['position_t',['../structdetail_1_1position__t.html',1,'detail']]],
- ['predicatematcher_8',['PredicateMatcher',['../class_catch_1_1_matchers_1_1_generic_1_1_predicate_matcher.html',1,'Catch::Matchers::Generic']]],
- ['primitive_5fiterator_5ft_9',['primitive_iterator_t',['../classdetail_1_1primitive__iterator__t.html',1,'detail']]],
- ['priority_5ftag_10',['priority_tag',['../structdetail_1_1priority__tag.html',1,'detail']]],
- ['priority_5ftag_3c_200_20_3e_11',['priority_tag< 0 >',['../structdetail_1_1priority__tag_3_010_01_4.html',1,'detail']]]
+ ['polynomial_5fregression_7',['polynomial_regression',['../classpolynomial__regression.html',1,'']]],
+ ['position_5ft_8',['position_t',['../structdetail_1_1position__t.html',1,'detail']]],
+ ['predicatematcher_9',['PredicateMatcher',['../class_catch_1_1_matchers_1_1_generic_1_1_predicate_matcher.html',1,'Catch::Matchers::Generic']]],
+ ['primitive_5fiterator_5ft_10',['primitive_iterator_t',['../classdetail_1_1primitive__iterator__t.html',1,'detail']]],
+ ['priority_5ftag_11',['priority_tag',['../structdetail_1_1priority__tag.html',1,'detail']]],
+ ['priority_5ftag_3c_200_20_3e_12',['priority_tag< 0 >',['../structdetail_1_1priority__tag_3_010_01_4.html',1,'detail']]]
];
diff --git a/docs/latex/annotated.tex b/docs/latex/annotated.tex
index f1cf9a26..e0afb093 100644
--- a/docs/latex/annotated.tex
+++ b/docs/latex/annotated.tex
@@ -262,6 +262,7 @@
\item\contentsline{section}{\mbox{\hyperlink{structmatplotlibcpp_1_1detail_1_1plot__impl_3_01std_1_1false__type_01_4}{matplotlibcpp\+::detail\+::plot\+\_\+impl$<$ std\+::false\+\_\+type $>$}} }{\pageref{structmatplotlibcpp_1_1detail_1_1plot__impl_3_01std_1_1false__type_01_4}}{}
\item\contentsline{section}{\mbox{\hyperlink{structmatplotlibcpp_1_1detail_1_1plot__impl_3_01std_1_1true__type_01_4}{matplotlibcpp\+::detail\+::plot\+\_\+impl$<$ std\+::true\+\_\+type $>$}} }{\pageref{structmatplotlibcpp_1_1detail_1_1plot__impl_3_01std_1_1true__type_01_4}}{}
\item\contentsline{section}{\mbox{\hyperlink{struct_catch_1_1pluralise}{Catch\+::pluralise}} }{\pageref{struct_catch_1_1pluralise}}{}
+\item\contentsline{section}{\mbox{\hyperlink{classpolynomial__regression}{polynomial\+\_\+regression}} }{\pageref{classpolynomial__regression}}{}
\item\contentsline{section}{\mbox{\hyperlink{structdetail_1_1position__t}{detail\+::position\+\_\+t}} \\*Struct to capture the start position of the current token }{\pageref{structdetail_1_1position__t}}{}
\item\contentsline{section}{\mbox{\hyperlink{class_catch_1_1_matchers_1_1_generic_1_1_predicate_matcher}{Catch\+::\+Matchers\+::\+Generic\+::\+Predicate\+Matcher$<$ T $>$}} }{\pageref{class_catch_1_1_matchers_1_1_generic_1_1_predicate_matcher}}{}
\item\contentsline{section}{\mbox{\hyperlink{classdetail_1_1primitive__iterator__t}{detail\+::primitive\+\_\+iterator\+\_\+t}} }{\pageref{classdetail_1_1primitive__iterator__t}}{}
diff --git a/docs/latex/classdetail_1_1iter__impl.tex b/docs/latex/classdetail_1_1iter__impl.tex
index ea89f2c9..42fd4857 100644
--- a/docs/latex/classdetail_1_1iter__impl.tex
+++ b/docs/latex/classdetail_1_1iter__impl.tex
@@ -82,7 +82,7 @@
\begin{DoxyCompactList}\small\item\em subtract from iterator \end{DoxyCompactList}\item
\mbox{\hyperlink{classdetail_1_1iter__impl_a6d51e1372282929d1c240223aa973c6e}{difference\+\_\+type}} \mbox{\hyperlink{classdetail_1_1iter__impl_a848837b8db99998c90d7bd71492d0dee}{operator-\/}} (\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{const}} \mbox{\hyperlink{classdetail_1_1iter__impl}{iter\+\_\+impl}} \&\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{other}}) \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{const}}
\begin{DoxyCompactList}\small\item\em return difference \end{DoxyCompactList}\item
-\mbox{\hyperlink{classdetail_1_1iter__impl_ac0cfb3a9727e77580cb1beada093ee81}{reference}} \mbox{\hyperlink{classdetail_1_1iter__impl_a5e557e30103e2af36cd8173c88eb586c}{operator\mbox{[}$\,$\mbox{]}}} (\mbox{\hyperlink{classdetail_1_1iter__impl_a6d51e1372282929d1c240223aa973c6e}{difference\+\_\+type}} \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{n}}) \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{const}}
+\mbox{\hyperlink{classdetail_1_1iter__impl_ac0cfb3a9727e77580cb1beada093ee81}{reference}} \mbox{\hyperlink{classdetail_1_1iter__impl_a5e557e30103e2af36cd8173c88eb586c}{operator\mbox{[}$\,$\mbox{]}}} (\mbox{\hyperlink{classdetail_1_1iter__impl_a6d51e1372282929d1c240223aa973c6e}{difference\+\_\+type}} n) \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{const}}
\begin{DoxyCompactList}\small\item\em access to successor \end{DoxyCompactList}\item
\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{const}} object\+\_\+t\+::key\+\_\+type \& \mbox{\hyperlink{classdetail_1_1iter__impl_a4064b295014b32f3cabd86f94264fc74}{key}} () \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{const}}
\begin{DoxyCompactList}\small\item\em return the key of an object iterator \end{DoxyCompactList}\item
diff --git a/docs/latex/classdetail_1_1json__reverse__iterator.tex b/docs/latex/classdetail_1_1json__reverse__iterator.tex
index 3e42e91d..07f932e7 100644
--- a/docs/latex/classdetail_1_1json__reverse__iterator.tex
+++ b/docs/latex/classdetail_1_1json__reverse__iterator.tex
@@ -61,7 +61,7 @@
difference\+\_\+type {\bfseries operator-\/} (\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{const}} \mbox{\hyperlink{classdetail_1_1json__reverse__iterator}{json\+\_\+reverse\+\_\+iterator}} \&\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{other}}) \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{const}}
\begin{DoxyCompactList}\small\item\em return difference \end{DoxyCompactList}\item
\Hypertarget{classdetail_1_1json__reverse__iterator_a50a57718a9d49039b7592bf34f5819a2}\label{classdetail_1_1json__reverse__iterator_a50a57718a9d49039b7592bf34f5819a2}
-\mbox{\hyperlink{classdetail_1_1json__reverse__iterator_a81a4d0a61246d4ece37fd14eacfadda0}{reference}} {\bfseries operator\mbox{[}$\,$\mbox{]}} (difference\+\_\+type \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{n}}) \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{const}}
+\mbox{\hyperlink{classdetail_1_1json__reverse__iterator_a81a4d0a61246d4ece37fd14eacfadda0}{reference}} {\bfseries operator\mbox{[}$\,$\mbox{]}} (difference\+\_\+type n) \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{const}}
\begin{DoxyCompactList}\small\item\em access to successor \end{DoxyCompactList}\item
\Hypertarget{classdetail_1_1json__reverse__iterator_a68d4f0c3e978afdc7509ee88e2f7b996}\label{classdetail_1_1json__reverse__iterator_a68d4f0c3e978afdc7509ee88e2f7b996}
\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{auto}} {\bfseries key} () \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{const}} -\/$>$ \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{decltype}}(std\+::declval$<$ \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{Base}} $>$().key())
diff --git a/docs/latex/classdetail_1_1primitive__iterator__t.tex b/docs/latex/classdetail_1_1primitive__iterator__t.tex
index e46ac2f8..aaa73150 100644
--- a/docs/latex/classdetail_1_1primitive__iterator__t.tex
+++ b/docs/latex/classdetail_1_1primitive__iterator__t.tex
@@ -19,7 +19,7 @@
\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{constexpr}} \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{bool}} {\bfseries is\+\_\+end} () \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{const}} \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{noexcept}}
\begin{DoxyCompactList}\small\item\em return whether the iterator is at end \end{DoxyCompactList}\item
\Hypertarget{classdetail_1_1primitive__iterator__t_acc22136675807ea8caccb944264ea918}\label{classdetail_1_1primitive__iterator__t_acc22136675807ea8caccb944264ea918}
-\mbox{\hyperlink{classdetail_1_1primitive__iterator__t}{primitive\+\_\+iterator\+\_\+t}} {\bfseries operator+} (difference\+\_\+type \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{n}}) \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{noexcept}}
+\mbox{\hyperlink{classdetail_1_1primitive__iterator__t}{primitive\+\_\+iterator\+\_\+t}} {\bfseries operator+} (difference\+\_\+type n) \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{noexcept}}
\item
\Hypertarget{classdetail_1_1primitive__iterator__t_a056779169e97913504f95584a37d1c8c}\label{classdetail_1_1primitive__iterator__t_a056779169e97913504f95584a37d1c8c}
\mbox{\hyperlink{classdetail_1_1primitive__iterator__t}{primitive\+\_\+iterator\+\_\+t}} \& {\bfseries operator++} () \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{noexcept}}
@@ -34,10 +34,10 @@
\mbox{\hyperlink{classdetail_1_1primitive__iterator__t}{primitive\+\_\+iterator\+\_\+t}} {\bfseries operator-\/-\/} (\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{int}}) \&\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{noexcept}}
\item
\Hypertarget{classdetail_1_1primitive__iterator__t_aa8b891476428688c867b2c9c9da96f23}\label{classdetail_1_1primitive__iterator__t_aa8b891476428688c867b2c9c9da96f23}
-\mbox{\hyperlink{classdetail_1_1primitive__iterator__t}{primitive\+\_\+iterator\+\_\+t}} \& {\bfseries operator+=} (difference\+\_\+type \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{n}}) \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{noexcept}}
+\mbox{\hyperlink{classdetail_1_1primitive__iterator__t}{primitive\+\_\+iterator\+\_\+t}} \& {\bfseries operator+=} (difference\+\_\+type n) \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{noexcept}}
\item
\Hypertarget{classdetail_1_1primitive__iterator__t_a06a467805e83af63b4428325889cf5c4}\label{classdetail_1_1primitive__iterator__t_a06a467805e83af63b4428325889cf5c4}
-\mbox{\hyperlink{classdetail_1_1primitive__iterator__t}{primitive\+\_\+iterator\+\_\+t}} \& {\bfseries operator-\/=} (difference\+\_\+type \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{n}}) \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{noexcept}}
+\mbox{\hyperlink{classdetail_1_1primitive__iterator__t}{primitive\+\_\+iterator\+\_\+t}} \& {\bfseries operator-\/=} (difference\+\_\+type n) \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{noexcept}}
\end{DoxyCompactItemize}
\doxysubsubsection*{Friends}
\begin{DoxyCompactItemize}
diff --git a/docs/latex/classpolynomial__regression.tex b/docs/latex/classpolynomial__regression.tex
new file mode 100644
index 00000000..a9edbc5f
--- /dev/null
+++ b/docs/latex/classpolynomial__regression.tex
@@ -0,0 +1,28 @@
+\doxysection{polynomial\+\_\+regression Class Reference}
+\hypertarget{classpolynomial__regression}{}\label{classpolynomial__regression}\index{polynomial\_regression@{polynomial\_regression}}
+\doxysubsubsection*{Public Member Functions}
+\begin{DoxyCompactItemize}
+\item
+\Hypertarget{classpolynomial__regression_abc56aea0b1b15ae8f9ccdb28c7180c2e}\label{classpolynomial__regression_abc56aea0b1b15ae8f9ccdb28c7180c2e}
+{\bfseries polynomial\+\_\+regression} (std\+::vector$<$ double $>$ X, std\+::vector$<$ double $>$ Y, int64\+\_\+t n) noexcept
+\item
+\Hypertarget{classpolynomial__regression_ab59211874dbedb499d5d3ebc0b1e0cba}\label{classpolynomial__regression_ab59211874dbedb499d5d3ebc0b1e0cba}
+std\+::vector$<$ double $>$ {\bfseries get\+\_\+coeffs} ()
+\item
+\Hypertarget{classpolynomial__regression_a982d6651d50f6c17a47a21176d1b83c7}\label{classpolynomial__regression_a982d6651d50f6c17a47a21176d1b83c7}
+std\+::vector$<$ std\+::vector$<$ double $>$ $>$ {\bfseries create\+\_\+matrix} (int64\+\_\+t rows, int64\+\_\+t cols)
+\item
+\Hypertarget{classpolynomial__regression_abbd83ea7f2c14b832571bfc3ec1d3f93}\label{classpolynomial__regression_abbd83ea7f2c14b832571bfc3ec1d3f93}
+std\+::vector$<$ std\+::vector$<$ double $>$ $>$ {\bfseries calculate\+\_\+matrix} (const std\+::vector$<$ double $>$ \&x, int64\+\_\+t n)
+\item
+\Hypertarget{classpolynomial__regression_a31f904b1b926993a6e6e8a605f50ce6c}\label{classpolynomial__regression_a31f904b1b926993a6e6e8a605f50ce6c}
+std\+::vector$<$ double $>$ {\bfseries calculate\+\_\+vector} (const std\+::vector$<$ double $>$ \&x, const std\+::vector$<$ double $>$ \&y, int64\+\_\+t n)
+\item
+\Hypertarget{classpolynomial__regression_af2c743ad410fbb4f6e85ecbbf2b3c78f}\label{classpolynomial__regression_af2c743ad410fbb4f6e85ecbbf2b3c78f}
+std\+::vector$<$ double $>$ {\bfseries solve\+\_\+linear\+\_\+system} (std\+::vector$<$ std\+::vector$<$ double $>$ $>$ A, std\+::vector$<$ double $>$ b)
+\end{DoxyCompactItemize}
+
+
+The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
+\item
+/\+Users/spirosmag/\+Documents/\+Algo\+Plus/src/machine\+\_\+learning/regression/polynomial\+\_\+regression/poly\+\_\+reg.\+h\end{DoxyCompactItemize}
diff --git a/docs/latex/files.tex b/docs/latex/files.tex
index fcb805ea..26aa5801 100644
--- a/docs/latex/files.tex
+++ b/docs/latex/files.tex
@@ -54,6 +54,7 @@
\item\contentsline{section}{/\+Users/spirosmag/\+Documents/\+Algo\+Plus/src/machine\+\_\+learning/image/\mbox{\hyperlink{__image_8h_source}{\+\_\+image.\+h}} }{\pageref{__image_8h_source}}{}
\item\contentsline{section}{/\+Users/spirosmag/\+Documents/\+Algo\+Plus/src/machine\+\_\+learning/image/\mbox{\hyperlink{huffman__encoding_8h_source}{huffman\+\_\+encoding.\+h}} }{\pageref{huffman__encoding_8h_source}}{}
\item\contentsline{section}{/\+Users/spirosmag/\+Documents/\+Algo\+Plus/src/machine\+\_\+learning/regression/linear\+\_\+regression/\mbox{\hyperlink{lin__reg_8h_source}{lin\+\_\+reg.\+h}} }{\pageref{lin__reg_8h_source}}{}
+\item\contentsline{section}{/\+Users/spirosmag/\+Documents/\+Algo\+Plus/src/machine\+\_\+learning/regression/polynomial\+\_\+regression/\mbox{\hyperlink{poly__reg_8h_source}{poly\+\_\+reg.\+h}} }{\pageref{poly__reg_8h_source}}{}
\item\contentsline{section}{/\+Users/spirosmag/\+Documents/\+Algo\+Plus/src/machine\+\_\+learning/search\+\_\+algorithms/best\+\_\+first/\mbox{\hyperlink{best__first_8h_source}{best\+\_\+first.\+h}} }{\pageref{best__first_8h_source}}{}
\item\contentsline{section}{/\+Users/spirosmag/\+Documents/\+Algo\+Plus/src/machine\+\_\+learning/search\+\_\+algorithms/hill\+\_\+climbing/\mbox{\hyperlink{hill__climbing_8h_source}{hill\+\_\+climbing.\+h}} }{\pageref{hill__climbing_8h_source}}{}
\item\contentsline{section}{/\+Users/spirosmag/\+Documents/\+Algo\+Plus/src/visualization/graph\+\_\+visual/\mbox{\hyperlink{graph__visualization_8h_source}{graph\+\_\+visualization.\+h}} }{\pageref{graph__visualization_8h_source}}{}
diff --git a/docs/latex/hierarchy.tex b/docs/latex/hierarchy.tex
index 7e916b14..0f028ea2 100644
--- a/docs/latex/hierarchy.tex
+++ b/docs/latex/hierarchy.tex
@@ -364,6 +364,7 @@
\item \contentsline{section}{matplotlibcpp\+::detail\+::plot\+\_\+impl\texorpdfstring{$<$}{<} std\+::false\+\_\+type \texorpdfstring{$>$}{>}}{\pageref{structmatplotlibcpp_1_1detail_1_1plot__impl_3_01std_1_1false__type_01_4}}{}
\item \contentsline{section}{matplotlibcpp\+::detail\+::plot\+\_\+impl\texorpdfstring{$<$}{<} std\+::true\+\_\+type \texorpdfstring{$>$}{>}}{\pageref{structmatplotlibcpp_1_1detail_1_1plot__impl_3_01std_1_1true__type_01_4}}{}
\item \contentsline{section}{Catch\+::pluralise}{\pageref{struct_catch_1_1pluralise}}{}
+\item \contentsline{section}{polynomial\+\_\+regression}{\pageref{classpolynomial__regression}}{}
\item \contentsline{section}{detail\+::position\+\_\+t}{\pageref{structdetail_1_1position__t}}{}
\item \contentsline{section}{detail\+::primitive\+\_\+iterator\+\_\+t}{\pageref{classdetail_1_1primitive__iterator__t}}{}
\item \contentsline{section}{detail\+::priority\+\_\+tag\texorpdfstring{$<$}{<} N \texorpdfstring{$>$}{>}}{\pageref{structdetail_1_1priority__tag}}{}
diff --git a/docs/latex/json_8hpp_source.tex b/docs/latex/json_8hpp_source.tex
index 51533110..b6dc1c75 100644
--- a/docs/latex/json_8hpp_source.tex
+++ b/docs/latex/json_8hpp_source.tex
@@ -4495,13 +4495,13 @@
\DoxyCodeLine{04661\ \{}
\DoxyCodeLine{04662\ }
\DoxyCodeLine{04663\ \textcolor{keyword}{template}<\textcolor{keyword}{typename}\ BasicJsonType>}
-\DoxyCodeLine{04664\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ from\_json(\textcolor{keyword}{const}\ BasicJsonType\&\ \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{j}},\ \textcolor{keyword}{typename}\ std::nullptr\_t\&\ \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{n}})}
+\DoxyCodeLine{04664\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ from\_json(\textcolor{keyword}{const}\ BasicJsonType\&\ \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{j}},\ \textcolor{keyword}{typename}\ std::nullptr\_t\&\ n)}
\DoxyCodeLine{04665\ \{}
\DoxyCodeLine{04666\ \ \ \ \ \textcolor{keywordflow}{if}\ (JSON\_HEDLEY\_UNLIKELY(!\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{j}}.is\_null()))}
\DoxyCodeLine{04667\ \ \ \ \ \{}
\DoxyCodeLine{04668\ \ \ \ \ \ \ \ \ JSON\_THROW(type\_error::create(302,\ concat(\textcolor{stringliteral}{"{}type\ must\ be\ null,\ but\ is\ "{}},\ \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{j}}.type\_name()),\ \&\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{j}}));}
\DoxyCodeLine{04669\ \ \ \ \ \}}
-\DoxyCodeLine{04670\ \ \ \ \ \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{n}}\ =\ \textcolor{keyword}{nullptr};}
+\DoxyCodeLine{04670\ \ \ \ \ n\ =\ \textcolor{keyword}{nullptr};}
\DoxyCodeLine{04671\ \}}
\DoxyCodeLine{04672\ }
\DoxyCodeLine{04673\ \textcolor{comment}{//\ overloads\ for\ basic\_json\ template\ parameters}}
diff --git a/docs/latex/namespacedetail.tex b/docs/latex/namespacedetail.tex
index 6e44993b..cc91c946 100644
--- a/docs/latex/namespacedetail.tex
+++ b/docs/latex/namespacedetail.tex
@@ -575,7 +575,7 @@
{\footnotesize template$<$\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{typename}} \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{Out\+String\+Type}} = std\+::string, typename... Args$>$ }\\\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{Out\+String\+Type}} {\bfseries concat} (\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{Args}} \&\&... \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{args}})
\item
\Hypertarget{namespacedetail_ac8fc7fc4703cbd8edd7bb43a94adf92b}\label{namespacedetail_ac8fc7fc4703cbd8edd7bb43a94adf92b}
-{\footnotesize template$<$\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{typename}} Basic\+Json\+Type $>$ }\\\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{void}} {\bfseries from\+\_\+json} (\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{const}} Basic\+Json\+Type \&\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{j}}, \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{typename}} std\+::nullptr\+\_\+t \&\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{n}})
+{\footnotesize template$<$\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{typename}} Basic\+Json\+Type $>$ }\\\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{void}} {\bfseries from\+\_\+json} (\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{const}} Basic\+Json\+Type \&\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{j}}, \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{typename}} std\+::nullptr\+\_\+t \&n)
\item
\Hypertarget{namespacedetail_ad10dc6af43ec8e72954eb2ac08c8698b}\label{namespacedetail_ad10dc6af43ec8e72954eb2ac08c8698b}
{\footnotesize template$<$\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{typename}} Basic\+Json\+Type , \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{typename}} \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{Arithmetic\+Type}} , enable\+\_\+if\+\_\+t$<$ std\+::is\+\_\+arithmetic$<$ \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{Arithmetic\+Type}} $>$\mbox{\hyperlink{namespacedetail_a47b1bb0bbd3596589ed9187059c312efa2063c1608d6e0baf80249c42e2be5804}{\+::value}} \&\&!std\+::is\+\_\+same$<$ \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{Arithmetic\+Type}}, \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{typename}} Basic\+Json\+Type\+::boolean\+\_\+t $>$\mbox{\hyperlink{namespacedetail_a47b1bb0bbd3596589ed9187059c312efa2063c1608d6e0baf80249c42e2be5804}{\+::value}}, \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{int}} $>$ = 0$>$ }\\\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{void}} {\bfseries get\+\_\+arithmetic\+\_\+value} (\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{const}} Basic\+Json\+Type \&\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{j}}, \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{Arithmetic\+Type}} \&val)
diff --git a/docs/latex/namespacedetail_1_1dtoa__impl.tex b/docs/latex/namespacedetail_1_1dtoa__impl.tex
index 9e4047be..d62c4ef8 100644
--- a/docs/latex/namespacedetail_1_1dtoa__impl.tex
+++ b/docs/latex/namespacedetail_1_1dtoa__impl.tex
@@ -24,7 +24,7 @@
\item
\mbox{\hyperlink{structdetail_1_1dtoa__impl_1_1cached__power}{cached\+\_\+power}} \mbox{\hyperlink{namespacedetail_1_1dtoa__impl_a29ae6574f6be09a5c8ab08da9a3f71b4}{get\+\_\+cached\+\_\+power\+\_\+for\+\_\+binary\+\_\+exponent}} (\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{int}} e)
\item
-\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{int}} \mbox{\hyperlink{namespacedetail_1_1dtoa__impl_a04eb234a28617519974fc962cd4da666}{find\+\_\+largest\+\_\+pow10}} (\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{const}} std\+::uint32\+\_\+t \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{n}}, std\+::uint32\+\_\+t \&\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{pow10}})
+\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{int}} \mbox{\hyperlink{namespacedetail_1_1dtoa__impl_a04eb234a28617519974fc962cd4da666}{find\+\_\+largest\+\_\+pow10}} (\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{const}} std\+::uint32\+\_\+t n, std\+::uint32\+\_\+t \&\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{pow10}})
\item
\Hypertarget{namespacedetail_1_1dtoa__impl_a73a15efcb5c2157ea0e1375b98ef0e83}\label{namespacedetail_1_1dtoa__impl_a73a15efcb5c2157ea0e1375b98ef0e83}
\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{void}} {\bfseries grisu2\+\_\+round} (\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{char}} \texorpdfstring{$\ast$}{*}\mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{buf}}, \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{int}} \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{len}}, std\+::uint64\+\_\+t dist, std\+::uint64\+\_\+t delta, std\+::uint64\+\_\+t \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{rest}}, std\+::uint64\+\_\+t \mbox{\hyperlink{namespacedetail_a9dd43d16a6a490b032ceaca358755a29}{ten\+\_\+k}})
diff --git a/docs/latex/poly__reg_8h_source.tex b/docs/latex/poly__reg_8h_source.tex
new file mode 100644
index 00000000..293a035a
--- /dev/null
+++ b/docs/latex/poly__reg_8h_source.tex
@@ -0,0 +1,102 @@
+\doxysection{poly\+\_\+reg.\+h}
+\hypertarget{poly__reg_8h_source}{}\label{poly__reg_8h_source}\index{/Users/spirosmag/Documents/AlgoPlus/src/machine\_learning/regression/polynomial\_regression/poly\_reg.h@{/Users/spirosmag/Documents/AlgoPlus/src/machine\_learning/regression/polynomial\_regression/poly\_reg.h}}
+
+\begin{DoxyCode}{0}
+\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#pragma\ once}}
+\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#ifndef\ POLY\_REG\_H}}
+\DoxyCodeLine{00003\ \textcolor{preprocessor}{\#define\ POLY\_REG\_H}}
+\DoxyCodeLine{00004\ }
+\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#ifdef\ \_\_cplusplus}}
+\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#include\ }}
+\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#include\ }}
+\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#include\ }}
+\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#endif}}
+\DoxyCodeLine{00010\ }
+\DoxyCodeLine{00011\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classpolynomial__regression}{polynomial\_regression}}\{}
+\DoxyCodeLine{00012\ \textcolor{keyword}{private}:}
+\DoxyCodeLine{00013\ \ \ std::vector\ X;}
+\DoxyCodeLine{00014\ \ \ std::vector\ Y;}
+\DoxyCodeLine{00015\ \ \ int64\_t\ n;}
+\DoxyCodeLine{00016\ \textcolor{keyword}{public}:}
+\DoxyCodeLine{00017\ }
+\DoxyCodeLine{00018\ \ \ \textcolor{keyword}{explicit}\ \mbox{\hyperlink{classpolynomial__regression}{polynomial\_regression}}(std::vector\ X,\ std::vector\ Y,\ int64\_t\ n)\ noexcept\ :\ X(X),\ Y(Y),\ n(n)\ \{\}}
+\DoxyCodeLine{00019\ \ \ \ }
+\DoxyCodeLine{00020\ \ \ std::vector\ get\_coeffs()\{}
+\DoxyCodeLine{00021\ \ \ \ \ std::vector>\ k\ =\ calculate\_matrix(this-\/>X,\ this-\/>n);}
+\DoxyCodeLine{00022\ \ \ \ \ std::vector\ l\ =\ calculate\_vector(this-\/>X,\ this-\/>Y,\ this-\/>n);}
+\DoxyCodeLine{00023\ \ \ \ \ std::vector\ b\_coeffs\ =\ solve\_linear\_system(k,\ l);}
+\DoxyCodeLine{00024\ \ \ \ \ \textcolor{keywordflow}{return}\ b\_coeffs;}
+\DoxyCodeLine{00025\ \ \ \}}
+\DoxyCodeLine{00026\ }
+\DoxyCodeLine{00027\ \ \ std::vector>\ create\_matrix(int64\_t\ rows,\ int64\_t\ cols)\ \{}
+\DoxyCodeLine{00028\ \ \ \ \ \textcolor{keywordflow}{return}\ std::vector>(rows,\ std::vector(cols,\ 0.0));}
+\DoxyCodeLine{00029\ \ \ \}}
+\DoxyCodeLine{00030\ }
+\DoxyCodeLine{00031\ \ \ std::vector>\ calculate\_matrix(\textcolor{keyword}{const}\ std::vector\&\ x,\ int64\_t\ n)\ \{}
+\DoxyCodeLine{00032\ \ \ \ \ int64\_t\ m\ =\ x.size();}
+\DoxyCodeLine{00033\ \ \ \ \ \textcolor{keyword}{auto}\ matrix\ =\ create\_matrix(n\ +\ 1,\ n\ +\ 1);}
+\DoxyCodeLine{00034\ \ \ \ \ \textcolor{keywordflow}{for}\ (int64\_t\ i\ =\ 0;\ i\ <=\ n;\ ++i)\ \{}
+\DoxyCodeLine{00035\ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (int64\_t\ j\ =\ 0;\ j\ <=\ n;\ ++j)\ \{}
+\DoxyCodeLine{00036\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (int64\_t\ k\ =\ 0;\ k\ <\ m;\ ++k)\ \{}
+\DoxyCodeLine{00037\ \ \ \ \ \ \ \ \ \ \ matrix[i][j]\ +=\ pow(x[k],\ i\ +\ j);}
+\DoxyCodeLine{00038\ \ \ \ \ \ \ \ \ \}}
+\DoxyCodeLine{00039\ \ \ \ \ \ \ \}}
+\DoxyCodeLine{00040\ \ \ \ \ \}}
+\DoxyCodeLine{00041\ \ \ \ \ \textcolor{keywordflow}{return}\ matrix;}
+\DoxyCodeLine{00042\ \ \ \}}
+\DoxyCodeLine{00043\ }
+\DoxyCodeLine{00044\ \ \ std::vector\ calculate\_vector(\textcolor{keyword}{const}\ std::vector\&\ x,\ \textcolor{keyword}{const}\ std::vector\&\ y,\ int64\_t\ n)\ \{}
+\DoxyCodeLine{00045\ \ \ \ \ int64\_t\ m\ =\ x.size();}
+\DoxyCodeLine{00046\ \ \ \ \ std::vector\ vector(n\ +\ 1,\ 0.0);}
+\DoxyCodeLine{00047\ \ \ \ \ \textcolor{keywordflow}{for}\ (int64\_t\ i\ =\ 0;\ i\ <=\ n;\ ++i)\ \{}
+\DoxyCodeLine{00048\ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (int64\_t\ k\ =\ 0;\ k\ <\ m;\ ++k)\ \{}
+\DoxyCodeLine{00049\ \ \ \ \ \ \ \ \ vector[i]\ +=\ y[k]\ *\ pow(x[k],\ i);}
+\DoxyCodeLine{00050\ \ \ \ \ \ \ \}}
+\DoxyCodeLine{00051\ \ \ \ \ \}}
+\DoxyCodeLine{00052\ \ \ \ \ \textcolor{keywordflow}{return}\ vector;}
+\DoxyCodeLine{00053\ \ \ \}}
+\DoxyCodeLine{00054\ }
+\DoxyCodeLine{00055\ \ \ \textcolor{comment}{//\ Gaussian\ elimination}}
+\DoxyCodeLine{00056\ \ \ std::vector\ solve\_linear\_system(std::vector>\ A,\ std::vector\ b)\ \{}
+\DoxyCodeLine{00057\ \ \ \ \ int64\_t\ n\ =\ A.size();}
+\DoxyCodeLine{00058\ \ \ \ \ \textcolor{keywordflow}{for}\ (int64\_t\ i\ =\ 0;\ i\ <\ n;\ ++i)\ \{}
+\DoxyCodeLine{00059\ }
+\DoxyCodeLine{00060\ \ \ \ \ \ \ int64\_t\ maxRow\ =\ i;}
+\DoxyCodeLine{00061\ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (int64\_t\ k\ =\ i\ +\ 1;\ k\ <\ n;\ ++k)\ \{}
+\DoxyCodeLine{00062\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (abs(A[k][i])\ >\ abs(A[maxRow][i]))\ \{}
+\DoxyCodeLine{00063\ \ \ \ \ \ \ \ \ \ \ maxRow\ =\ k;}
+\DoxyCodeLine{00064\ \ \ \ \ \ \ \ \ \}}
+\DoxyCodeLine{00065\ \ \ \ \ \ \ \}}
+\DoxyCodeLine{00066\ }
+\DoxyCodeLine{00067\ \ \ \ \ \ \ std::swap(A[maxRow],\ A[i]);}
+\DoxyCodeLine{00068\ \ \ \ \ \ \ std::swap(b[maxRow],\ b[i]);}
+\DoxyCodeLine{00069\ }
+\DoxyCodeLine{00070\ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (int64\_t\ k\ =\ i\ +\ 1;\ k\ <\ n;\ ++k)\ \{}
+\DoxyCodeLine{00071\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{double}\ c\ =\ -\/A[k][i]\ /\ A[i][i];}
+\DoxyCodeLine{00072\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (int64\_t\ j\ =\ i;\ j\ <\ n;\ ++j)\ \{}
+\DoxyCodeLine{00073\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (i\ ==\ j)\ \{}
+\DoxyCodeLine{00074\ \ \ \ \ \ \ \ \ \ \ \ \ A[k][j]\ =\ 0;}
+\DoxyCodeLine{00075\ \ \ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
+\DoxyCodeLine{00076\ \ \ \ \ \ \ \ \ \ \ \ \ A[k][j]\ +=\ c\ *\ A[i][j];}
+\DoxyCodeLine{00077\ \ \ \ \ \ \ \ \ \ \ \}}
+\DoxyCodeLine{00078\ \ \ \ \ \ \ \ \ \}}
+\DoxyCodeLine{00079\ \ \ \ \ \ \ \ \ b[k]\ +=\ c\ *\ b[i];}
+\DoxyCodeLine{00080\ \ \ \ \ \ \ \}}
+\DoxyCodeLine{00081\ \ \ \ \ \}}
+\DoxyCodeLine{00082\ }
+\DoxyCodeLine{00083\ \ \ \ \ std::vector\ x(n);}
+\DoxyCodeLine{00084\ \ \ \ \ \textcolor{keywordflow}{for}\ (int64\_t\ i\ =\ n\ -\/\ 1;\ i\ >=\ 0;\ -\/-\/i)\ \{}
+\DoxyCodeLine{00085\ \ \ \ \ \ \ x[i]\ =\ b[i]\ /\ A[i][i];}
+\DoxyCodeLine{00086\ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (int64\_t\ k\ =\ i\ -\/\ 1;\ k\ >=\ 0;\ -\/-\/k)\ \{}
+\DoxyCodeLine{00087\ \ \ \ \ \ \ \ \ b[k]\ -\/=\ A[k][i]\ *\ x[i];}
+\DoxyCodeLine{00088\ \ \ \ \ \ \ \}}
+\DoxyCodeLine{00089\ \ \ \ \ \}}
+\DoxyCodeLine{00090\ \ \ \ \ \textcolor{keywordflow}{return}\ x;}
+\DoxyCodeLine{00091\ \ \ \}}
+\DoxyCodeLine{00092\ }
+\DoxyCodeLine{00093\ \};}
+\DoxyCodeLine{00094\ }
+\DoxyCodeLine{00095\ }
+\DoxyCodeLine{00096\ \textcolor{preprocessor}{\#endif}}
+
+\end{DoxyCode}
diff --git a/docs/latex/refman.tex b/docs/latex/refman.tex
index 2499f251..2173a383 100644
--- a/docs/latex/refman.tex
+++ b/docs/latex/refman.tex
@@ -505,6 +505,7 @@ \chapter{Class Documentation}
\input{structmatplotlibcpp_1_1detail_1_1plot__impl_3_01std_1_1false__type_01_4}
\input{structmatplotlibcpp_1_1detail_1_1plot__impl_3_01std_1_1true__type_01_4}
\input{struct_catch_1_1pluralise}
+\input{classpolynomial__regression}
\input{structdetail_1_1position__t}
\input{class_catch_1_1_matchers_1_1_generic_1_1_predicate_matcher}
\input{classdetail_1_1primitive__iterator__t}
@@ -672,6 +673,7 @@ \chapter{File Documentation}
\input{__image_8h_source}
\input{huffman__encoding_8h_source}
\input{lin__reg_8h_source}
+\input{poly__reg_8h_source}
\input{best__first_8h_source}
\input{hill__climbing_8h_source}
\input{graph__visualization_8h_source}
diff --git a/examples/machine_learning/polynomial_regression/data.json b/examples/machine_learning/polynomial_regression/data.json
new file mode 100644
index 00000000..d81b1de5
--- /dev/null
+++ b/examples/machine_learning/polynomial_regression/data.json
@@ -0,0 +1 @@
+{"data": [[1, 45000], [2, 50000], [3, 60000], [4, 80000], [5, 110000], [6, 150000], [7, 200000]]}
\ No newline at end of file
diff --git a/examples/machine_learning/polynomial_regression/info.json b/examples/machine_learning/polynomial_regression/info.json
new file mode 100644
index 00000000..44f3e484
--- /dev/null
+++ b/examples/machine_learning/polynomial_regression/info.json
@@ -0,0 +1 @@
+{"coeffs":[48571.428571428056,-6388.888888888403,3035.7142857141635,138.8888888888979]}
\ No newline at end of file
diff --git a/examples/machine_learning/polynomial_regression/poly_reg.cc b/examples/machine_learning/polynomial_regression/poly_reg.cc
new file mode 100644
index 00000000..ba8f174b
--- /dev/null
+++ b/examples/machine_learning/polynomial_regression/poly_reg.cc
@@ -0,0 +1,26 @@
+#include "../../../src/machine_learning/regression/polynomial_regression/poly_reg.h"
+#include "../../../third_party/json.hpp"
+#include
+#include
+
+using nlohmann::json;
+
+int main() {
+ srand((unsigned)time(NULL));
+ std::ifstream ifs("data.json");
+ json jf = json::parse(ifs);
+ std::vector > data = jf["data"];
+ std::vector X, Y;
+ for(auto & x : data){
+ X.push_back(x[0]);
+ Y.push_back(x[1]);
+ }
+ int64_t n = 3; //we can select the degree of the polynomial
+ polynomial_regression a(X, Y, n);
+ std::vector b_coeffs = a.get_coeffs();
+ json j;
+ j["coeffs"] = b_coeffs;
+ std::ofstream file("info.json");
+ file << j;
+ return 0;
+}
diff --git a/examples/machine_learning/polynomial_regression/poly_reg.py b/examples/machine_learning/polynomial_regression/poly_reg.py
new file mode 100644
index 00000000..3e92b522
--- /dev/null
+++ b/examples/machine_learning/polynomial_regression/poly_reg.py
@@ -0,0 +1,48 @@
+import json
+import matplotlib.pyplot as plt
+import os
+import numpy as np
+
+def fill_data():
+ #data = []
+ #for i in range(400):
+ # data.append([i, i**2])
+ data = [[1, 45000], [2, 50000], [3, 60000], [4, 80000], [5, 110000], [6, 150000], [7, 200000]]
+ return data
+
+def plot(data, coeffs, deg):
+ for x,y in data:
+ plt.scatter(x,y,color='blue')
+ x = np.linspace(1, 7, num = 100)
+ y = sum(coeffs[i] * x**i for i in range(deg + 1))
+ plt.plot(x, y, label='Polynomial Regression')
+ plt.xlabel('x')
+ plt.ylabel('y')
+ plt.title("Plot of the polynomial regression")
+ plt.legend()
+ plt.grid("on")
+ plt.show()
+
+
+# This is just a template, if you want more clusters please fill more colors to the COLORS list
+if __name__ == "__main__":
+ # here you should fill the data
+ # parser should be better here(or add an option for parser)
+ data = fill_data()
+ data_dict = {
+ "data":data
+ }
+ json_object = json.dumps(data_dict)
+
+ with open("data.json", "w") as outfile:
+ outfile.write(json_object)
+
+ # run the kmeans clustering with CLUSTERS clusters
+ os.system(f"c++ -std=c++17 poly_reg.cc")
+ os.system("./a.out")
+
+ input_name = open("info.json", 'r')
+ file = json.load(input_name)
+ coeffs = file["coeffs"]
+ plot(data, coeffs, 3)
+
diff --git a/src/machine_learning/regression/polynomial_regression/poly_reg.h b/src/machine_learning/regression/polynomial_regression/poly_reg.h
new file mode 100644
index 00000000..be6a20f5
--- /dev/null
+++ b/src/machine_learning/regression/polynomial_regression/poly_reg.h
@@ -0,0 +1,96 @@
+#pragma once
+#ifndef POLY_REG_H
+#define POLY_REG_H
+
+#ifdef __cplusplus
+#include
+#include
+#include
+#endif
+
+class polynomial_regression{
+private:
+ std::vector X;
+ std::vector Y;
+ int64_t n;
+public:
+
+ explicit polynomial_regression(std::vector X, std::vector Y, int64_t n) noexcept : X(X), Y(Y), n(n) {}
+
+ std::vector get_coeffs(){
+ std::vector> k = calculate_matrix(this->X, this->n);
+ std::vector l = calculate_vector(this->X, this->Y, this->n);
+ std::vector b_coeffs = solve_linear_system(k, l);
+ return b_coeffs;
+ }
+
+ std::vector> create_matrix(int64_t rows, int64_t cols) {
+ return std::vector>(rows, std::vector(cols, 0.0));
+ }
+
+ std::vector> calculate_matrix(const std::vector& x, int64_t n) {
+ int64_t m = x.size();
+ auto matrix = create_matrix(n + 1, n + 1);
+ for (int64_t i = 0; i <= n; ++i) {
+ for (int64_t j = 0; j <= n; ++j) {
+ for (int64_t k = 0; k < m; ++k) {
+ matrix[i][j] += pow(x[k], i + j);
+ }
+ }
+ }
+ return matrix;
+ }
+
+ std::vector calculate_vector(const std::vector& x, const std::vector& y, int64_t n) {
+ int64_t m = x.size();
+ std::vector vector(n + 1, 0.0);
+ for (int64_t i = 0; i <= n; ++i) {
+ for (int64_t k = 0; k < m; ++k) {
+ vector[i] += y[k] * pow(x[k], i);
+ }
+ }
+ return vector;
+ }
+
+ // Gaussian elimination
+ std::vector solve_linear_system(std::vector> A, std::vector b) {
+ int64_t n = A.size();
+ for (int64_t i = 0; i < n; ++i) {
+
+ int64_t maxRow = i;
+ for (int64_t k = i + 1; k < n; ++k) {
+ if (abs(A[k][i]) > abs(A[maxRow][i])) {
+ maxRow = k;
+ }
+ }
+
+ std::swap(A[maxRow], A[i]);
+ std::swap(b[maxRow], b[i]);
+
+ for (int64_t k = i + 1; k < n; ++k) {
+ double c = -A[k][i] / A[i][i];
+ for (int64_t j = i; j < n; ++j) {
+ if (i == j) {
+ A[k][j] = 0;
+ } else {
+ A[k][j] += c * A[i][j];
+ }
+ }
+ b[k] += c * b[i];
+ }
+ }
+
+ std::vector x(n);
+ for (int64_t i = n - 1; i >= 0; --i) {
+ x[i] = b[i] / A[i][i];
+ for (int64_t k = i - 1; k >= 0; --k) {
+ b[k] -= A[k][i] * x[i];
+ }
+ }
+ return x;
+ }
+
+};
+
+
+#endif