{"id":416221,"date":"2024-06-30T00:49:46","date_gmt":"2024-06-30T00:49:46","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=416221"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-30T00:49:46","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=416221","title":{"rendered":"<span>\u0420\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0432 DataScience. \u0427\u0430\u0441\u0442\u044c 3. \u0410\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>  \u0410\u041a\u0422\u0423\u0410\u041b\u042c\u041d\u041e\u0421\u0422\u042c \u0422\u0415\u041c\u042b<\/h2>\n<p> \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043e\u0431\u0437\u043e\u0440\u0430\u0445 (<a href=\"https:\/\/habr.com\/ru\/articles\/690414\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/690414\/<\/a>, <a href=\"https:\/\/habr.com\/ru\/articles\/695556\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/695556\/<\/a>) \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u0443\u044e \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044e. \u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438. \u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>\u041f\u0440\u043e \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e, \u0447\u0442\u043e, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0443\u0436\u0435 \u043d\u0435\u0447\u0435\u0433\u043e. \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u043e\u0435-\u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f.<\/p>\n<p>\u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c. \u041f\u043e\u0434\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u044e &#8212; \u0440\u0435\u0447\u044c \u043d\u0435 \u0438\u0434\u0435\u0442 \u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u043c \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0435\u0433\u043e \u044d\u0442\u0430\u043f\u0430\u043c\u0438, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0433\u0438\u043f\u043e\u0442\u0435\u0437 \u0438 \u0442.\u0434., \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0438\u0448\u044c \u043e \u043f\u043e\u0434\u0431\u043e\u0440\u0435 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0438 \u043e\u0446\u0435\u043d\u043a\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u043a\u0438\u043c\u0438-\u043b\u0438\u0431\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0432 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 \u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0438 \u0431\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0433\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0442\u043e\u0442 \u0436\u0435 Excel &#8212; \u0432\u0441\u0435 \u043c\u044b \u043f\u043e\u043c\u043d\u0438\u043c, \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043b\u0438\u043d\u0438\u044e \u0442\u0440\u0435\u043d\u0434\u0430 \u043d\u0430 \u0442\u043e\u0447\u0435\u0447\u043d\u043e\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b71\/d00\/894\/b71d00894e8dd682602b9b962e91b9d1.png\" alt=\"\" title=\"\" width=\"877\" height=\"620\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b71\/d00\/894\/b71d00894e8dd682602b9b962e91b9d1.png\"\/><\/figure>\n<p>\u0422\u0430\u043a\u043e\u0439 \u0436\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0438 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0432 Python, \u043f\u0440\u0438\u0447\u0435\u043c \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0432 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u043e &#8212; \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0438 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432, \u043f\u0440\u0438\u0441\u0443\u0449\u0438\u0445 Excel:<\/p>\n<ul>\n<li>\n<p>\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u043c\u0435\u0442\u0440\u0438\u043a \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u044b \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043e\u0431\u0437\u043e\u0440\u0435.<\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/h4>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043e\u0431\u0437\u043e\u0440\u0430\u0445, \u0437\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. \u0412\u0441\u0435 \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0434\u043b\u044f \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0414\u0430\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f <strong>my_module__stat.py<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u043c\u043e\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 GitHub (<a href=\"https:\/\/github.com\/AANazarov\/MyModulePython\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/AANazarov\/MyModulePython<\/a>).<\/p>\n<p>\u0412\u043e\u0442 \u043f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/p>\n<ul>\n<li>\n<p><strong>graph_lineplot_sns<\/strong> &#8212; \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u0433\u0440\u0430\u0444\u0438\u043a \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 seaborn \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a \u0432 \u0432\u0438\u0434\u0435 png-\u0444\u0430\u0439\u043b\u0430;<\/p>\n<\/li>\n<li>\n<p><strong>graph_scatterplot_sns<\/strong> &#8212; \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u043e\u0447\u0435\u0447\u043d\u0443\u044e \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0443 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 seaborn \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a \u0432 \u0432\u0438\u0434\u0435 png-\u0444\u0430\u0439\u043b\u0430;<\/p>\n<\/li>\n<li>\n<p><strong>regression_error_metrics<\/strong>  &#8212; \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438;<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>simple_approximation<\/strong> \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0437\u043e\u0440\u0430 (\u043e\u043d\u0430 \u0442\u043e\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c <strong>my_module__stat.py<\/strong>).<\/p>\n<h2>\u0418\u0421\u0425\u041e\u0414\u041d\u042b\u0415 \u0414\u0410\u041d\u041d\u042b\u0415<\/h2>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043e\u0431\u0437\u043e\u0440\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 <strong>\u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0445\u043e\u0434\u0430 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f (\u043b\/100 \u043a\u043c) (FuelFlow)<\/strong> \u043e\u0442 <strong>\u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0431\u0435\u0433\u0430 (\u043a\u043c) (Mileage)<\/strong> \u0438 <strong>\u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0439 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b (Temperature)<\/strong> (\u044d\u0442\u043e\u0442 \u0436\u0435 \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0432 \u0441\u0432\u043e\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445: <a href=\"https:\/\/habr.com\/ru\/post\/683442\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/post\/683442\/<\/a>, <a href=\"https:\/\/habr.com\/ru\/post\/695556\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/post\/695556\/<\/a>).<\/p>\n<pre><code class=\"python\"># \u041e\u0431\u0449\u0438\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Task_Project = \"Analysis of fuel consumption of a car\"  # \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 AsOfTheDate = \"\"  # \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Task_Theme = \"\"  # \u041e\u0431\u0449\u0438\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 Title_String = f\"{Task_Project}\\n{AsOfTheDate}\"  # \u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 Variable_Name_T_month = \"Monthly data\" Variable_Name_Y = \"FuelFlow (liters per 100 km)\" Variable_Name_X1 = \"Mileage (km)\" Variable_Name_X2 = \"Temperature (\u00b0\u0421)\"<\/code><\/pre>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 csv-\u0444\u0430\u0439\u043b\u0430. \u042d\u0442\u043e \u0443\u0436\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u0434\u0430\u0442\u0430\u0441\u0435\u0442, \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 (\u043f\u0435\u0440\u0432\u0438\u0447\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u0430\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 <strong>Preparation of input <\/strong><a href=\"http:\/\/data.py\" rel=\"noopener noreferrer nofollow\"><strong>data.py<\/strong><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u043c\u043e\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 GitHub).<\/p>\n<p><strong>\u0421\u0442\u043e\u043b\u0431\u0446\u044b \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/strong>:<\/p>\n<ul>\n<li>\n<p><strong>Month<\/strong> \u2014 \u043c\u0435\u0441\u044f\u0446 (\u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 Excel)<\/p>\n<\/li>\n<li>\n<p><strong>Mileage<\/strong> &#8212; \u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0431\u0435\u0433 (\u043a\u043c)<\/p>\n<\/li>\n<li>\n<p><strong>Temperature<\/strong> &#8212; \u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u0430\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 (\u00b0C)<\/p>\n<\/li>\n<li>\n<p><strong>FuelFlow<\/strong> &#8212; \u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0439 \u0440\u0430\u0441\u0445\u043e\u0434 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 (\u043b\/100 \u043a<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">dataset_df = pd.read_csv(filepath_or_buffer='data\/dataset_df.csv', sep=';')<\/code><\/pre>\n<h4>\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/h4>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 (\u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430).<br \/>\u0421\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0439 \u0440\u0430\u0441\u0445\u043e\u0434 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 (\u043b\/100 \u043a\u043c) \/ Fuel Flow (liters per 100 km):<\/p>\n<pre><code class=\"python\">Y = np.array(dataset_df['Y'])<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0431\u0435\u0433 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f \u0437\u0430 \u043c\u0435\u0441\u044f\u0446 (\u043a\u043c) \/ Mileage (km):<\/p>\n<pre><code class=\"python\">X1 = np.array(dataset_df['X1'])<\/code><\/pre>\n<p>\u0421\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u0430\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 (\u00b0\u0421) \/ Temperature (degrees celsius):<\/p>\n<pre><code class=\"python\">X2 = np.array(dataset_df['X2'])<\/code><\/pre>\n<h4>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h4>\n<p>\u0413\u0440\u0430\u043d\u0438\u0446\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 (\u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432):<\/p>\n<pre><code class=\"python\">(X1_min_graph, X1_max_graph) = (0, 3000) (X2_min_graph, X2_max_graph) = (-20, 25) (Y_min_graph, Y_max_graph) = (0, 30)<\/code><\/pre>\n<p>\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0430:<\/p>\n<pre><code class=\"python\">graph_scatterplot_sns(     X1, Y,     Xmin=X1_min_graph, Xmax=X1_max_graph,     Ymin=Y_min_graph, Ymax=Y_max_graph,     color='orange',     title_figure=Title_String, title_figure_fontsize=14,     title_axes='Dependence of FuelFlow (Y) on mileage (X1)', title_axes_fontsize=16,     x_label=Variable_Name_X1,     y_label=Variable_Name_Y,     label_fontsize=14, tick_fontsize=12,     label_legend='', label_legend_fontsize=12,     s=80)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/97e\/8a3\/e48\/97e8a3e489a5b6c2a5aee7afaa7013cd.png\" width=\"719\" height=\"559\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/97e\/8a3\/e48\/97e8a3e489a5b6c2a5aee7afaa7013cd.png\"\/><\/figure>\n<h2>\u041e\u0421\u041d\u041e\u0412\u042b \u0422\u0415\u041e\u0420\u0418\u0418 <\/h2>\n<p>\u041a\u0440\u0430\u0442\u043a\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0445.<\/p>\n<h4>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b Python \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438<\/h4>\n<p><strong>Python<\/strong> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441\u043c. <a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/optimize.html\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.scipy.org\/doc\/scipy\/reference\/optimize.html<\/a>). \u041c\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0437 \u043d\u0438\u0445:<\/p>\n<ul>\n<li>\n<p>\u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>scipy.optimize.leastsq<\/strong> (<a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.leastsq.html#scipy.optimize.leastsq\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.leastsq.html#scipy.optimize.leastsq<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>scipy.optimize.least_squares<\/strong> (<a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.least_squares.html#scipy.optimize.least_squares\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.least_squares.html#scipy.optimize.least_squares<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>scipy.optimize.curve_fit<\/strong> (<a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.curve_fit.html\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.curve_fit.html<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>scipy.optimize.minimize<\/strong> (<a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.minimize.html#scipy.optimize.minimize\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.minimize.html#scipy.optimize.minimize<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <strong>lmfit<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/<\/a>)<\/p>\n<\/li>\n<\/ul>\n<h4> \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0432\u0438\u0434\u044b \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438<\/h4>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0441\u043e\u0442\u043d\u0438 \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u043e\u0432, \u043c\u043e\u043d\u043e\u0433\u0440\u0430\u0444\u0438\u0439, \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438 \u0441\u0442\u0430\u0442\u0435\u0439. \u041e\u0434\u043d\u0430\u043a\u043e, \u0432 \u0446\u0435\u043b\u044f\u0445 \u0443\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043d\u0438\u0436\u0435 \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0432\u0438\u0434\u044b \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 &#8212; \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u044d\u0442\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u0447\u0435\u0440\u043f\u044b\u0432\u0430\u044e\u0449\u0438\u043c, \u043d\u043e \u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0438\u043b\u0438 \u043c\u0435\u043d\u0435\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u043b\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p>\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/th>\n<th>\n<p>\u0423\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=b_0+b_1\\cdot X\" alt=\"Y=b_0+b_1\\cdot X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/821\/992\/ed3\/821992ed35d4a012437743bb6c3bd34b.svg\" width=\"128\" height=\"20\"\/>&#8216;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=b_0+b_1\\cdot X+b_2\\cdot X^2\" alt=\"Y=b_0+b_1\\cdot X+b_2\\cdot X^2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/583\/03b\/b91\/58303bb919733d05a663ebdb830a3b2c.svg\" width=\"208\" height=\"24\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043a\u0443\u0431\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=b_0+b_1\\cdot X+b_2\\cdot X^2+b_3\\cdot X^3\" alt=\"Y=b_0+b_1\\cdot X+b_2\\cdot X^2+b_3\\cdot X^3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1fe\/bd1\/5b1\/1febd15b1ae5b564e54b0ceef3625965.svg\" width=\"288\" height=\"24\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043f\u043e\u043b\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=\\sum b_k\\cdot X^k\" alt=\"Y=\\sum b_k\\cdot X^k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e2b\/64f\/2d7\/e2b64f2d777b76271e98d20fdb5b6984.svg\" width=\"128\" height=\"30\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=b_0\\cdot X^{b_1}\" alt=\"Y=b_0\\cdot X^{b_1}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ec7\/591\/bdd\/ec7591bdd0661dd60b3c25b98d81c035.svg\" width=\"102\" height=\"24\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f I \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=b_0\\cdot e^{b_1\\cdot X}\" alt=\"Y=b_0\\cdot e^{b_1\\cdot X}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5c9\/4d9\/022\/5c94d9022de1cadda1f082fff9bd6df9.svg\" width=\"110\" height=\"24\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f II \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=b_0\\cdot b_1^X\" alt=\"Y=b_0\\cdot b_1^X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f3a\/4a2\/15c\/f3a4a215ca303aac9b18082f08d50be3.svg\" width=\"93\" height=\"24\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=b_0+b_1\\cdot ln X\" alt=\"Y=b_0+b_1\\cdot ln X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fb8\/df8\/03f\/fb8df803fe2bad56eef81bba6bc6f51b.svg\" width=\"146\" height=\"20\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=1 \/ (b_0+b_1\\cdot ln X)\" alt=\"Y=1 \/ (b_0+b_1\\cdot ln X)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a26\/61b\/ff1\/a2661bff1d16031c343f42bcf97ddeb0.svg\" width=\"180\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0433\u0438\u043f\u0435\u0440\u0431\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f I \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=b_0+b_1 \/ X\" alt=\"Y=b_0+b_1 \/ X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1ce\/c9f\/c57\/1cec9fc57e0100c398da9d464e50d42c.svg\" width=\"124\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0433\u0438\u043f\u0435\u0440\u0431\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f II \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=1 \/ (b_0+b_1\\cdot X)\" alt=\"Y=1 \/ (b_0+b_1\\cdot X)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/018\/2dc\/57d\/0182dc57db40e13f1fdba839078d5536.svg\" width=\"163\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0433\u0438\u043f\u0435\u0440\u0431\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f III \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=X \/ (b_0+b_1\\cdot X)\" alt=\"Y=X \/ (b_0+b_1\\cdot X)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/110\/e7e\/5bc\/110e7e5bc6677113094607ad002da6cc.svg\" width=\"169\" height=\"22\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f I \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=b_0 \/ (1+b_1\\cdot e^{-b_2\\cdot X})\" alt=\"Y=b_0 \/ (1+b_1\\cdot e^{-b_2\\cdot X})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/687\/b65\/348\/687b653481d8b1c0fe42f8ba2ac7db40.svg\" width=\"195\" height=\"25\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f II \u0442\u0438\u043f\u0430 (\u041f\u0435\u0440\u043b\u0430-\u0420\u0438\u0434\u0430)<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=b_0 \/ (1+b_1\\cdot b_2^{-X})\" alt=\"Y=b_0 \/ (1+b_1\\cdot b_2^{-X})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7c9\/db2\/8b9\/7c9db28b905642913edede6a5b73f5fe.svg\" width=\"179\" height=\"26\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043a\u0440\u0438\u0432\u0430\u044f \u0413\u043e\u043c\u043f\u0435\u0440\u0446\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=b_0\\cdot {b_1}^{b_2^{X}}\" alt=\"Y=b_0\\cdot {b_1}^{b_2^{X}}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4be\/50b\/c7f\/4be50bc7f86b571e9f6f0d02c5ff8bb2.svg\" width=\"106\" height=\"27\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u0430 I \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=b_0+b_1\\cdot e^{b_2\\cdot X}\" alt=\"Y=b_0+b_1\\cdot e^{b_2\\cdot X}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/35e\/583\/7ef\/35e5837efe1d9bebfef3167f01e34eca.svg\" width=\"150\" height=\"24\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u0430 II \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=b_0+b_1\\cdot b_2^ X\" alt=\"Y=b_0+b_1\\cdot b_2^ X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3b1\/adc\/8b8\/3b1adc8b896efed1159961a7101015d2.svg\" width=\"134\" height=\"24\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f I \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=b_0+b_1 \/ (1+b_2\\cdot e^{-b_3\\cdot X})\" alt=\"Y=b_0+b_1 \/ (1+b_2\\cdot e^{-b_3\\cdot X})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e1e\/e3e\/30f\/e1ee3e30f9f86d31b42467afe2595bf2.svg\" width=\"236\" height=\"25\"\/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f II \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=b_0+b_1 \/ (1+b_2\\cdot b_3^{-X})\" alt=\"Y=b_0+b_1 \/ (1+b_2\\cdot b_3^{-X})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/221\/529\/4f3\/2215294f35a9e5fb3e3290608536d6da.svg\" width=\"219\" height=\"27\"\/><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><strong><u>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f:<\/u><\/strong><\/p>\n<ol>\n<li>\n<p>\u041d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u0440\u044f\u0434\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 2 \u0433\u0440\u0443\u043f\u043f\u044b: <\/p>\n<ul>\n<li>\n<p><strong>\u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0435 \u043f\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u0430\u043c<\/strong> &#8212; \u043f\u0443\u0442\u0435\u043c \u0437\u0430\u043c\u0435\u043d\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043b\u0438\u043d\u0435\u0430\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u044b, \u0442.\u0435. \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043a \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443, \u0438 \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p><strong>\u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0435 \u043f\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c<\/strong> &#8212; \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043b\u0438\u043d\u0435\u0430\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u044b, \u0438 \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u041a \u043c\u043e\u0434\u0435\u043b\u044f\u043c, \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u043f\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c, \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u0440\u0438\u0432\u044b\u0435 (\u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f), \u043a\u0440\u0438\u0432\u0430\u044f \u0413\u043e\u043c\u043f\u0435\u0440\u0446\u0430 \u0438 \u043f\u0440. \u041e\u0446\u0435\u043d\u043a\u0430 \u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 Python \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0441\u043e\u0431\u044b\u0445 \u043f\u0440\u0438\u0435\u043c\u043e\u0432 (\u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439). \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0430\u0437\u0431\u043e\u0440\u0435 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u0441\u043e\u0431\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445.<\/p>\n<h4> \u041e\u0446\u0435\u043d\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438<\/h4>\n<ol start=\"2\">\n<li>\n<p>\u042d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u044b \u0432 2-\u0445 \u0444\u043e\u0440\u043c\u0430\u0445:<\/p>\n<ul>\n<li>\n<p>\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e <strong>\u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/strong> <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=b_0\\cdot e^{b_1\\cdot X}\" alt=\"Y=b_0\\cdot e^{b_1\\cdot X}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8e9\/dca\/8e5\/8e9dca8e5de8beb0dc454cdd5f543088.svg\" width=\"110\" height=\"24\"\/>;<\/p>\n<\/li>\n<li>\n<p>\u0432 <strong>\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0435<\/strong> <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=b_0\\cdot b_1^X\" alt=\"Y=b_0\\cdot b_1^X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/905\/5b3\/298\/9055b3298ffc47c98ac887fb2f9f7e18.svg\" width=\"93\" height=\"24\"\/><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u0441\u043e\u0431\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0443\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0442\u043c\u0435\u0442\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e, \u0441 \u043e\u0441\u043e\u0431\u044b\u043c \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u043e\u043c \u0437\u0430\u0434\u0430\u0447\u0438, \u0430 \u043f\u043e\u043b\u0438\u043d\u043e\u043c\u044b \u0432\u044b\u0448\u0435 3-\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f.<\/p>\n<h4> \u041c\u0435\u0442\u0440\u0438\u043a\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438<\/h4>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430:<\/p>\n<ol>\n<li>\n<p><strong>Mean squared error (MSE)<\/strong>  &#8212; \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0438 <strong>Root mean square error (RMSE)<\/strong> &#8212; \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u0440\u0435\u043d\u044c \u0438\u0437 \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 <strong>MSE<\/strong>:<\/p>\n<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\begin{aligned} \\qquad MSE = \\frac{1}{n} \\cdot {\\displaystyle\\sum_{i=1}^{n} (Y_{i} - \\widehat{Y}_{i})^2} = \\frac{1}{n} \\cdot {\\displaystyle\\sum_{i=1}^{n} e_{i}^2} = \\frac{1}{n} \\cdot \\boldsymbol{e}^T\\boldsymbol{e} \\end{aligned}\" alt=\"\\begin{aligned} \\qquad MSE = \\frac{1}{n} \\cdot {\\displaystyle\\sum_{i=1}^{n} (Y_{i} - \\widehat{Y}_{i})^2} = \\frac{1}{n} \\cdot {\\displaystyle\\sum_{i=1}^{n} e_{i}^2} = \\frac{1}{n} \\cdot \\boldsymbol{e}^T\\boldsymbol{e} \\end{aligned}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c0c\/71f\/d33\/c0c71fd334a033f80c1c4c01ac7061e8.svg\" width=\"463\" height=\"56\"\/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\begin{aligned} \\qquad RMSE = \\sqrt{MSE} \\end{aligned}\" alt=\"\\begin{aligned} \\qquad RMSE = \\sqrt{MSE} \\end{aligned}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/631\/8fe\/c86\/6318fec8638e3b3abb9f6e8b5495a801.svg\" width=\"196\" height=\"24\"\/><\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438: \u0442\u0435\u043d\u0434\u0435\u043d\u0446\u0438\u044f \u043a \u0437\u0430\u043d\u0438\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u043e\u0434\u0435\u043b\u0438, \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a \u0432\u044b\u0431\u0440\u043e\u0441\u0430\u043c.<\/p>\n<p> 2. <strong>Mean absolute error (MAE)<\/strong> &#8212; \u0441\u0440\u0435\u0434\u043d\u044f\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\begin{aligned} \\qquad MAE = \\frac{1}{n} \\cdot {\\displaystyle\\sum_{i=1}^{n} |Y_{i} - \\widehat{Y}_{i}|} \\end{aligned}\" alt=\"\\begin{aligned} \\qquad MAE = \\frac{1}{n} \\cdot {\\displaystyle\\sum_{i=1}^{n} |Y_{i} - \\widehat{Y}_{i}|} \\end{aligned}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c4e\/98a\/898\/c4e98a898e054c29d282954ea1030cad.svg\" width=\"257\" height=\"56\"\/><\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c: \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u0435\u0435 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u0430 \u043a \u0432\u044b\u0431\u0440\u043e\u0441\u0430\u043c, \u0447\u0435\u043c <strong>RMSE<\/strong>.<\/p>\n<p> 3. <strong>Mean squared prediction error (MSPE)<\/strong> &#8212; \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0430 (\u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430\u0445):<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\begin{aligned} \\qquad MSPE = \\frac{1}{n} \\cdot {\\displaystyle\\sum_{i=1}^{n} \\bigg(\\frac{Y_{i} - \\widehat{Y}_{i}}{Y_{i}}\\bigg)^2} \\end{aligned}\" alt=\"\\begin{aligned} \\qquad MSPE = \\frac{1}{n} \\cdot {\\displaystyle\\sum_{i=1}^{n} \\bigg(\\frac{Y_{i} - \\widehat{Y}_{i}}{Y_{i}}\\bigg)^2} \\end{aligned}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/052\/174\/d28\/052174d28e452848f45bcd6f4263a2fb.svg\" width=\"300\" height=\"58\"\/><\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438: \u043d\u0435\u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a \u0432\u044b\u0431\u0440\u043e\u0441\u0430\u043c; \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0432\u043d\u044b \u043d\u0443\u043b\u044e.<\/p>\n<p> 4. <strong>Mean absolute percentage error (MAPE)<\/strong> &#8212; \u0441\u0440\u0435\u0434\u043d\u044f\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430\u0445:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\begin{aligned} \\qquad MAPE = 1 - \\frac{1}{n} \\cdot {\\displaystyle\\sum_{i=1}^{n} \\bigg|\\frac{Y_{i} - \\widehat{Y}_{i}}{Y_{i}}\\bigg|} \\end{aligned}\" alt=\"\\begin{aligned} \\qquad MAPE = 1 - \\frac{1}{n} \\cdot {\\displaystyle\\sum_{i=1}^{n} \\bigg|\\frac{Y_{i} - \\widehat{Y}_{i}}{Y_{i}}\\bigg|} \\end{aligned}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d03\/b17\/d0c\/d03b17d0c65781cf8928a566d1c2a8cb.svg\" width=\"309\" height=\"58\"\/><\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438: \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0432\u043d\u044b \u043d\u0443\u043b\u044e.<\/p>\n<p> 5. <strong>Root Mean Square Logarithmic Error (RMSLE)<\/strong> &#8212; c\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u0430\u044f \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438 \u0432\u044b\u0448\u0435:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\begin{aligned} \\qquad RMSLE = \\sqrt{\\frac{1}{n} \\cdot {\\displaystyle\\sum_{i=1}^{n} (ln(Y_i+1) - ln(\\widehat{Y_{i}}+1))^2}} = RMSE\\bigg(ln(Y), ln(\\widehat{Y})\\bigg) = \\sqrt{MSE\\bigg(ln(Y), ln(\\widehat{Y})\\bigg)} \\end{aligned}\" alt=\"\\begin{aligned} \\qquad RMSLE = \\sqrt{\\frac{1}{n} \\cdot {\\displaystyle\\sum_{i=1}^{n} (ln(Y_i+1) - ln(\\widehat{Y_{i}}+1))^2}} = RMSE\\bigg(ln(Y), ln(\\widehat{Y})\\bigg) = \\sqrt{MSE\\bigg(ln(Y), ln(\\widehat{Y})\\bigg)} \\end{aligned}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/748\/283\/ae4\/748283ae4064f8dcd0f4fb8f9a913407.svg\" width=\"884\" height=\"63\"\/><\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438: \u043d\u0435\u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a \u0432\u044b\u0431\u0440\u043e\u0441\u0430\u043c; \u0441\u043c\u0435\u0449\u0435\u043d\u0430 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a (\u043d\u0430\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0430 \u043d\u0435\u0434\u043e\u043e\u0446\u0435\u043d\u043a\u0443, \u0447\u0435\u043c \u0437\u0430 \u043f\u0435\u0440\u0435\u043e\u0446\u0435\u043d\u043a\u0443); \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 1, \u0442\u0430\u043a \u043a\u0430\u043a \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c 0 \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d.<\/p>\n<p> 6. <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\boldsymbol{R^2}\" alt=\"\\boldsymbol{R^2}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d1c\/f8b\/c38\/d1cf8bc38a854b88c632aa65c52f2261.svg\" width=\"27\" height=\"20\"\/> &#8212; \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0446\u0438\u0438:<\/p>\n<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\begin{aligned} \\qquad R^2 = 1 - \\frac{SSE}{SST} = 1 - \\frac{\\displaystyle\\sum_{i=1}^{n} (Y_{i} - \\widehat{Y}_{i})^2}{\\displaystyle\\sum_{i=1}^{n} (Y_{i} - \\overline{Y}_{i})^2} \\end{aligned}\" alt=\"\\begin{aligned} \\qquad R^2 = 1 - \\frac{SSE}{SST} = 1 - \\frac{\\displaystyle\\sum_{i=1}^{n} (Y_{i} - \\widehat{Y}_{i})^2}{\\displaystyle\\sum_{i=1}^{n} (Y_{i} - \\overline{Y}_{i})^2} \\end{aligned}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/af2\/c80\/407\/af2c804075dc04ac1968129d9fb30468.svg\" width=\"357\" height=\"118\"\/><\/p>\n<\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c: \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\boldsymbol{R^2}\" alt=\"\\boldsymbol{R^2}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8ee\/6f8\/b53\/8ee6f8b53ab228e654dcaa31329e2cb9.svg\" width=\"27\" height=\"20\"\/> \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 [0; 1], \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (\u0435\u0441\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f).<br \/> \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u043c\u0435\u0442\u0440\u0438\u043a \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u0447\u0435\u0440\u043f\u044b\u0432\u0430\u044e\u0449\u0438\u043c.<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043c\u0435\u0442\u0440\u0438\u043a \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0432\u00a0<a href=\"https:\/\/machinelearningmastery.ru\/how-to-select-the-right-evaluation-metric-for-machine-learning-models-part-1-regrression-metrics-3606e25beae0\/\" rel=\"noopener noreferrer nofollow\">https:\/\/machinelearningmastery.ru\/how-to-select-the-right-evaluation-metric-for-machine-learning-models-part-1-regrression-metrics-3606e25beae0\/<\/a>,\u00a0<a href=\"https:\/\/machinelearningmastery.ru\/how-to-select-the-right-evaluation-metric-for-machine-learning-models-part-2-regression-metrics-d4a1a9ba3d74\/\" rel=\"noopener noreferrer nofollow\">https:\/\/machinelearningmastery.ru\/how-to-select-the-right-evaluation-metric-for-machine-learning-models-part-2-regression-metrics-d4a1a9ba3d74\/<\/a>,\u00a0<a href=\"https:\/\/loginom.ru\/blog\/quality-metrics\" rel=\"noopener noreferrer nofollow\">https:\/\/loginom.ru\/blog\/quality-metrics<\/a>.<\/p>\n<h4>\u041e\u0446\u0435\u043d\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438<\/h4>\n<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438\u00a0<strong>Python<\/strong>\u00a0\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0431\u0448\u0438\u0440\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0442\u0435\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u0434\u0430\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u043b\u044f \u043d\u0438\u0445 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044b. \u041d\u0435 \u0432\u0434\u0430\u0432\u0430\u044f\u0441\u044c \u0433\u043b\u0443\u0431\u043e\u043a\u043e \u0432 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0442\u0435\u043e\u0440\u0438\u044e \u0432\u043e\u043f\u0440\u043e\u0441\u0430, \u043a\u0440\u0430\u0442\u043a\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435.<\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c \u0432\u0438\u0434\u0435 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435\u00a0<em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_j \\pm \\sigma_j\" alt=\"p_j \\pm \\sigma_j\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ecf\/c4f\/fb7\/ecfc4ffb7f25b878f404b3233f6ef80d.svg\" width=\"60\" height=\"21\"\/><\/em>, \u0433\u0434\u0435\u00a0<em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_j\" alt=\"p_j\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8a6\/4f4\/d7f\/8a64f4d7f57c789d5b7c14f6dd1f710c.svg\" width=\"18\" height=\"17\"\/><\/em>\u00a0&#8212; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 j-\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043c\u043e\u0434\u0435\u043b\u0438, \u0430\u00a0<em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\sigma_j\" alt=\"\\sigma_j\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9a4\/549\/41b\/9a454941bd842b032d8e7b29bc2a01fd.svg\" width=\"19\" height=\"17\"\/><\/em>\u00a0&#8212; \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430.<\/p>\n<p>\u0414\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u00a0<em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\sigma_j\" alt=\"\\sigma_j\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1bd\/8bc\/3ff\/1bd8bc3ffe42c1c58958a2b5db91403f.svg\" width=\"19\" height=\"17\"\/><\/em>\u00a0\u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u043a\u043e\u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0438 \u043e\u0446\u0435\u043d\u043e\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432\u00a0<em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\Sigma\" alt=\"\\Sigma\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f09\/1fe\/d45\/f091fed452fd3ddbc036b992fd52d940.svg\" width=\"14\" height=\"17\"\/><\/em>, \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044e \u043e\u0446\u0435\u043d\u043e\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0442\u043e \u0435\u0441\u0442\u044c:<\/p>\n<p><em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\begin{aligned} \\qquad \\sigma_j = \\sqrt{\\Sigma_{jj}}, \\text{ } j=\\overline{1,m} \\end{aligned}\" alt=\"\\begin{aligned} \\qquad \\sigma_j = \\sqrt{\\Sigma_{jj}}, \\text{ } j=\\overline{1,m} \\end{aligned}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/87d\/25b\/b83\/87d25bb831a4671ac906c5634d102bd9.svg\" width=\"218\" height=\"28\"\/><\/em><\/p>\n<p><em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\Sigma\" alt=\"\\Sigma\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e00\/cd1\/e9d\/e00cd1e9dd4585b47fd01f6b410ab4ca.svg\" width=\"14\" height=\"17\"\/><\/em>\u00a0\u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c\u00a0<em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"[m \\times m]\" alt=\"[m \\times m]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ae6\/d05\/f07\/ae6d05f078f9e3a5950fc09b47ddd10f.svg\" width=\"68\" height=\"22\"\/><\/em>, \u0433\u0434\u0435\u00a0<em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"m\" alt=\"m\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f75\/b65\/392\/f75b65392fbb7419dfac02715e72b84c.svg\" width=\"17\" height=\"12\"\/><\/em>\u00a0&#8212; \u0447\u0438\u0441\u043b\u043e \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c, \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u00a0<em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\Sigma\" alt=\"\\Sigma\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b24\/da5\/3bd\/b24da53bd815da46d7c992c938bfa8ae.svg\" width=\"14\" height=\"17\"\/><\/em>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438\u00a0<strong>Python<\/strong>:<\/p>\n<ol>\n<li>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<strong>scipy.optimize.curve_fit<\/strong>\u00a0\u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u0443\u044e \u043a\u043e\u0432\u0430\u0440\u0438\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443\u00a0<em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\Sigma\" alt=\"\\Sigma\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dc3\/ada\/c87\/dc3adac875db70dfa95b50c8de7b55a4.svg\" width=\"14\" height=\"17\"\/><\/em>\u00a0(The estimated covariance of popt), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043a\u0430\u043a\u00a0<strong>pcov<\/strong>\u00a0(\u0441\u043c.\u00a0<a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.curve_fit.html\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.curve_fit.html<\/a>). \u0420\u0430\u0441\u0447\u0435\u0442\u043d\u0430\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e:\u00a0<strong>perr = np.sqrt(np.diag(pcov))<\/strong>.<\/p>\n<\/li>\n<li>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<strong>scipy.optimize.leastsq<\/strong>\u00a0\u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u0430\u0442\u0440\u0438\u0446\u0443, \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u0413\u0435\u0441\u0441\u0435 (The inverse of the Hessian)\u00a0<em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"H^{-1}\" alt=\"H^{-1}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a0f\/fef\/34d\/a0ffef34d8c306a2d329219babf35a14.svg\" width=\"37\" height=\"21\"\/><\/em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043a\u0430\u043a\u00a0<strong>cov_x<\/strong>. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u00a0<em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\Sigma\" alt=\"\\Sigma\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/742\/15a\/2c0\/74215a2c0e2d0bdfbabcfecb1d737b6b.svg\" width=\"14\" height=\"17\"\/><\/em>, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043c\u043d\u043e\u0436\u0438\u0442\u044c\u00a0<em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"H^{-1}\" alt=\"H^{-1}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e6a\/ae7\/45d\/e6aae745dfbc2b734b14d83dd7722e2b.svg\" width=\"37\" height=\"21\"\/><\/em>\u00a0\u043d\u0430 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0443 \u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0439 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u0438<\/p>\n<p><em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"MSE = \\frac{SSE}{df_E} = \\frac{1}{n-m-1} \\cdot \\displaystyle\\sum_{i=1}^{n} (y_i - \\widehat{y}_i)^2\" alt=\"MSE = \\frac{SSE}{df_E} = \\frac{1}{n-m-1} \\cdot \\displaystyle\\sum_{i=1}^{n} (y_i - \\widehat{y}_i)^2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e8f\/a0c\/96c\/e8fa0c96cf730e756c5a9ed33cf1978a.svg\" width=\"360\" height=\"57\"\/><\/em>:<\/p>\n<p><em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\begin{aligned}  \\Sigma = H^{-1} \\cdot MSE  \\end{aligned}\" alt=\"\\begin{aligned}  \\Sigma = H^{-1} \\cdot MSE  \\end{aligned}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a66\/679\/de1\/a66679de10ae4886624b029ab3863a87.svg\" width=\"144\" height=\"24\"\/><\/em><\/p>\n<p>\u0438\u043b\u0438 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c \u043a\u043e\u0434\u0435:\u00a0<strong>pcov = cov_x*MSE<\/strong>.<\/p>\n<p>\u0412\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u00a0<strong>SSE<\/strong>, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430\u044f \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430\u00a0<strong>MSE<\/strong>, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043a\u0430\u043a\u00a0<em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\mathsf{SSE = (infodict['fvec']**2).sum()}\" alt=\"\\mathsf{SSE = (infodict['fvec']**2).sum()}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8fc\/b0d\/2a0\/8fcb0d2a0ecba63a7637920cbdea2aba.svg\" width=\"284\" height=\"23\"\/><\/em>.<\/p>\n<\/li>\n<li>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<strong>scipy.optimize.least_squares<\/strong>\u00a0\u0432\u043c\u0435\u0441\u0442\u043e\u00a0<em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"H^{-1}\" alt=\"H^{-1}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c3a\/623\/2c1\/c3a6232c145fe9ef0b101036371affd9.svg\" width=\"37\" height=\"21\"\/><\/em>\u00a0\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u042f\u043a\u043e\u0431\u0438 (Modified Jacobian matrix)\u00a0<em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"J\" alt=\"J\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5e5\/412\/c4d\/5e5412c4d6d7b317e37cc3dc99bc4c5b.svg\" width=\"12\" height=\"17\"\/><\/em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043a\u0430\u043a\u00a0<strong>result.jac<\/strong>\u00a0(\u0441\u043c.\u00a0<a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.least_squares.html#scipy.optimize.least_squares\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.least_squares.html#scipy.optimize.least_squares<\/a>,\u00a0<a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.OptimizeResult.html#scipy.optimize.OptimizeResult\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.OptimizeResult.html#scipy.optimize.OptimizeResult<\/a>). \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u00a0<em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"H^{-1}\" alt=\"H^{-1}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/177\/357\/14b\/17735714baabfa31d065e029a01d1c83.svg\" width=\"37\" height=\"21\"\/><\/em>\u00a0\u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p><em><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\begin{aligned}  H^{-1} = (J^T J)^{-1}  \\end{aligned}\" alt=\"\\begin{aligned}  H^{-1} = (J^T J)^{-1}  \\end{aligned}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/505\/400\/726\/5054007264e3ee8454e210bea8c6ae24.svg\" width=\"139\" height=\"25\"\/><\/em><\/p>\n<p>\u0438\u043b\u0438 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c \u043a\u043e\u0434\u0435:\u00a0<strong>cov_x = np.linalg.inv(np.dot(result.jac.T, result.jac))<\/strong>.<\/p>\n<\/li>\n<li>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<strong>scipy.optimize.minimize<\/strong>\u00a0\u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438: \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0413\u0435\u0441\u0441\u0435 (Inverse of the objective function\u2019s Hessian), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043a\u0430\u043a\u00a0<strong>res.hess_inv<\/strong>\u00a0(\u0441\u043c.\u00a0<a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.minimize.html#scipy.optimize.minimize\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.minimize.html#scipy.optimize.minimize<\/a>,\u00a0<a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.OptimizeResult.html#scipy.optimize.OptimizeResult\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.OptimizeResult.html#scipy.optimize.OptimizeResult<\/a>), \u043d\u043e \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u00a0<strong>cov_x<\/strong>\u00a0\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c\u00a0<strong>cov_x = 2*res.hess_inv<\/strong>\u00a0(\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u0441\u043c.\u00a0<a href=\"https:\/\/stackoverflow.com\/questions\/40187517\/getting-covariance-matrix-of-fitted-parameters-from-scipy-optimize-least-squares\" rel=\"noopener noreferrer nofollow\">https:\/\/stackoverflow.com\/questions\/40187517\/getting-covariance-matrix-of-fitted-parameters-from-scipy-optimize-least-squares<\/a>).<\/p>\n<\/li>\n<li>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u00a0<strong>lmfit<\/strong>\u00a0\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0441 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0437\u0434\u0435\u0441\u044c:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/question-it.com\/questions\/9466217\/poluchenie-kovariatsionnoj-matritsy-podobrannyh-parametrov-iz-metoda-scipy-optimizeleast_squares\" rel=\"noopener noreferrer nofollow\">https:\/\/question-it.com\/questions\/9466217\/poluchenie-kovariatsionnoj-matritsy-podobrannyh-parametrov-iz-metoda-scipy-optimizeleast_squares<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/40187517\/getting-covariance-matrix-of-fitted-parameters-from-scipy-optimize-least-squares\" rel=\"noopener noreferrer nofollow\">https:\/\/stackoverflow.com\/questions\/40187517\/getting-covariance-matrix-of-fitted-parameters-from-scipy-optimize-least-squares<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/14854339\/in-scipy-how-and-why-does-curve-fit-calculate-the-covariance-of-the-parameter-es\" rel=\"noopener noreferrer nofollow\">https:\/\/stackoverflow.com\/questions\/14854339\/in-scipy-how-and-why-does-curve-fit-calculate-the-covariance-of-the-parameter-es<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/stackovergo.com\/ru\/q\/4167751\/in-scipy-how-and-why-does-curvefit-calculate-the-covariance-of-the-parameter-estimates\" rel=\"noopener noreferrer nofollow\">https:\/\/stackovergo.com\/ru\/q\/4167751\/in-scipy-how-and-why-does-curvefit-calculate-the-covariance-of-the-parameter-estimates<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/math.stackexchange.com\/questions\/2349026\/why-is-the-approximation-of-hessian-jtj-reasonable\" rel=\"noopener noreferrer nofollow\">https:\/\/math.stackexchange.com\/questions\/2349026\/why-is-the-approximation-of-hessian-jtj-reasonable<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/mmas.github.io\/least-squares-fitting-numpy-scipy\" rel=\"noopener noreferrer nofollow\">https:\/\/mmas.github.io\/least-squares-fitting-numpy-scipy<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.nedcharles.com\/regression\/Nonlinear_Least_Squares_Regression_For_Python.html\" rel=\"noopener noreferrer nofollow\">https:\/\/www.nedcharles.com\/regression\/Nonlinear_Least_Squares_Regression_For_Python.html<\/a><\/p>\n<\/li>\n<\/ul>\n<h2>\u0410\u041f\u041f\u0420\u041e\u041a\u0421\u0418\u041c\u0410\u0426\u0418\u042f \u0417\u0410\u0412\u0418\u0421\u0418\u041c\u041e\u0421\u0422\u0415\u0419<\/h2>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043d\u0430\u0431\u043e\u0440 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043e\u0431\u0437\u043e\u0440\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430\u0431\u043e\u0440 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0448\u0438\u0440\u043e\u043a\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0445 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u043c. \u0411\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 &#8212; \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u0430\u0441\u0438\u043c\u043f\u0442\u043e\u0442\u0430\u043c\u0438, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0435 \u043f\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u0438 \u043f\u0440. &#8212; \u0442\u0435\u043c\u0430 \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"python\"># equations linear_func = lambda x, b0, b1: b0 + b1*x quadratic_func = lambda x, b0, b1, b2: b0 + b1*x + b2*x**2 qubic_func = lambda x, b0, b1, b2, b3: b0 + b1*x + b2*x**2 + b3*x**3 power_func = lambda x, b0, b1: b0 * (x**b1) exponential_type_1_func = lambda x, b0, b1: b0*np.exp(b1*x) exponential_type_2_func = lambda x, b0, b1: b0*np.power(b1, x) logarithmic_func = lambda x, b0, b1: b0 + b1*np.log(x) hyperbolic_func = lambda x, b0, b1: b0 + b1\/x<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044e: \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a\u0438, \u043f\u0440\u0438\u0447\u0435\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u043b\u0438\u0441\u044c \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 (\u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c Excel &#8212; \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e), \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u0440\u0430\u0442\u043a\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 <strong>lmfit<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0448\u0438\u0440\u043e\u043a\u0438\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438.<\/p>\n<h3>\u0410\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c scipy.optimize.leastsq<\/h3>\n<p><u>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/u><\/p>\n<ol>\n<li>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0432, <u>\u0431\u0435\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438<\/u> \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u043c \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e, \u0441 <strong>least_squares<\/strong>.<\/p>\n<p><a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.leastsq.html#scipy.optimize.leastsq\" rel=\"noopener noreferrer nofollow\"><u>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/u><\/a>.<\/p>\n<pre><code class=\"python\">from scipy.optimize import leastsq  # list of model model_list = [     'linear', 'quadratic',     'qubic', 'power',     'exponential type 1', 'exponential type 2',     'logarithmic',     'hyperbolic']  # model reference models_dict = {         'linear':             linear_func,         'quadratic':          quadratic_func,         'qubic':              qubic_func,         'power':              power_func,         'exponential type 1': exponential_type_1_func,         'exponential type 2': exponential_type_2_func,         'logarithmic':        logarithmic_func,         'hyperbolic':         hyperbolic_func}  # initial values p0_dict = {         'linear':             [0, 0],         'quadratic':          [0, 0, 0],         'qubic':              [0, 0, 0, 0],         'power':              [0, 0],         'exponential type 1': [0, 0],         'exponential type 2': [1, 1],         'logarithmic':        [0, 0],         'hyperbolic':         [0, 0]}  # titles (formulas) formulas_dict = {         'linear':             'y = b0 + b1*x',         'quadratic':          'y = b0 + b1*x + b2*x^2',         'qubic':              'y = b0 + b1*x + b2*x^2 + b3*x^3',         'power':              'y = b0*x^b1',         'exponential type 1': 'y = b0*exp(b1^x)',         'exponential type 2': 'y = b0*b1^x',         'logarithmic':        'y = b0 + b1*ln(x)',         'hyperbolic':         'y = b0+b1\/x'}  # actual data X_fact = X1 Y_fact = Y  # function for calculating residuals residual_func = lambda p, x, y: y - func(x, *p)  # return all optional outputs full_output = True  # variables to save the calculation results calculation_results_df = pd.DataFrame(columns=['func', 'p0', 'popt', 'cov_x', 'SSE', 'MSE', 'pcov', 'perr', 'Y_calc', 'error_metrics']) error_metrics_results_df = pd.DataFrame(columns=['MSE', 'RMSE', 'MAE', 'MSPE', 'MAPE', 'RMSLE', 'R2'])  # calculations for func_name in model_list:     print(f'{func_name.upper()} MODEL: {formulas_dict[func_name]}')     func = models_dict[func_name]     calculation_results_df.loc[func_name, 'func'] = func     p0 = p0_dict[func_name]     print(f'p0 = {p0}')     calculation_results_df.loc[func_name, 'p0'] = p0     if full_output:         (popt, cov_x, infodict, mesg, ier) = leastsq(residual_func, p0, args=(X_fact, Y_fact), full_output=full_output)         integer_flag = f'ier = {ier}, the solution was found' if ier&lt;=4 else f'ier = {ier}, the solution was not found'         print(integer_flag, '\\n', mesg)         calculation_results_df.loc[func_name, 'popt'] = popt         print(f'parameters = {popt}')         calculation_results_df.loc[func_name, 'cov_x'] = cov_x         print(f'cov_x = \\n{cov_x}')         #SSE = (residual_func(popt, X_fact, Y_fact)**2).sum()         SSE = (infodict['fvec']**2).sum()         calculation_results_df.loc[func_name, 'SSE'] = SSE         print(f'SSE = {SSE}')         MSE = SSE \/ (len(Y_fact)-len(p0))         calculation_results_df.loc[func_name, 'MSE'] = MSE         print(f'MSE = {MSE}')         pcov = cov_x * MSE         calculation_results_df.loc[func_name, 'pcov'] = pcov         print(f'pcov =\\n {pcov}')         perr = np.sqrt(np.diag(pcov))         calculation_results_df.loc[func_name, 'perr'] = perr         print(f'perr = {perr}\\n')      else:         popt = leastsq(residual_func, p0, args=(X_fact, Y_fact), full_output=full_output)         calculation_results_df.loc[func_name, 'popt'] = popt         print(f'parameters = {popt}\\n')     Y_calc = func(X_fact, *popt)     calculation_results_df.loc[func_name, 'Y_calc'] = Y_calc     (error_metrics_dict, error_metrics_df) = regression_error_metrics(Yfact=Y_fact, Ycalc=Y_calc, model_name=func_name)     calculation_results_df.loc[func_name, 'error_metrics'] = error_metrics_dict.values()     error_metrics_results_df = pd.concat([error_metrics_results_df, error_metrics_df])        <\/code><\/pre>\n<pre><code>LINEAR MODEL: y = b0 + b1*x p0 = [0, 0] ier = 3, the solution was found   Both actual and predicted relative reductions in the sum of squares   are at most 0.000000 and the relative error between two consecutive iterates is at    most 0.000000 parameters = [ 1.1850e+01 -2.1760e-03] cov_x =  [[ 8.7797e-02 -7.3041e-05]  [-7.3041e-05  7.6636e-08]] SSE = 84.42039151684142 MSE = 1.5928375757894608 pcov =  [[ 1.3985e-01 -1.1634e-04]  [-1.1634e-04  1.2207e-07]] perr = [3.7396e-01 3.4938e-04]  QUADRATIC MODEL: y = b0 + b1*x + b2*x^2 p0 = [0, 0, 0] ier = 1, the solution was found   Both actual and predicted relative reductions in the sum of squares   are at most 0.000000 parameters = [ 1.4343e+01 -7.0471e-03  1.8760e-06] cov_x =  [[ 2.8731e-01 -4.6282e-04  1.5012e-07]  [-4.6282e-04  8.3812e-07 -2.9328e-10]  [ 1.5012e-07 -2.9328e-10  1.1295e-13]] SSE = 53.26102533463595 MSE = 1.0242504872045375 pcov =  [[ 2.9428e-01 -4.7404e-04  1.5376e-07]  [-4.7404e-04  8.5844e-07 -3.0039e-10]  [ 1.5376e-07 -3.0039e-10  1.1569e-13]] perr = [5.4247e-01 9.2652e-04 3.4013e-07]  QUBIC MODEL: y = b0 + b1*x + b2*x^2 + b3*x^3 p0 = [0, 0, 0, 0] ier = 1, the solution was found   Both actual and predicted relative reductions in the sum of squares   are at most 0.000000 parameters = [ 1.4838e+01 -8.8040e-03  3.5207e-06 -4.1264e-10] cov_x =  [[ 5.7657e-01 -1.4894e-03  1.1111e-06 -2.4112e-10]  [-1.4894e-03  4.4815e-06 -3.7039e-09  8.5573e-13]  [ 1.1111e-06 -3.7039e-09  3.3058e-12 -8.0107e-16]  [-2.4112e-10  8.5573e-13 -8.0107e-16  2.0099e-19]] SSE = 52.41383349470524 MSE = 1.0277222253863771 pcov =  [[ 5.9256e-01 -1.5307e-03  1.1419e-06 -2.4780e-10]  [-1.5307e-03  4.6057e-06 -3.8066e-09  8.7945e-13]  [ 1.1419e-06 -3.8066e-09  3.3974e-12 -8.2328e-16]  [-2.4780e-10  8.7945e-13 -8.2328e-16  2.0656e-19]] perr = [7.6978e-01 2.1461e-03 1.8432e-06 4.5449e-10]  POWER MODEL: y = b0*x^b1 p0 = [0, 0] ier = 1, the solution was found   Both actual and predicted relative reductions in the sum of squares   are at most 0.000000 parameters = [33.4033 -0.1841] cov_x =  [[ 1.2667e+01 -5.7225e-02]  [-5.7225e-02  2.6284e-04]] SSE = 49.87968652194349 MSE = 0.9411261607913867 pcov =  [[ 1.1922e+01 -5.3856e-02]  [-5.3856e-02  2.4737e-04]] perr = [3.4528 0.0157]  EXPONENTIAL TYPE 1 MODEL: y = b0*exp(b1^x) p0 = [0, 0] ier = 1, the solution was found   Both actual and predicted relative reductions in the sum of squares   are at most 0.000000 parameters = [ 1.2624e+01 -2.7834e-04] cov_x =  [[ 1.5566e-01 -1.1829e-05]  [-1.1829e-05  1.1127e-09]] SSE = 75.19491109027253 MSE = 1.4187719073636327 pcov =  [[ 2.2085e-01 -1.6783e-05]  [-1.6783e-05  1.5787e-09]] perr = [4.6994e-01 3.9733e-05]  EXPONENTIAL TYPE 2 MODEL: y = b0*b1^x p0 = [1, 1] ier = 1, the solution was found   Both actual and predicted relative reductions in the sum of squares   are at most 0.000000 parameters = [12.6242  0.9997] cov_x =  [[ 1.5566e-01 -1.1826e-05]  [-1.1826e-05  1.1121e-09]] SSE = 75.19491108954423 MSE = 1.4187719073498912 pcov =  [[ 2.2085e-01 -1.6778e-05]  [-1.6778e-05  1.5778e-09]] perr = [4.6994e-01 3.9722e-05]  LOGARITHMIC MODEL: y = b0 + b1*ln(x) p0 = [0, 0] ier = 3, the solution was found   Both actual and predicted relative reductions in the sum of squares   are at most 0.000000 and the relative error between two consecutive iterates is at    most 0.000000 parameters = [23.9866 -2.1170] cov_x =  [[ 2.1029 -0.3106]  [-0.3106  0.0463]] SSE = 49.34256729321431 MSE = 0.9309918357210247 pcov =  [[ 1.9578 -0.2891]  [-0.2891  0.0431]] perr = [1.3992 0.2075]  HYPERBOLIC MODEL: y = b0+b1\/x p0 = [0, 0] ier = 1, the solution was found   Both actual and predicted relative reductions in the sum of squares   are at most 0.000000 parameters = [  9.2219 315.7336] cov_x =  [[ 2.2732e-02 -2.5920e+00]  [-2.5920e+00  1.4765e+03]] SSE = 78.69038671392151 MSE = 1.4847242776211607 pcov =  [[ 3.3751e-02 -3.8485e+00]  [-3.8485e+00  2.1922e+03]] perr = [ 0.1837 46.8207]<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 DataFrame, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u0432\u0441\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 &#8212; \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u043e\u0434\u0435\u043b\u0435\u0439 (<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"b_0\" alt=\"b_0\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/133\/847\/46a\/13384746a8bf46ffd11d5a6211cf305d.svg\" width=\"17\" height=\"20\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"b_1\" alt=\"b_1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0f6\/0d4\/43a\/0f60d443a21ea8abefb4243b35e3b0eb.svg\" width=\"17\" height=\"19\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"b_2\" alt=\"b_2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7e4\/f6a\/6b7\/7e4f6a6b78676898c6b783b7a4f2b569.svg\" width=\"17\" height=\"19\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"b_3\" alt=\"b_3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/84f\/378\/e48\/84f378e48e6aa7fdfffe4277c5b5413d.svg\" width=\"17\" height=\"20\"\/>), \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 (<strong>MSE<\/strong>, <strong>RMSE<\/strong>, <strong>MAE<\/strong>, <strong>MSPE<\/strong>, <strong>MAPE<\/strong>, <strong>RMSLE<\/strong>, <strong><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"R^2\" alt=\"R^2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d9c\/63a\/281\/d9c63a2813bfabd7a3e661877dcc3fb8.svg\" width=\"23\" height=\"21\"\/><\/strong>) \u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f (<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_0\" alt=\"p_0\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/149\/173\/015\/149173015b54fc48e1bb063b146058d9.svg\" width=\"19\" height=\"15\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_1\" alt=\"p_1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/368\/98a\/1d4\/36898a1d4a942fece77987447a318c0d.svg\" width=\"19\" height=\"15\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_2\" alt=\"p_2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a48\/0ca\/2b5\/a480ca2b541f924cbb1376f047b6c77a.svg\" width=\"19\" height=\"15\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p_3\" alt=\"p_3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/29c\/231\/4bf\/29c2314bf2fa0bc51d06381300ce1046.svg\" width=\"19\" height=\"15\"\/>).<\/p>\n<p>\u0414\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 Python \u043f\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0430\u0431\u043b\u0438\u0446 (<a href=\"https:\/\/pandas.pydata.org\/pandas-docs\/stable\/user_guide\/style.html\" rel=\"noopener noreferrer nofollow\">https:\/\/pandas.pydata.org\/pandas-docs\/stable\/user_guide\/style.html<\/a>):<\/p>\n<ul>\n<li>\n<p>\u0437\u0430\u043c\u0435\u043d\u0438\u043c <strong>nan<\/strong> \u043d\u0430 &#171;-&#171;;<\/p>\n<\/li>\n<li>\n<p>\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0440\u0430\u0432\u043d\u0438\u043c\u0430 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0435\u0434\u0435\u043b\u043e\u043c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f (<strong>DecPlace<\/strong>), \u0432\u044b\u0434\u0435\u043b\u0438\u043c \u0446\u0432\u0435\u0442\u043e\u043c (orange);<\/p>\n<\/li>\n<li>\n<p>\u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"b_1\" alt=\"b_1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cb0\/26f\/4ce\/cb026f4ce9bff310cf486a60e66de585.svg\" width=\"17\" height=\"19\"\/> \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u043d\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0430 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"b_2\" alt=\"b_2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1e6\/ede\/363\/1e6ede363f7e3d5a49ee2b76242fb0e7.svg\" width=\"17\" height=\"19\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"b_3\" alt=\"b_3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e5d\/266\/187\/e5d266187a7805ff91ec84688cd5b39c.svg\" width=\"17\" height=\"20\"\/> \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442;<\/p>\n<\/li>\n<li>\n<p>\u0434\u043b\u044f \u043c\u0435\u0442\u0440\u0438\u043a \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0446\u0432\u0435\u0442\u043e\u043c \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0433\u043e (green) \u0438 \u043d\u0430\u0438\u0445\u0443\u0434\u0448\u0435\u0433\u043e (red) \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 &#8212; \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>regression_error_metrics<\/strong> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u0430\u043a \u0432 \u0432\u0438\u0434\u0435 DataFrame, \u0442\u0430\u043a \u0438 \u0432 \u0432\u0438\u0434\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u044f (dict):<\/p>\n<ul>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 DataFrame, \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 <strong>MSPE<\/strong> \u0438 <strong>MAPE<\/strong>, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>regression_error_metrics<\/strong> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 (\u0438\u0437-\u0437\u0430 \u0437\u043d\u0430\u043a\u0430 &#8216;%&#8217;) \u0438 \u043f\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0438 \u043d\u0430\u0438\u0445\u0443\u0434\u0448\u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 &#8216;10%&#8217; \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u043b\u0443\u0447\u0448\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c, \u0447\u0435\u043c &#8216;9%&#8217; \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0437\u043d\u0430\u043a &#8216;%&#8217; \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 float;<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u044f (dict), \u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442.<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">result_df = pd.DataFrame(                 list(calculation_results_df.loc[:,'p0'].values),                 columns=['p0', 'p1', 'p2', 'p3'],                 index=model_list)  result_df = result_df.join(pd.DataFrame(                                 list(calculation_results_df.loc[:,'popt'].values),                                 columns=['b0', 'b1', 'b2', 'b3'],                                 index=model_list))  result_df = result_df.join(pd.DataFrame(                                 list(calculation_results_df.loc[:,'perr'].values),                                 columns=['std(b0)', 'std(b1)', 'std(b2)', 'std(b3)'],                                 index=model_list))  result_df = result_df.join(pd.DataFrame(                                 list(calculation_results_df.loc[:,'error_metrics'].values),                                 columns=['MSE', 'RMSE','MAE', 'MSPE', 'MAPE', 'RMSLE', 'R2'],                                 index=model_list))  display(result_df)  # settings for displaying the DataFrame: result_df result_df_leastsq = result_df.copy() '''for elem in ['MSPE', 'MAPE']:     result_df_leastsq[elem] = result_df_leastsq[elem].apply(lambda s: float(s[:-1]))''' print('scipy.optimize.leastsq:'.upper()) display(result_df_leastsq         .style             .format(                 precision=DecPlace, na_rep='-',                 formatter={                     'b1': '{:.' + str(DecPlace + 3) + 'f}',                     'b2': '{:.' + str(DecPlace) + 'e}',                     'b3': '{:.' + str(DecPlace) + 'e}',                     'std(b1)': '{:.' + str(DecPlace + 3) + 'f}',                     'std(b2)': '{:.' + str(DecPlace) + 'e}',                     'std(b3)': '{:.' + str(DecPlace) + 'e}'})             .highlight_min(color='green', subset=['MSE', 'RMSE', 'MAE', 'MSPE', 'MAPE', 'RMSLE'])             .highlight_max(color='red', subset=['MSE', 'RMSE', 'MAE', 'MSPE', 'MAPE', 'RMSLE'])             .highlight_max(color='green', subset='R2')             .highlight_min(color='red', subset='R2')             .applymap(lambda x: 'color: orange;' if abs(x) &lt;= 10**(-(DecPlace-1)) else None, subset=['b0', 'b1', 'b2', 'b3', 'std(b0)', 'std(b1)', 'std(b2)', 'std(b3)']))    <\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/278\/ef4\/efd\/278ef4efd01d873ce9e03ea5b990900e.png\" width=\"1452\" height=\"620\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/278\/ef4\/efd\/278ef4efd01d873ce9e03ea5b990900e.png\"\/><\/figure>\n<p>\u0421\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c DataFrame, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"python\">result_df_with_perr = pd.DataFrame()  parameter_name_list = ['b0', 'b1', 'b2', 'b3'] result_df_with_perr[parameter_name_list] = result_df[parameter_name_list]  parameter_format_dict = {     'b0': '{:.' + str(DecPlace) + 'f}',     'b1': '{:.' + str(DecPlace + 3) + 'f}',     'b2': '{:.' + str(DecPlace) + 'e}',     'b3': '{:.' + str(DecPlace) + 'e}',     'std(b1)': '{:.' + str(DecPlace + 3) + 'f}',     'std(b2)': '{:.' + str(DecPlace) + 'e}',     'std(b3)': '{:.' + str(DecPlace) + 'e}'}  for parameter in parameter_name_list:     for model in result_df.index:         if not result_df.isna().loc[model, parameter]:             result_df_with_perr.loc[model, parameter] = \\                 str(parameter_format_dict[parameter].format(result_df.loc[model, parameter])) + \\                     ' ' + u\"\\u00B1\" + ' ' + \\                     str(parameter_format_dict[parameter].format(result_df.loc[model, 'std('+parameter+')']))             relative_errors = abs(result_df.loc[model, 'std('+parameter+')'] \/ result_df.loc[model, parameter])             result_df_with_perr.loc[model, 'error('+parameter+')'] = '{:.3%}'.format(relative_errors)  result_df_with_perr_leastsq = result_df_with_perr.copy() print('scipy.optimize.leastsq:'.upper()) display(result_df_with_perr_leastsq)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2fd\/913\/b26\/2fd913b2650e1f737d25fa62e7596115.png\" width=\"1151\" height=\"303\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2fd\/913\/b26\/2fd913b2650e1f737d25fa62e7596115.png\"\/><\/figure>\n<pre><code class=\"python\">XY_calc_df = pd.DataFrame({     'X_fact': X_fact,     'Y_fact': Y_fact}) for i, model in enumerate(model_list):     XY_calc_df[model] = calculation_results_df.loc[model, 'Y_calc'] display(XY_calc_df.head(), XY_calc_df.tail())<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e67\/a2a\/721\/e67a2a721beb58a8686de4af7530ac00.png\" width=\"607\" height=\"360\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e67\/a2a\/721\/e67a2a721beb58a8686de4af7530ac00.png\"\/><\/figure>\n<p>\u041f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 (\u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 Excel):<\/p>\n<pre><code class=\"python\"># setting colors for graphs color_dict = {         'linear':                      'blue',         'quadratic':                   'darkblue',         'qubic':                       'slateblue',         'power':                       'magenta',         'exponential type 1':          'cyan',         'exponential type 2':          'black',         'logarithmic':                 'orange',         'inverse logarithmic':         'gold',         'hyperbolic':                  'grey',         'hyperbolic type 2':           'darkgrey',         'hyperbolic type 3':           'lightgrey',         'modified exponential type 1': 'darkcyan',         'modified exponential type 2': 'black',         'logistic type 1':             'green',         'logistic type 2':             'darkgreen',         'Gompertz':                    'brown'         }  linewidth_dict = {         'linear':                      2,         'quadratic':                   2,         'qubic':                       2,         'power':                       2,         'exponential type 1':          5,         'exponential type 2':          1,         'logarithmic':                 2,         'inverse logarithmic':         2,         'hyperbolic':                  2,         'hyperbolic type 2':           2,         'hyperbolic type 3':           2,         'modified exponential type 1': 2,         'modified exponential type 2': 2,         'logistic type 1':             2,         'logistic type 2':             2,         'Gompertz':                    2         }  # changing the Matplotlib settings plt.rcParams['axes.titlesize'] = 14 plt.rcParams['legend.fontsize'] = 12 plt.rcParams['xtick.labelsize'] = 12 plt.rcParams['ytick.labelsize'] = 12  # bounds of values of variables (when plotting) Xmin = X1_min_graph Xmax = X1_max_graph Ymin = Y_min_graph Ymax = Y_max_graph  # the value of the independent variable (when plotting) nx = 100 hx = (Xmax - Xmin)\/(nx - 1) X_calc_graph = np.linspace(Xmin, Xmax, nx)  # plotting fig, axes = plt.subplots(figsize=(420\/INCH, 297\/INCH)) title_figure = Title_String + '\\n' + Task_Theme + '\\n' fig.suptitle(title_figure, fontsize = 16) title_axes = 'Fuel mileage ratio' axes.set_title(title_axes, fontsize = 18)  # actual data sns.scatterplot(     x=X_fact, y=Y_fact,     label='data',     s=75,     color='red',     ax=axes)  # models for func_name in model_list:     R2 = round(result_df.loc[func_name,'R2'], DecPlace)     RMSE = round(result_df.loc[func_name,'RMSE'], DecPlace)     MAE = round(result_df.loc[func_name,'MAE'], DecPlace)     MSPE = \"{:.3%}\".format(result_df.loc[func_name,'MSPE'])     MAPE = \"{:.3%}\".format(result_df.loc[func_name,'MAPE'])     label = func_name + ' '+ r'$(R^2 = $' + f'{R2}' + ', ' + f'RMSE = {RMSE}' + ', ' + f'MAE = {MAE}' + ', ' + f'MSPE = {MSPE}' + ', ' + f'MAPE = {MAPE})'     func = calculation_results_df.loc[func_name, 'func']     popt = calculation_results_df.loc[func_name, 'popt']     sns.lineplot(         x=X_calc_graph, y=func(X_calc_graph, *popt),         color=color_dict[func_name],         linewidth=linewidth_dict[func_name],         legend=True,         label=label,         ax=axes)  axes.set_xlim(Xmin, Xmax) axes.set_ylim(Ymin, Ymax) axes.set_xlabel(Variable_Name_X1, fontsize = 14) axes.set_ylabel(Variable_Name_Y, fontsize = 14) axes.legend(prop={'size': 12})  plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/09a\/b89\/b7e\/09ab89b7e0d17c3b9a33c3e6bc87e11a.png\" width=\"990\" height=\"770\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/09a\/b89\/b7e\/09ab89b7e0d17c3b9a33c3e6bc87e11a.png\"\/><\/figure>\n<h3>\u0410\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c scipy.optimize.least_squares<\/h3>\n<p><u>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/u><\/p>\n<ol>\n<li>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <u>\u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e<\/u> \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0432, <u>\u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e<\/u> \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438: <\/p>\n<ul>\n<li>\n<p><strong>trf (Trust Region Reflective)<\/strong> &#8212; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p><strong>dogbox<\/strong> &#8212; \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p><strong>lm (Levenberg-Marquardt algorithm)<\/strong> &#8212; \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0431\u0435\u0437 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.least_squares.html#scipy.optimize.least_squares\" rel=\"noopener noreferrer nofollow\"><u>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/u><\/a>.<\/p>\n<pre><code class=\"python\">from scipy.optimize import least_squares  # algorithm to perform minimization methods_dict = {         'linear':             'lm',         'quadratic':          'lm',         'qubic':              'lm',         'power':              'lm',         'exponential type 1': 'lm',         'exponential type 2': 'lm',         'logarithmic':        'lm',         'hyperbolic':         'lm'}  # actual data X_fact = X1 Y_fact = Y  # function for calculating residuals residual_func = lambda p, x, y: y - func(x, *p)  # return all optional outputs full_output = True  # variables to save the calculation results calculation_results_df = pd.DataFrame(columns=['func', 'p0', 'popt', 'jac', 'hess', 'SSE', 'MSE', 'pcov', 'perr', 'Y_calc', 'error_metrics']) error_metrics_results_df = pd.DataFrame(columns=['MSE', 'RMSE', 'MAE', 'MSPE', 'MAPE', 'RMSLE', 'R2'])  # calculations for func_name in model_list:     print(f'{func_name.upper()} MODEL: {formulas_dict[func_name]}')     func = models_dict[func_name]     calculation_results_df.loc[func_name, 'func'] = func     p0 = p0_dict[func_name]     print(f'p0 = {p0}')     calculation_results_df.loc[func_name, 'p0'] = p0     res = sci.optimize.least_squares(residual_func, p0, args=(X_fact, Y_fact), method=methods_dict[func_name])     (popt, jac) = (res.x, res.jac)     calculation_results_df.loc[func_name, 'popt'] = popt     calculation_results_df.loc[func_name, 'jac'] = jac     print(f'parameters = {popt}')     #print(f'jac =\\n {jac}')     hess = np.linalg.inv(np.dot(jac.T, jac))     calculation_results_df.loc[func_name, 'hess'] = hess     print(f'hess =\\n {hess}')     SSE = (residual_func(popt, X_fact, Y_fact)**2).sum()     calculation_results_df.loc[func_name, 'SSE'] = SSE     print(f'SSE = {SSE}')     MSE = SSE \/ (len(Y_fact)-len(p0))     calculation_results_df.loc[func_name, 'MSE'] = MSE     print(f'MSE = {MSE}')     pcov = hess * MSE     calculation_results_df.loc[func_name, 'pcov'] = pcov     print(f'pcov =\\n {pcov}')     perr = np.sqrt(np.diag(pcov))     calculation_results_df.loc[func_name, 'perr'] = perr     print(f'perr = {perr}\\n')     Y_calc = func(X_fact, *popt)     calculation_results_df.loc[func_name, 'Y_calc'] = Y_calc     (error_metrics_dict, error_metrics_df) = regression_error_metrics(Yfact=Y_fact, Ycalc=Y_calc, model_name=func_name)     calculation_results_df.loc[func_name, 'error_metrics'] = error_metrics_dict.values()     error_metrics_results_df = pd.concat([error_metrics_results_df, error_metrics_df])<\/code><\/pre>\n<pre><code>LINEAR MODEL: y = b0 + b1*x p0 = [0, 0] parameters = [ 1.1850e+01 -2.1760e-03] hess =  [[ 8.7797e-02 -7.3041e-05]  [-7.3041e-05  7.6636e-08]] SSE = 84.42039151684142 MSE = 1.5928375757894608 pcov =  [[ 1.3985e-01 -1.1634e-04]  [-1.1634e-04  1.2207e-07]] perr = [3.7396e-01 3.4938e-04]  QUADRATIC MODEL: y = b0 + b1*x + b2*x^2 p0 = [0, 0, 0] parameters = [ 1.4343e+01 -7.0471e-03  1.8760e-06] hess =  [[ 2.8731e-01 -4.6282e-04  1.5012e-07]  [-4.6282e-04  8.3812e-07 -2.9328e-10]  [ 1.5012e-07 -2.9328e-10  1.1295e-13]] SSE = 53.26102533463595 MSE = 1.0242504872045375 pcov =  [[ 2.9428e-01 -4.7404e-04  1.5376e-07]  [-4.7404e-04  8.5844e-07 -3.0039e-10]  [ 1.5376e-07 -3.0039e-10  1.1569e-13]] perr = [5.4247e-01 9.2652e-04 3.4013e-07]  QUBIC MODEL: y = b0 + b1*x + b2*x^2 + b3*x^3 p0 = [0, 0, 0, 0] parameters = [ 1.4838e+01 -8.8040e-03  3.5207e-06 -4.1264e-10] hess =  [[ 5.7657e-01 -1.4894e-03  1.1111e-06 -2.4112e-10]  [-1.4894e-03  4.4815e-06 -3.7039e-09  8.5573e-13]  [ 1.1111e-06 -3.7039e-09  3.3058e-12 -8.0107e-16]  [-2.4112e-10  8.5573e-13 -8.0107e-16  2.0099e-19]] SSE = 52.413833494705216 MSE = 1.0277222253863767 pcov =  [[ 5.9256e-01 -1.5307e-03  1.1419e-06 -2.4780e-10]  [-1.5307e-03  4.6057e-06 -3.8066e-09  8.7945e-13]  [ 1.1419e-06 -3.8066e-09  3.3974e-12 -8.2328e-16]  [-2.4780e-10  8.7945e-13 -8.2328e-16  2.0656e-19]] perr = [7.6978e-01 2.1461e-03 1.8432e-06 4.5449e-10]  POWER MODEL: y = b0*x^b1 p0 = [0, 0] parameters = [33.4033 -0.1841] hess =  [[ 1.2667e+01 -5.7226e-02]  [-5.7226e-02  2.6284e-04]] SSE = 49.87968652202211 MSE = 0.94112616079287 pcov =  [[ 1.1922e+01 -5.3857e-02]  [-5.3857e-02  2.4737e-04]] perr = [3.4528 0.0157]  EXPONENTIAL TYPE 1 MODEL: y = b0*exp(b1^x) p0 = [0, 0] parameters = [ 1.2624e+01 -2.7834e-04] hess =  [[ 1.5566e-01 -1.1829e-05]  [-1.1829e-05  1.1127e-09]] SSE = 75.19491109027253 MSE = 1.4187719073636327 pcov =  [[ 2.2085e-01 -1.6782e-05]  [-1.6782e-05  1.5787e-09]] perr = [4.6994e-01 3.9732e-05]  EXPONENTIAL TYPE 2 MODEL: y = b0*b1^x p0 = [1, 1] parameters = [12.6242  0.9997] hess =  [[ 1.5566e-01 -1.1825e-05]  [-1.1825e-05  1.1121e-09]] SSE = 75.19491108936178 MSE = 1.4187719073464486 pcov =  [[ 2.2085e-01 -1.6778e-05]  [-1.6778e-05  1.5778e-09]] perr = [4.6994e-01 3.9721e-05]  LOGARITHMIC MODEL: y = b0 + b1*ln(x) p0 = [0, 0] parameters = [23.9866 -2.1170] hess =  [[ 2.1029 -0.3106]  [-0.3106  0.0463]] SSE = 49.342567293214316 MSE = 0.9309918357210248 pcov =  [[ 1.9578 -0.2891]  [-0.2891  0.0431]] perr = [1.3992 0.2075]  HYPERBOLIC MODEL: y = b0+b1\/x p0 = [0, 0] parameters = [  9.2219 315.7336] hess =  [[ 2.2732e-02 -2.5920e+00]  [-2.5920e+00  1.4765e+03]] SSE = 78.69038671392154 MSE = 1.484724277621161 pcov =  [[ 3.3751e-02 -3.8485e+00]  [-3.8485e+00  2.1922e+03]] perr = [ 0.1837 46.8207]<\/code><\/pre>\n<p>\u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c, \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 DataFrame, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u0432\u0441\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438, \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430:<\/p>\n<pre><code class=\"python\">result_df = pd.DataFrame(                 list(calculation_results_df.loc[:,'p0'].values),                 columns=['p0', 'p1', 'p2', 'p3'],                 index=model_list)  result_df = result_df.join(pd.DataFrame(                                 list(calculation_results_df.loc[:,'popt'].values),                                 columns=['b0', 'b1', 'b2', 'b3'],                                 index=model_list))  result_df = result_df.join(pd.DataFrame(                                 list(calculation_results_df.loc[:,'perr'].values),                                 columns=['std(b0)', 'std(b1)', 'std(b2)', 'std(b3)'],                                 index=model_list))  result_df = result_df.join(pd.DataFrame(                                 list(calculation_results_df.loc[:,'error_metrics'].values),                                 columns=['MSE', 'RMSE','MAE', 'MSPE', 'MAPE', 'RMSLE', 'R2'],                                 index=model_list))  #display(result_df)  # settings for displaying the DataFrame: result_df result_df_least_squares = result_df.copy() '''for elem in ['MSPE', 'MAPE']:     result_df_leastsq[elem] = result_df_leastsq[elem].apply(lambda s: float(s[:-1]))''' print('scipy.optimize.least_squares:'.upper()) display(result_df_least_squares         .style             .format(                 precision=DecPlace, na_rep='-',                 formatter={                     'b1': '{:.' + str(DecPlace + 3) + 'f}',                     'b2': '{:.' + str(DecPlace) + 'e}',                     'b3': '{:.' + str(DecPlace) + 'e}',                     'std(b1)': '{:.' + str(DecPlace + 3) + 'f}',                     'std(b2)': '{:.' + str(DecPlace) + 'e}',                     'std(b3)': '{:.' + str(DecPlace) + 'e}'})             .highlight_min(color='green', subset=['MSE', 'RMSE', 'MAE', 'MSPE', 'MAPE', 'RMSLE'])             .highlight_max(color='red', subset=['MSE', 'RMSE', 'MAE', 'MSPE', 'MAPE', 'RMSLE'])             .highlight_max(color='green', subset='R2')             .highlight_min(color='red', subset='R2')             .applymap(lambda x: 'color: orange;' if abs(x) &lt;= 10**(-(DecPlace-1)) else None, subset=['b0', 'b1', 'b2', 'b3', 'std(b0)', 'std(b1)', 'std(b2)', 'std(b3)']))      print('scipy.optimize.leastsq:'.upper()) display(result_df_leastsq         .style             .format(                 precision=DecPlace, na_rep='-',                 formatter={                     'b1': '{:.' + str(DecPlace + 3) + 'f}',                     'b2': '{:.' + str(DecPlace) + 'e}',                     'b3': '{:.' + str(DecPlace) + 'e}',                     'std(b1)': '{:.' + str(DecPlace + 3) + 'f}',                     'std(b2)': '{:.' + str(DecPlace) + 'e}',                     'std(b3)': '{:.' + str(DecPlace) + 'e}'})             .highlight_min(color='green', subset=['MSE', 'RMSE', 'MAE', 'MSPE', 'MAPE', 'RMSLE'])             .highlight_max(color='red', subset=['MSE', 'RMSE', 'MAE', 'MSPE', 'MAPE', 'RMSLE'])             .highlight_max(color='green', subset='R2')             .highlight_min(color='red', subset='R2')             .applymap(lambda x: 'color: orange;' if abs(x) &lt;= 10**(-(DecPlace-1)) else None, subset=['b0', 'b1', 'b2', 'b3', 'std(b0)', 'std(b1)', 'std(b2)', 'std(b3)']))    <\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cb9\/02e\/68d\/cb902e68db86d889ec34ab03363088ac.png\" width=\"1455\" height=\"304\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cb9\/02e\/68d\/cb902e68db86d889ec34ab03363088ac.png\"\/><\/figure>\n<p>\u0421\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c DataFrame, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438, \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430:<\/p>\n<pre><code class=\"python\">result_df_with_perr = pd.DataFrame()  parameter_name_list = ['b0', 'b1', 'b2', 'b3'] result_df_with_perr[parameter_name_list] = result_df[parameter_name_list]  parameter_format_dict = {     'b0': '{:.' + str(DecPlace) + 'f}',     'b1': '{:.' + str(DecPlace + 3) + 'f}',     'b2': '{:.' + str(DecPlace) + 'e}',     'b3': '{:.' + str(DecPlace) + 'e}',     'std(b1)': '{:.' + str(DecPlace + 3) + 'f}',     'std(b2)': '{:.' + str(DecPlace) + 'e}',     'std(b3)': '{:.' + str(DecPlace) + 'e}'}  for parameter in parameter_name_list:     for model in result_df.index:         if not result_df.isna().loc[model, parameter]:             result_df_with_perr.loc[model, parameter] = \\                 str(parameter_format_dict[parameter].format(result_df.loc[model, parameter])) + \\                     ' ' + u\"\\u00B1\" + ' ' + \\                     str(parameter_format_dict[parameter].format(result_df.loc[model, 'std('+parameter+')']))             relative_errors = abs(result_df.loc[model, 'std('+parameter+')'] \/ result_df.loc[model, parameter])             result_df_with_perr.loc[model, 'error('+parameter+')'] = '{:.3%}'.format(relative_errors)  result_df_with_perr_least_squares = result_df_with_perr.copy() print('scipy.optimize.least_squares:'.upper()) display(result_df_with_perr_least_squares)  print('scipy.optimize.leastsq:'.upper()) display(result_df_with_perr_leastsq)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f05\/7a0\/454\/f057a0454f84db3ae8339ff311dcefbe.png\" width=\"1164\" height=\"304\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f05\/7a0\/454\/f057a0454f84db3ae8339ff311dcefbe.png\"\/><\/figure>\n<h3>\u0410\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c scipy.optimize.curve_fit<\/h3>\n<p><u>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/u><\/p>\n<ol>\n<li>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <u>\u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e<\/u> \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0432, <u>\u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e<\/u> \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 (<strong>trf<\/strong>, <strong>dogbox<\/strong>, <strong>lm<\/strong>), \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 <strong>scipy.optimize.least_squares<\/strong>).<\/p>\n<\/li>\n<\/ol>\n<p><a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.curve_fit.html\" rel=\"noopener noreferrer nofollow\"><u>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/u><\/a>.<\/p>\n<pre><code class=\"python\">from scipy.optimize import curve_fit  # algorithm to perform minimization methods_dict = {         'linear':             'lm',         'quadratic':          'lm',         'qubic':              'lm',         'power':              'lm',         'exponential type 1': 'lm',         'exponential type 2': 'lm',         'logarithmic':        'lm',         'hyperbolic':         'lm'}  # actual data X_fact = X1 Y_fact = Y  # return all optional outputs full_output = True  # variables to save the calculation results calculation_results_df = pd.DataFrame(columns=['func', 'p0', 'popt', 'pcov', 'perr', 'Y_calc', 'error_metrics']) error_metrics_results_df = pd.DataFrame(columns=['MSE', 'RMSE', 'MAE', 'MSPE', 'MAPE', 'RMSLE', 'R2'])  # calculations for func_name in model_list:     print(f'{func_name.upper()} MODEL: {formulas_dict[func_name]}')     func = models_dict[func_name]     calculation_results_df.loc[func_name, 'func'] = func     p0 = p0_dict[func_name]     print(f'p0 = {p0}')     calculation_results_df.loc[func_name, 'p0'] = p0     if full_output:         (popt, pcov, infodict, mesg, ier) = curve_fit(func, X_fact, Y_fact, p0=p0, method=methods_dict[func_name], full_output=full_output)         integer_flag = f'ier = {ier}, the solution was found' if ier&lt;=4 else f'ier = {ier}, the solution was not found'         print(integer_flag, '\\n', mesg)         calculation_results_df.loc[func_name, 'popt'] = popt         print(f'parameters = {popt}')         calculation_results_df.loc[func_name, 'pcov'] = pcov         print(f'pcov =\\n {pcov}')         perr = np.sqrt(np.diag(pcov))         calculation_results_df.loc[func_name, 'perr'] = perr         print(f'perr = {perr}\\n')      else:         (popt, pcov) = curve_fit(func, X_fact, Y_fact, p0=p0, method=methods_dict[func_name], full_output=full_output)         calculation_results_df.loc[func_name, 'popt'] = popt         print(f'parameters = {popt}')         calculation_results_df.loc[func_name, 'pcov'] = pcov         print(f'pcov =\\n {pcov}')         perr = np.sqrt(np.diag(pcov))         calculation_results_df.loc[func_name, 'perr'] = perr         print(f'perr = {perr}\\n')      Y_calc = func(X_fact, *popt)     calculation_results_df.loc[func_name, 'Y_calc'] = Y_calc     (error_metrics_dict, error_metrics_df) = regression_error_metrics(Yfact=Y_fact, Ycalc=Y_calc, model_name=func_name)     calculation_results_df.loc[func_name, 'error_metrics'] = error_metrics_dict.values()     error_metrics_results_df = pd.concat([error_metrics_results_df, error_metrics_df])        <\/code><\/pre>\n<pre><code>LINEAR MODEL: y = b0 + b1*x p0 = [0, 0] ier = 3, the solution was found   Both actual and predicted relative reductions in the sum of squares   are at most 0.000000 and the relative error between two consecutive iterates is at    most 0.000000 parameters = [ 1.1850e+01 -2.1760e-03] pcov =  [[ 1.3985e-01 -1.1634e-04]  [-1.1634e-04  1.2207e-07]] perr = [3.7396e-01 3.4938e-04]  QUADRATIC MODEL: y = b0 + b1*x + b2*x^2 p0 = [0, 0, 0] ier = 1, the solution was found   Both actual and predicted relative reductions in the sum of squares   are at most 0.000000 parameters = [ 1.4343e+01 -7.0471e-03  1.8760e-06] pcov =  [[ 2.9428e-01 -4.7404e-04  1.5376e-07]  [-4.7404e-04  8.5844e-07 -3.0039e-10]  [ 1.5376e-07 -3.0039e-10  1.1569e-13]] perr = [5.4247e-01 9.2652e-04 3.4013e-07]  QUBIC MODEL: y = b0 + b1*x + b2*x^2 + b3*x^3 p0 = [0, 0, 0, 0] ier = 1, the solution was found   Both actual and predicted relative reductions in the sum of squares   are at most 0.000000 parameters = [ 1.4838e+01 -8.8040e-03  3.5207e-06 -4.1264e-10] pcov =  [[ 5.9256e-01 -1.5307e-03  1.1419e-06 -2.4780e-10]  [-1.5307e-03  4.6057e-06 -3.8066e-09  8.7945e-13]  [ 1.1419e-06 -3.8066e-09  3.3974e-12 -8.2328e-16]  [-2.4780e-10  8.7945e-13 -8.2328e-16  2.0656e-19]] perr = [7.6978e-01 2.1461e-03 1.8432e-06 4.5449e-10]  POWER MODEL: y = b0*x^b1 p0 = [0, 0] ier = 1, the solution was found   Both actual and predicted relative reductions in the sum of squares   are at most 0.000000 parameters = [33.4033 -0.1841] pcov =  [[ 1.1922e+01 -5.3856e-02]  [-5.3856e-02  2.4737e-04]] perr = [3.4528 0.0157]  EXPONENTIAL TYPE 1 MODEL: y = b0*exp(b1^x) p0 = [0, 0] ier = 1, the solution was found   Both actual and predicted relative reductions in the sum of squares   are at most 0.000000 parameters = [ 1.2624e+01 -2.7834e-04] pcov =  [[ 2.2085e-01 -1.6783e-05]  [-1.6783e-05  1.5787e-09]] perr = [4.6994e-01 3.9733e-05]  EXPONENTIAL TYPE 2 MODEL: y = b0*b1^x p0 = [1, 1] ier = 1, the solution was found   Both actual and predicted relative reductions in the sum of squares   are at most 0.000000 parameters = [12.6242  0.9997] pcov =  [[ 2.2085e-01 -1.6778e-05]  [-1.6778e-05  1.5778e-09]] perr = [4.6994e-01 3.9722e-05]  LOGARITHMIC MODEL: y = b0 + b1*ln(x) p0 = [0, 0] ier = 3, the solution was found   Both actual and predicted relative reductions in the sum of squares   are at most 0.000000 and the relative error between two consecutive iterates is at    most 0.000000 parameters = [23.9866 -2.1170] pcov =  [[ 1.9578 -0.2891]  [-0.2891  0.0431]] perr = [1.3992 0.2075]  HYPERBOLIC MODEL: y = b0+b1\/x p0 = [0, 0] ier = 1, the solution was found   Both actual and predicted relative reductions in the sum of squares   are at most 0.000000 parameters = [  9.2219 315.7336] pcov =  [[ 3.3751e-02 -3.8485e+00]  [-3.8485e+00  2.1922e+03]] perr = [ 0.1837 46.8207]<\/code><\/pre>\n<p>\u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c, \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 DataFrame, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u0432\u0441\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438, \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432:<\/p>\n<pre><code class=\"python\">result_df = pd.DataFrame(                 list(calculation_results_df.loc[:,'p0'].values),                 columns=['p0', 'p1', 'p2', 'p3'],                 index=model_list)  result_df = result_df.join(pd.DataFrame(                                 list(calculation_results_df.loc[:,'popt'].values),                                 columns=['b0', 'b1', 'b2', 'b3'],                                 index=model_list))  result_df = result_df.join(pd.DataFrame(                                 list(calculation_results_df.loc[:,'perr'].values),                                 columns=['std(b0)', 'std(b1)', 'std(b2)', 'std(b3)'],                                 index=model_list))  result_df = result_df.join(pd.DataFrame(                                 list(calculation_results_df.loc[:,'error_metrics'].values),                                 columns=['MSE', 'RMSE','MAE', 'MSPE', 'MAPE', 'RMSLE', 'R2'],                                 index=model_list))  #display(result_df)  # settings for displaying the DataFrame: result_df result_df_curve_fit = result_df.copy() '''for elem in ['MSPE', 'MAPE']:     result_df_leastsq[elem] = result_df_leastsq[elem].apply(lambda s: float(s[:-1]))''' print('scipy.optimize.curve_fit:'.upper()) display(result_df_curve_fit         .style             .format(                 precision=DecPlace, na_rep='-',                 formatter={                     'b1': '{:.' + str(DecPlace + 3) + 'f}',                     'b2': '{:.' + str(DecPlace) + 'e}',                     'b3': '{:.' + str(DecPlace) + 'e}',                     'std(b1)': '{:.' + str(DecPlace + 3) + 'f}',                     'std(b2)': '{:.' + str(DecPlace) + 'e}',                     'std(b3)': '{:.' + str(DecPlace) + 'e}'})             .highlight_min(color='green', subset=['MSE', 'RMSE', 'MAE', 'MSPE', 'MAPE', 'RMSLE'])             .highlight_max(color='red', subset=['MSE', 'RMSE', 'MAE', 'MSPE', 'MAPE', 'RMSLE'])             .highlight_max(color='green', subset='R2')             .highlight_min(color='red', subset='R2')             .applymap(lambda x: 'color: orange;' if abs(x) &lt;= 10**(-(DecPlace-1)) else None, subset=['b0', 'b1', 'b2', 'b3', 'std(b0)', 'std(b1)', 'std(b2)', 'std(b3)']))      print('scipy.optimize.least_squares:'.upper()) display(result_df_least_squares         .style             .format(                 precision=DecPlace, na_rep='-',                 formatter={                     'b1': '{:.' + str(DecPlace + 3) + 'f}',                     'b2': '{:.' + str(DecPlace) + 'e}',                     'b3': '{:.' + str(DecPlace) + 'e}',                     'std(b1)': '{:.' + str(DecPlace + 3) + 'f}',                     'std(b2)': '{:.' + str(DecPlace) + 'e}',                     'std(b3)': '{:.' + str(DecPlace) + 'e}'})             .highlight_min(color='green', subset=['MSE', 'RMSE', 'MAE', 'MSPE', 'MAPE', 'RMSLE'])             .highlight_max(color='red', subset=['MSE', 'RMSE', 'MAE', 'MSPE', 'MAPE', 'RMSLE'])             .highlight_max(color='green', subset='R2')             .highlight_min(color='red', subset='R2')             .applymap(lambda x: 'color: orange;' if abs(x) &lt;= 10**(-(DecPlace-1)) else None, subset=['b0', 'b1', 'b2', 'b3', 'std(b0)', 'std(b1)', 'std(b2)', 'std(b3)']))      print('scipy.optimize.least_squares:'.upper()) display(result_df_leastsq         .style             .format(                 precision=DecPlace, na_rep='-',                 formatter={                     'b1': '{:.' + str(DecPlace + 3) + 'f}',                     'b2': '{:.' + str(DecPlace) + 'e}',                     'b3': '{:.' + str(DecPlace) + 'e}',                     'std(b1)': '{:.' + str(DecPlace + 3) + 'f}',                     'std(b2)': '{:.' + str(DecPlace) + 'e}',                     'std(b3)': '{:.' + str(DecPlace) + 'e}'})             .highlight_min(color='green', subset=['MSE', 'RMSE', 'MAE', 'MSPE', 'MAPE', 'RMSLE'])             .highlight_max(color='red', subset=['MSE', 'RMSE', 'MAE', 'MSPE', 'MAPE', 'RMSLE'])             .highlight_max(color='green', subset='R2')             .highlight_min(color='red', subset='R2')             .applymap(lambda x: 'color: orange;' if abs(x) &lt;= 10**(-(DecPlace-1)) else None, subset=['b0', 'b1', 'b2', 'b3', 'std(b0)', 'std(b1)', 'std(b2)', 'std(b3)']))    <\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/990\/7a7\/a00\/9907a7a005dde543f56638118923afc4.png\" width=\"1463\" height=\"305\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/990\/7a7\/a00\/9907a7a005dde543f56638118923afc4.png\"\/><\/figure>\n<p>\u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c, \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 DataFrame, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438, \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432:<\/p>\n<pre><code class=\"python\">result_df_with_perr = pd.DataFrame()  parameter_name_list = ['b0', 'b1', 'b2', 'b3'] result_df_with_perr[parameter_name_list] = result_df[parameter_name_list]  parameter_format_dict = {     'b0': '{:.' + str(DecPlace) + 'f}',     'b1': '{:.' + str(DecPlace + 3) + 'f}',     'b2': '{:.' + str(DecPlace) + 'e}',     'b3': '{:.' + str(DecPlace) + 'e}',     'std(b1)': '{:.' + str(DecPlace + 3) + 'f}',     'std(b2)': '{:.' + str(DecPlace) + 'e}',     'std(b3)': '{:.' + str(DecPlace) + 'e}'}  for parameter in parameter_name_list:     for model in result_df.index:         if not result_df.isna().loc[model, parameter]:             result_df_with_perr.loc[model, parameter] = \\                 str(parameter_format_dict[parameter].format(result_df.loc[model, parameter])) + \\                     ' ' + u\"\\u00B1\" + ' ' + \\                     str(parameter_format_dict[parameter].format(result_df.loc[model, 'std('+parameter+')']))             relative_errors = abs(result_df.loc[model, 'std('+parameter+')'] \/ result_df.loc[model, parameter])             result_df_with_perr.loc[model, 'error('+parameter+')'] = '{:.3%}'.format(relative_errors)  result_df_with_perr_curve_fit = result_df_with_perr.copy() print('scipy.optimize.curve_fit:'.upper()) display(result_df_with_perr_curve_fit)  print('scipy.optimize.least_squares:'.upper()) display(result_df_with_perr_least_squares)  print('scipy.optimize.leastsq:'.upper()) display(result_df_with_perr_leastsq)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b15\/b42\/f63\/b15b42f63f0880d459ebf35d2cccf66a.png\" width=\"1169\" height=\"311\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b15\/b42\/f63\/b15b42f63f0880d459ebf35d2cccf66a.png\"\/><\/figure>\n<h3>\u0410\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c scipy.optimize.minimize<\/h3>\n<p><u>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/u><\/p>\n<ol>\n<li>\n<p>\u041c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u043a\u0430\u043b\u044f\u0440\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0434\u043d\u043e\u0439 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445; \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0443\u043c\u043c\u044b \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e <u>\u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e<\/u> \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u0430 \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 (<strong>Nelder-Mead<\/strong>, <strong>Powell<\/strong>, <strong>CG<\/strong>, <strong>BFGS<\/strong>, <strong>Newton-CG<\/strong>, <strong>L-BFGS-B<\/strong>, <strong>TNC<\/strong>, <strong>COBYLA<\/strong>, <strong>SLSQP<\/strong>, <strong>trust-constr<\/strong>, <strong>dogleg<\/strong>, <strong>trust-ncg<\/strong>, <strong>trust-exact<\/strong>, <strong>trust-krylov<\/strong>, custom), \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>scipy.optimize.show_options<\/strong> (<a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.show_options.html#scipy.optimize.show_options\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.show_options.html#scipy.optimize.show_options<\/a>), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<p><a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.minimize.html#scipy.optimize.minimize\" rel=\"noopener noreferrer nofollow\"><u>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/u><\/a>.<\/p>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0446\u0435\u043b\u044f\u0445 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u043c\u0435\u0441\u0442\u0430 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043e\u0431\u0437\u043e\u0440\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443; \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 \u043c\u043e\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 GitHub (<a href=\"https:\/\/github.com\/AANazarov\/Statistical-methods\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/AANazarov\/Statistical-methods<\/a>).<\/p>\n<h3>\u0410\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 lmfit<\/h3>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <strong>lmfit<\/strong> &#8212; \u044d\u0442\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 <strong>scipy.optimize<\/strong>.<\/p>\n<p><u>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <\/u><strong><u>lmfit<\/u><\/strong><u> \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438:<\/u><\/p>\n<ol>\n<li>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0442\u0438\u043f\u0430  <strong>float<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a\u043b\u0430\u0441\u0441\u0430 <strong>Parameter<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0448\u0438\u0440\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/parameters.html#lmfit.parameter.Parameter\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/parameters.html#lmfit.parameter.Parameter<\/a>): <\/p>\n<ul>\n<li>\n<p>\u0434\u043b\u044f \u043d\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 \u0430\u043b\u0433\u0435\u0431\u0440\u0430\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u043e\u0434\u0433\u043e\u043d\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u0433\u043e\u043d\u043a\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u043a\u0430\u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0448\u0430\u0433\u0430 \u0434\u043b\u044f \u0442\u043e\u0447\u0435\u043a \u0441\u0435\u0442\u043a\u0438 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0430 \u0438 \u0442.\u0434.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0418\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u0430 \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 (<strong>leastsq<\/strong> &#8212; default, <strong>least_squares<\/strong>, <strong>differential_evolution<\/strong>, <strong>brute<\/strong>, <strong>basinhopping<\/strong>, <strong>ampgo<\/strong>, <strong>nelder<\/strong>, <strong>lbfgsb<\/strong>, <strong>powell<\/strong>, <strong>cg<\/strong>, <strong>newton<\/strong>, <strong>cobyla<\/strong>, <strong>bfgs<\/strong>, <strong>tnc<\/strong>, <strong>trust-ncg<\/strong>, <strong>trust-exact<\/strong>, <strong>trust-krylov<\/strong>, <strong>trust-constr<\/strong>, <strong>dogleg<\/strong>, <strong>slsqp<\/strong>, <strong>emcee<\/strong>, <strong>shgo<\/strong>, <strong>dual_annealing<\/strong>) (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/fitting.html#choosing-different-fitting-methods\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/fitting.html#choosing-different-fitting-methods<\/a>).<\/p>\n<\/li>\n<li>\n<p>\u0418\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438: \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e &#8212; <strong>\u0441\u0443\u043c\u043c\u0430 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0432 \u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432<\/strong> <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\sum{{r_i}^2}\" alt=\"\\sum{{r_i}^2}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/134\/cba\/dc2\/134cbadc29b7feb46a84e9ce7867230f.svg\" width=\"55\" height=\"30\"\/>, \u043d\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f <strong>negentropy<\/strong> &#8212;  \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0430\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\rho \\cdot ln(\\rho)\" alt=\"\\rho \\cdot ln(\\rho)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b50\/46c\/ba4\/b5046cba4e2547e3f5a462af43ab41ee.svg\" width=\"66\" height=\"22\"\/> (\u0433\u0434\u0435<\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\rho = exp(\\frac{-\\frac{{r_i}^2}{2}}{\\sqrt{2\\pi}})\" alt=\"\\rho = exp(\\frac{-\\frac{{r_i}^2}{2}}{\\sqrt{2\\pi}})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3da\/5ab\/aa2\/3da5abaa2fd6db34fc3433689a78c1c0.svg\" width=\"126\" height=\"60\"\/>), <\/p>\n<p><strong>neglogcauchy<\/strong> &#8212; \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c,\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0430\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u041a\u043e\u0448\u0438<\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"-\\sum{ln(\\frac{1+{r_i}^2}{\\pi})}\" alt=\"-\\sum{ln(\\frac{1+{r_i}^2}{\\pi})}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3d8\/dbc\/21e\/3d8dbc21ef260cbde22ca68112da167f.svg\" width=\"146\" height=\"46\"\/>, <\/p>\n<p>\u043b\u0438\u0431\u043e <strong>callable<\/strong> &#8212; \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c; \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441\u043c. <a href=\"https:\/\/lmfit.github.io\/lmfit-py\/fitting.html#using-the-minimizer-class\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/fitting.html#using-the-minimizer-class<\/a>.<\/p>\n<\/li>\n<li>\n<p>\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0430 \u043e\u0446\u0435\u043d\u043a\u0430 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432. \u0425\u043e\u0442\u044f <strong>scipy.optimize.leastsq<\/strong> \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u0438\u0437 \u043a\u043e\u0432\u0430\u0440\u0438\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b, \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u0438\u0445 \u043e\u0446\u0435\u043d\u043e\u043a \u0438\u043d\u043e\u0433\u0434\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u044f. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043c\u043e\u0447\u044c \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, lmfit \u0438\u043c\u0435\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044f\u0432\u043d\u043e\u0433\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0443\u0440\u043e\u0432\u043d\u0435\u0439 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u0436\u0435 \u0432 \u0441\u0430\u043c\u044b\u0445 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c <strong>Model<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/model.html#lmfit.model.Model\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/model.html#lmfit.model.Model<\/a>).<\/p>\n<\/li>\n<li>\n<p>\u0418\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/builtin_models.html#builtin-models-chapter\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/builtin_models.html#builtin-models-chapter<\/a>).<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043d\u0430\u0434 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0430 <strong>Minimizer<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/fitting.html#using-the-minimizer-class\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/fitting.html#using-the-minimizer-class<\/a>).<\/p>\n<\/li>\n<li>\n<p>\u0418\u043c\u0435\u044e\u0442\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0432\u044b\u0432\u043e\u0434\u0430 \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432.<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435: <a href=\"https:\/\/lmfit.github.io\/lmfit-py\/\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/<\/a><\/p>\n<p>\u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 <strong>lmfit<\/strong> \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u0437\u0434\u0435\u0441\u044c \u0438\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441 \u0446\u0435\u043b\u044c\u044e \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438:<\/p>\n<ol>\n<li>\n<p>Fit with Data in a pandas DataFrame &#8212; \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u043c\u0441\u044f \u0432 pandas DataFrame (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_use_pandas.html#sphx-glr-examples-example-use-pandas-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_use_pandas.html#sphx-glr-examples-example-use-pandas-py<\/a>).<\/p>\n<\/li>\n<li>\n<p>Using an ExpressionModel &#8212; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f <strong>ExpressionModel<\/strong> \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_expression_model.html#sphx-glr-examples-example-expression-model-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_expression_model.html#sphx-glr-examples-example-expression-model-py<\/a>).<\/p>\n<\/li>\n<li>\n<p>Fit Using Inequality Constraint &#8212; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0442\u0438\u043f\u0430 \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432 (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_fit_with_inequality.html#sphx-glr-examples-example-fit-with-inequality-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_fit_with_inequality.html#sphx-glr-examples-example-fit-with-inequality-py<\/a>).<\/p>\n<\/li>\n<li>\n<p>Fit Using differential_evolution Algorithm &#8212; \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 <strong>Differential_evolution<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_diffev.html#sphx-glr-examples-example-diffev-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_diffev.html#sphx-glr-examples-example-diffev-py<\/a>).<\/p>\n<\/li>\n<li>\n<p>Fit Using Bounds &#8212; \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_fit_with_bounds.html#sphx-glr-examples-example-fit-with-bounds-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_fit_with_bounds.html#sphx-glr-examples-example-fit-with-bounds-py<\/a>).<\/p>\n<\/li>\n<li>\n<p>Fit Specifying Different Reduce Function &#8212; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_reduce_fcn.html#sphx-glr-examples-example-reduce-fcn-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_reduce_fcn.html#sphx-glr-examples-example-reduce-fcn-py<\/a>).<\/p>\n<\/li>\n<li>\n<p>Building a lmfit model with SymPy &#8212; \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 <strong>SymPy<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_sympy.html#sphx-glr-examples-example-sympy-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_sympy.html#sphx-glr-examples-example-sympy-py<\/a>).<\/p>\n<\/li>\n<li>\n<p>Fit with Algebraic Constraint &#8212; \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0430\u043b\u0433\u0435\u0431\u0440\u0430\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_fit_with_algebraic_constraint.html#sphx-glr-examples-example-fit-with-algebraic-constraint-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_fit_with_algebraic_constraint.html#sphx-glr-examples-example-fit-with-algebraic-constraint-py<\/a>).<\/p>\n<\/li>\n<li>\n<p>Fit Multiple Data Sets &#8212; \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043f\u043e\u0434\u0433\u043e\u043d\u043a\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_fit_multi_datasets.html#sphx-glr-examples-example-fit-multi-datasets-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_fit_multi_datasets.html#sphx-glr-examples-example-fit-multi-datasets-py<\/a>).<\/p>\n<\/li>\n<li>\n<p>Fit using the Model interface &#8212; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 <strong>Model<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_Model_interface.html#sphx-glr-examples-example-model-interface-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_Model_interface.html#sphx-glr-examples-example-model-interface-py<\/a>).<\/p>\n<\/li>\n<li>\n<p>Fit Specifying a Function to Compute the Jacobian &#8212; \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u044f\u043a\u043e\u0431\u0438\u0430\u043d\u0430 (\u0434\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439) (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_fit_with_derivfunc.html#sphx-glr-examples-example-fit-with-derivfunc-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_fit_with_derivfunc.html#sphx-glr-examples-example-fit-with-derivfunc-py<\/a>).<\/p>\n<\/li>\n<li>\n<p>Outlier detection via leave-one-out &#8212; \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_detect_outliers.html#sphx-glr-examples-example-detect-outliers-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_detect_outliers.html#sphx-glr-examples-example-detect-outliers-py<\/a>).<\/p>\n<\/li>\n<li>\n<p>Emcee and the Model Interface &#8212; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 <strong>emcee<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_emcee_Model_interface.html#sphx-glr-examples-example-emcee-model-interface-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_emcee_Model_interface.html#sphx-glr-examples-example-emcee-model-interface-py<\/a>). \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c <strong>emcee<\/strong> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u043d \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043d\u043e \u0431\u0435\u0437 \u044f\u0432\u043d\u043e\u0439 \u0446\u0435\u043b\u0438 \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0443\u0442\u043e\u0447\u043d\u0438\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0415\u0433\u043e \u043d\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438, \u043d\u043e \u044d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432\u043e\u043a\u0440\u0443\u0433 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043b\u0443\u0447\u0448\u0435\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432; \u0441\u043c. \u0442\u0430\u043a\u0436\u0435 <a href=\"https:\/\/emcee.readthedocs.io\/en\/stable\/\" rel=\"noopener noreferrer nofollow\">https:\/\/emcee.readthedocs.io\/en\/stable\/<\/a>.<\/p>\n<\/li>\n<li>\n<p>Complex Resonator Model &#8212; \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 (\u0440\u0435\u0437\u043e\u043d\u0430\u0442\u043e\u0440\u0430) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>lmfit.Model<\/strong> \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <strong>Model<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_complex_resonator_model.html#sphx-glr-examples-example-complex-resonator-model-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_complex_resonator_model.html#sphx-glr-examples-example-complex-resonator-model-py<\/a>).<\/p>\n<\/li>\n<li>\n<p>Model Selection using lmfit and emcee &#8212; \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c <strong>emcee<\/strong> \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0431\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/lmfit_emcee_model_selection.html#sphx-glr-examples-lmfit-emcee-model-selection-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/lmfit_emcee_model_selection.html#sphx-glr-examples-lmfit-emcee-model-selection-py<\/a>).<\/p>\n<\/li>\n<li>\n<p>Calculate Confidence Intervals &#8212; \u0440\u0430\u0441\u0447\u0435\u0442 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_confidence_interval.html#sphx-glr-examples-example-confidence-interval-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_confidence_interval.html#sphx-glr-examples-example-confidence-interval-py<\/a>).<\/p>\n<\/li>\n<li>\n<p>Fit Two Dimensional Peaks &#8212; \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0434\u0432\u0443\u0445\u043c\u0435\u0440\u043d\u044b\u043c\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_two_dimensional_peak.html#sphx-glr-examples-example-two-dimensional-peak-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_two_dimensional_peak.html#sphx-glr-examples-example-two-dimensional-peak-py<\/a>).<\/p>\n<\/li>\n<li>\n<p>Global minimization using the brute method (a.k.a. grid search) &#8212; \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c <strong>brute<\/strong> (\u043e\u043d \u0436\u0435 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0441\u0435\u0442\u043a\u0435) (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_brute.html#sphx-glr-examples-example-brute-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_brute.html#sphx-glr-examples-example-brute-py<\/a>). <\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 (Examples from the documentation):<\/p>\n<ol>\n<li>\n<p>C\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u0444\u0430\u0439\u043b *.sav: <\/p>\n<ul>\n<li>\n<p><strong>doc_model_savemodel.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_savemodel.html#sphx-glr-examples-documentation-model-savemodel-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_savemodel.html#sphx-glr-examples-documentation-model-savemodel-py<\/a>)<\/p>\n<\/li>\n<li>\n<p><strong>doc_model_savemodelresult.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_savemodelresult.html#sphx-glr-examples-documentation-model-savemodelresult-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_savemodelresult.html#sphx-glr-examples-documentation-model-savemodelresult-py<\/a>)<\/p>\n<\/li>\n<li>\n<p><strong>doc_model_savemodelresult2.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_savemodelresult2.html#sphx-glr-examples-documentation-model-savemodelresult2-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_savemodelresult2.html#sphx-glr-examples-documentation-model-savemodelresult2-py<\/a>)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 *.sav: <\/p>\n<ul>\n<li>\n<p><strong>doc_model_loadmodelresult.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_loadmodelresult.html#sphx-glr-examples-documentation-model-loadmodelresult-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_loadmodelresult.html#sphx-glr-examples-documentation-model-loadmodelresult-py<\/a>)<\/p>\n<\/li>\n<li>\n<p><strong>doc_model_loadmodelresult2.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_loadmodelresult2.html#sphx-glr-examples-documentation-model-loadmodelresult2-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_loadmodelresult2.html#sphx-glr-examples-documentation-model-loadmodelresult2-py<\/a>)<\/p>\n<\/li>\n<li>\n<p><strong>doc_model_loadmodel.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_loadmodel.html#sphx-glr-examples-documentation-model-loadmodel-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_loadmodel.html#sphx-glr-examples-documentation-model-loadmodel-py<\/a>)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0442\u0447\u0435\u0442\u043e\u0432: <\/p>\n<ul>\n<li>\n<p><strong>doc_fitting_withreport.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/fitting_withreport.html#sphx-glr-examples-documentation-fitting-withreport-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/fitting_withreport.html#sphx-glr-examples-documentation-fitting-withreport-py<\/a>)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430\u043c\u0438: <\/p>\n<ul>\n<li>\n<p><strong>doc_confidence_basic.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/confidence_basic.html#sphx-glr-examples-documentation-confidence-basic-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/confidence_basic.html#sphx-glr-examples-documentation-confidence-basic-py<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u0434\u043b\u044f \u043a\u0440\u0438\u0432\u043e\u0439 \u0413\u0430\u0443\u0441\u0441\u0430 <strong>doc_model_uncertainty.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_uncertainty.html#sphx-glr-examples-documentation-model-uncertainty-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_uncertainty.html#sphx-glr-examples-documentation-model-uncertainty-py<\/a>)<\/p>\n<\/li>\n<li>\n<p>doc_confidence_advanced.py (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/confidence_advanced.html#sphx-glr-examples-documentation-confidence-advanced-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/confidence_advanced.html#sphx-glr-examples-documentation-confidence-advanced-py<\/a>)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0410\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u0445 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439: <\/p>\n<ul>\n<li>\n<p>\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0413\u0430\u0443\u0441\u0441\u0430 &#8212; <strong>doc_model_gaussian.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_gaussian.html#sphx-glr-examples-documentation-model-gaussian-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_gaussian.html#sphx-glr-examples-documentation-model-gaussian-py<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u0441\u043c\u0435\u0441\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0413\u0430\u0443\u0441\u0441\u0430 \u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 &#8212; <strong>doc_model_two_components.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_two_components.html#sphx-glr-examples-documentation-model-two-components-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_two_components.html#sphx-glr-examples-documentation-model-two-components-py<\/a>)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043e\u043f\u0446\u0438\u0438 <strong>lmfit<\/strong>: <\/p>\n<ul>\n<li>\n<p><strong>doc_model_with_nan_policy.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_with_nan_policy.html#sphx-glr-examples-documentation-model-with-nan-policy-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_with_nan_policy.html#sphx-glr-examples-documentation-model-with-nan-policy-py<\/a>)<\/p>\n<\/li>\n<li>\n<p><strong>doc_model_with_iter_callback.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_with_iter_callback.html#sphx-glr-examples-documentation-model-with-iter-callback-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_with_iter_callback.html#sphx-glr-examples-documentation-model-with-iter-callback-py<\/a>)<\/p>\n<\/li>\n<li>\n<p><strong>doc_parameters_basic.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/parameters_basic.html#sphx-glr-examples-documentation-parameters-basic-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/parameters_basic.html#sphx-glr-examples-documentation-parameters-basic-py<\/a>)<\/p>\n<\/li>\n<li>\n<p><strong>doc_parameters_valuesdict.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/parameters_valuesdict.html#sphx-glr-examples-documentation-parameters-valuesdict-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/parameters_valuesdict.html#sphx-glr-examples-documentation-parameters-valuesdict-py<\/a>)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439: <\/p>\n<ul>\n<li>\n<p>\u0441\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u0430\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f <strong>doc_builtinmodels_stepmodel.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/builtinmodels_stepmodel.html#sphx-glr-examples-documentation-builtinmodels-stepmodel-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/builtinmodels_stepmodel.html#sphx-glr-examples-documentation-builtinmodels-stepmodel-py<\/a>), <strong>doc_model_composite.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_composite.html#sphx-glr-examples-documentation-model-composite-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_composite.html#sphx-glr-examples-documentation-model-composite-py<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u0441\u043c\u0435\u0441\u044c \u0434\u0432\u0443\u0445 \u0433\u0430\u0443\u0441\u0441\u043e\u0432\u044b\u0445 \u0438 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f: <strong>doc_builtinmodels_nistgauss.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/builtinmodels_nistgauss.html#sphx-glr-examples-documentation-builtinmodels-nistgauss-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/builtinmodels_nistgauss.html#sphx-glr-examples-documentation-builtinmodels-nistgauss-py<\/a>), <strong>doc_builtinmodels_nistgauss2.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/builtinmodels_nistgauss2.html#sphx-glr-examples-documentation-builtinmodels-nistgauss2-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/builtinmodels_nistgauss2.html#sphx-glr-examples-documentation-builtinmodels-nistgauss2-py<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u043f\u0438\u043a\u0430\u043c\u0438 (\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0413\u0430\u0443\u0441\u0441\u0430 \u0438 \u041a\u043e\u0448\u0438-\u041b\u043e\u0440\u0435\u043d\u0446\u0430 ) <strong>doc_builtinmodels_peakmodels.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/builtinmodels_peakmodels.html#sphx-glr-examples-documentation-builtinmodels-peakmodels-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/builtinmodels_peakmodels.html#sphx-glr-examples-documentation-builtinmodels-peakmodels-py<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u0441\u043f\u043b\u0430\u0439\u043d\u044b <strong>doc_builtinmodels_splinemodel.py<\/strong> (doc_builtinmodels_splinemodel.py)<\/p>\n<\/li>\n<li>\n<p>\u043e\u0431\u0437\u043e\u0440 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 (\u0441\u043c\u0435\u0441\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439, \u0434\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044b, \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0438 \u0442.\u0434.) <strong>doc_model_uncertainty2.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_uncertainty2.html#sphx-glr-examples-documentation-model-uncertainty2-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_uncertainty2.html#sphx-glr-examples-documentation-model-uncertainty2-py<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u0430\u043b\u0433\u043e\u0440\u0442\u0438\u043c <strong>emcee<\/strong> <strong>doc_fitting_emcee.py<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/fitting_emcee.html#sphx-glr-examples-documentation-fitting-emcee-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/fitting_emcee.html#sphx-glr-examples-documentation-fitting-emcee-py<\/a>)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u0438\u0435\u043c\u044b \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0432 <strong>lmfit<\/strong>:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u0438\u043c\u0435\u0440 1 &#8212; \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <strong>Model<\/strong> (\u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439);<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u043c\u0435\u0440 2 &#8212; \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <strong>Model<\/strong> \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 <strong>Parameter<\/strong>, \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u043c \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u043c\u0435\u0440 3 &#8212; \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>minimize<\/strong>;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u043c\u0435\u0440 4 &#8212; \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 <strong>Minimazer<\/strong>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0417\u0430\u0442\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u043d\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0432 <strong>lmfit<\/strong>:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u0438\u043c\u0435\u0440 5 &#8212; \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0441 \u0437\u0430\u0434\u0430\u043d\u0438\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (initial values) (\u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 I \u0442\u0438\u043f\u0430);<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u043c\u0435\u0440 6 &#8212; \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>lmfit<\/strong>;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u043c\u0435\u0440 7 &#8212; \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u043c\u0435\u0440 8 &#8212; \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432 (outlier detection) \u043f\u0440\u0438 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<\/ul>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 1 &#8212; \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 Model (\u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439)<\/h4>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0430\u043c\u0443\u044e \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0434\u043b\u044f \u043f\u043e\u0434\u0433\u043e\u043d\u043a\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434 <strong>fit<\/strong> \u043a\u043b\u0430\u0441\u0441\u0430 <strong>Model<\/strong>.<\/p>\n<p>\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u043a \u0440\u0430\u0441\u0447\u0435\u0442\u0443:<\/p>\n<ol>\n<li>\n<p>\u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 &#8212; \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 (<strong>X1<\/strong>, <strong>Y<\/strong>) &#8212; \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u043a \u0432\u0438\u0434\u0443, \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <strong>X1<\/strong>, \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>lmfit<\/strong> \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u043b\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>lmfit.Model<\/strong> \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>model.fit<\/strong> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044e (\u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432). \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u041b\u0435\u0432\u0435\u043d\u0431\u0435\u0440\u0433\u0430-\u041c\u0430\u0440\u043a\u0432\u0430\u0440\u0434\u0442\u0430 (Levenberg\u2013Marquardt algorithm) (<strong>leastsq<\/strong>, <strong>least_squares<\/strong>).<\/p>\n<\/li>\n<li>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>result.fit_report<\/strong> \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u043e\u0442\u0447\u0435\u0442 \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442: <\/p>\n<ul>\n<li>\n<p>\u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438: <strong>chi-square<\/strong>  &#8212; \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0443\u043c\u043c\u0430 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0432 \u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\chi^2 = \\sum{{e_i}^2}\" alt=\"\\chi^2 = \\sum{{e_i}^2}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ba9\/e08\/514\/ba9e08514690ce16bb022a293049774b.svg\" width=\"102\" height=\"30\"\/> (\u0442.\u0435. \u043f\u043e \u0441\u0443\u0442\u0438 <strong>SSE<\/strong>), <strong>reduced chi-square<\/strong><\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"{\\chi}_y^2 = \\frac{\\chi^2}{N-N_{varys}}\" alt=\"{\\chi}_y^2 = \\frac{\\chi^2}{N-N_{varys}}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5c2\/258\/e9c\/5c2258e9c4ab6ec42b5f852fc3a5e795.svg\" width=\"145\" height=\"51\"\/> \u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"R^2\" alt=\"R^2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1a9\/3da\/f88\/1a93daf886dfd0d046a82b228eb007d0.svg\" width=\"23\" height=\"21\"\/>;<\/p>\n<\/li>\n<li>\n<p>\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438 \u0410\u043a\u0430\u0438\u043a\u0435 \u0438 \u0411\u0430\u0439\u0435\u0441\u0430;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u043e\u0434\u0435\u043b\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"b_0\" alt=\"b_0\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/706\/2e5\/866\/7062e586629b3c3165a573ae45010371.svg\" width=\"17\" height=\"20\"\/> \u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"b_1\" alt=\"b_1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/480\/3e6\/740\/4803e6740942aed7922392b07acdec6d.svg\" width=\"17\" height=\"19\"\/> \u0441 \u0438\u0445 \u0441\u0442\u0430\u043d\u0434\u0440\u0430\u0442\u043d\u044b\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438, \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0432 % \u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438 (<strong>init<\/strong>);<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 <strong>C(b0, b1<\/strong>).<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0438\u0434\u044b \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432: <\/p>\n<ul>\n<li>\n<p><strong>result.plot_fit()<\/strong> &#8212; \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0442\u043e\u0447\u0435\u0447\u043d\u044b\u0439 \u0433\u0440\u0430\u0444\u0438\u043a;<\/p>\n<\/li>\n<li>\n<p><strong>result.plot_residuals()<\/strong> &#8212; \u0433\u0440\u0430\u0444\u0438\u043a \u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p><strong>result.plot()<\/strong> &#8212; \u0442\u043e\u0447\u0435\u0447\u043d\u044b\u0439 \u0433\u0440\u0430\u0444\u0438\u043a, \u0441\u043e\u0432\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u0439 \u0441 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u043c \u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">import lmfit print('{:&lt;35}{:^0}'.format(\"\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f lmfit: \", lmfit.__version__), '\\n')  # Preparation of input data dataset_sort_df = dataset_df.loc[:, ['X1', 'Y']].sort_values(by=['X1']) #display(dataset_sort_df) Y_sort = np.array(dataset_sort_df['Y']) #print(Y_sort, type(Y_sort), len(Y_sort)) X_sort = np.array(dataset_sort_df['X1']) #print(X_sort, type(X_sort), len(X_sort))  # LINEAR MODEL func_name = 'linear' print(f'{func_name.upper()} MODEL: {formulas_dict[func_name]}') func = models_dict[func_name] p0 = p0_dict[func_name] model = lmfit.Model(func, independent_vars=['x'], name=func_name) result = model.fit(Y_sort, x=X_sort, b0=p0[0], b1=p0[1]) print(result.fit_report()) result.plot_fit() plt.show() result.plot_residuals() plt.show() result.plot() plt.show() <\/code><\/pre>\n<pre><code>\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f lmfit:       1.1.0   LINEAR MODEL: y = b0 + b1*x [[Model]]     Model(linear) [[Fit Statistics]]     # fitting method   = leastsq     # function evals   = 7     # data points      = 55     # variables        = 2     chi-square         = 84.4203915     reduced chi-square = 1.59283758     Akaike info crit   = 27.5661686     Bayesian info crit = 31.5808350     R-squared          = 0.42259718 [[Variables]]     b0:  11.8501350 +\/- 0.37396000 (3.16%) (init = 0)     b1: -0.00217603 +\/- 3.4938e-04 (16.06%) (init = 0) [[Correlations]] (unreported correlations are &lt; 0.100)     C(b0, b1) = -0.890<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9b7\/250\/149\/9b72501496a9720c69c47984709aec42.png\" width=\"388\" height=\"285\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9b7\/250\/149\/9b72501496a9720c69c47984709aec42.png\"\/><\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/30d\/714\/bce\/30d714bce5007d6b10c48bb7c575e29f.png\" width=\"389\" height=\"267\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/30d\/714\/bce\/30d714bce5007d6b10c48bb7c575e29f.png\"\/><\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cc6\/447\/8b4\/cc64478b49e2513ccc6e03676ab14680.png\" width=\"389\" height=\"393\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cc6\/447\/8b4\/cc64478b49e2513ccc6e03676ab14680.png\"\/><\/figure>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 2 &#8212; \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 Model \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 Parameter, \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u043c \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432<\/h4>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044e \u0441 \u0431\u043e\u043b\u0435\u0435 \u0448\u0438\u0440\u043e\u043a\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>lmfit<\/strong> \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 <strong>Parameter<\/strong> \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043e\u0442\u0447\u0435\u0442\u044b;<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0440\u0430\u0441\u0447\u0435\u0442 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441\u043c. <a href=\"https:\/\/lmfit.github.io\/lmfit-py\/confidence.html#lmfit.conf_interval\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/confidence.html#lmfit.conf_interval<\/a>, <a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_confidence_interval.html#sphx-glr-examples-example-confidence-interval-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_confidence_interval.html#sphx-glr-examples-example-confidence-interval-py<\/a>, <a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/confidence_advanced.html#sphx-glr-examples-documentation-confidence-advanced-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/confidence_advanced.html#sphx-glr-examples-documentation-confidence-advanced-py<\/a>)).<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u043a \u0440\u0430\u0441\u0447\u0435\u0442\u0443:<\/p>\n<ol>\n<li>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <strong>X1<\/strong>.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>lmfit.Model<\/strong> \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>model.make_params<\/strong> \u0437\u0430\u0434\u0430\u0435\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0438 (\u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0434\u0430\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043d\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044f \u043f\u0440\u043e\u0447\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b &#8212; \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0430\u043b\u0433\u0435\u0431\u0440\u0430\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u0442.\u0434.).<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>model.fit<\/strong> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044e (\u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432), \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u043c \u043d\u0430\u0431\u043e\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a &#8212; \u0434\u043e\u0431\u0430\u0432\u0438\u043c <strong>method<\/strong> \u0438 <strong>nan_policy<\/strong> (\u043f\u0440\u0430\u0432\u0434\u0430, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <strong>leastsq<\/strong> \u0438 <strong>raise<\/strong>).<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>result.fit_report<\/strong> \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u043e\u0442\u0447\u0435\u0442 \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 (<strong>min_correl=0.2<\/strong>).<\/p>\n<\/li>\n<li>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>result.params.pretty_print()<\/strong> \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u043e\u0442\u0447\u0435\u0442 \u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>result.ci_report()<\/strong> \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u043e\u0442\u0447\u0435\u0442 \u043e \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>result.eval_components<\/strong> \u0438 <strong>result.eval<\/strong> \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438: \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#8212; \u0432 \u0432\u0438\u0434\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u044f (dict), \u0432\u043e-\u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#8212; \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 (numpy.ndarray).<\/p>\n<\/li>\n<li>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>result.eval_uncertainty<\/strong> \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0448\u0438\u0440\u0438\u043d\u0443 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0438 <strong>result.plot_fit()<\/strong> \u0438 <strong>result.plot_residuals()<\/strong> \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u0438\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 (\u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043a\u043d\u0430, \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u043e\u0441\u0435\u0439 \u0438 \u043f\u0440.).<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0434\u0432\u0443\u0445 \u0432\u0438\u0434\u043e\u0432: <\/p>\n<ul>\n<li>\n<p>\u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (<strong>data<\/strong>), \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043c\u043e\u0434\u0435\u043b\u0438 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 (<strong>best fit<\/strong>) \u0438 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0448\u0438\u0440\u0438\u043d\u043e\u0439 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"3\\sigma\" alt=\"3\\sigma\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e47\/db9\/454\/e47db94540b692d564818ffcc0e65838.svg\" width=\"21\" height=\"16\"\/>;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043e\u0441\u0442\u0430\u0442\u043a\u0438 (<strong>residuals<\/strong>).<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><u>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043a\u0430\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432<\/u>: \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 <strong>lmfit<\/strong> \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 <strong>Cannot determine Confidence Intervals without sensible uncertainty estimates<\/strong>, \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442 <strong>numdifftools<\/strong> (<a href=\"https:\/\/pypi.org\/project\/numdifftools\/\" rel=\"noopener noreferrer nofollow\">https:\/\/pypi.org\/project\/numdifftools\/<\/a>).<\/p>\n<pre><code class=\"python\"># POWER MODEL func_name = 'power' print(f'{func_name.upper()} MODEL: {formulas_dict[func_name]}')  # define objective function func = models_dict[func_name]  # initial values p0 = p0_dict[func_name]  # create a Model model = lmfit.Model(func,                        independent_vars=['x'],                     name=func_name)  # create a set of Parameters params = model.make_params(b0=p0[0],                            b1=p0[1])  # calculations result = model.fit(Y_sort, params, x=X_sort,                    method='leastsq',                    nan_policy='raise')  # report of the fitting results (https:\/\/lmfit.github.io\/lmfit-py\/model.html#lmfit.model.ModelResult.fit_report) print(f'result.fit_report:\\n{result.fit_report(min_correl=0.2)}\\n')  # report of parameters data (https:\/\/lmfit.github.io\/lmfit-py\/parameters.html#lmfit.parameter.Parameters.pretty_print) print('result.params.pretty_print():') result.params.pretty_print() print('\\n')  # report of the confidence intervals (https:\/\/lmfit.github.io\/lmfit-py\/confidence.html#lmfit.ci_report) print(f'result.ci_report:\\n{result.ci_report()}\\n')  # evaluate each component of a composite model function (https:\/\/lmfit.github.io\/lmfit-py\/model.html#lmfit.model.ModelResult.eval_components) comps = result.eval_components(x=X_sort) print(f'result.eval_components = \\n{comps}\\n')  # evaluate the uncertainty of the model function (https:\/\/lmfit.github.io\/lmfit-py\/model.html#lmfit.model.ModelResult.eval_uncertainty) dely = result.eval_uncertainty(sigma=3) print(f'result.eval_uncertainty(sigma=3) = \\n{dely}\\n')  # graphic (data, best-fit, uncertainty band and residuals) fig, axes = plt.subplots(2, 1, figsize=(297\/INCH, 210\/INCH)) fig.suptitle(f'Model({func_name})', fontsize=16)  #label = func_name + ' '+ r'$(R^2 = $' + f'{R2}' + ', ' + f'RMSE = {RMSE}' + ', ' + f'MAE = {MAE}' + ', ' + f'MSPE = {MSPE}' + ', ' + f'MAPE = {MAPE})' axes[0].set_title('data, best-fit, and uncertainty band') sns.scatterplot(x=X_sort, y=Y_sort, label='data', s=50, color='red', ax=axes[0]) R2 = round(result.rsquared, DecPlace) sns.lineplot(x=X_sort, y=result.best_fit, color='blue', linewidth=2, legend=True, label='best fit (' + r'$R^2 = $' + f'{R2})', ax=axes[0]) axes[0].fill_between(X_sort, result.best_fit-dely, result.best_fit+dely, color=\"grey\", alpha=0.3, label=r'3-$\\sigma$ band') axes[0].legend() axes[0].set_ylabel('Y') #axes[0].set_xlim(X1_min_graph, X1_max_graph) #axes[0].set_ylim(Y_min_graph, Y_max_graph)  sns.scatterplot(x=X_sort, y=-result.residual, ax=axes[1], s=50) axes[1].axhline(y = 0, color = 'k', linewidth = 1) axes[1].set_xlabel('X') axes[1].set_ylabel('residuals') #axes[1].set_xlim(X1_min_graph, X1_max_graph) #axes[1].set_ylim(Y_min_graph, Y_max_graph)  plt.show()<\/code><\/pre>\n<pre><code>POWER MODEL: y = b0*x^b1 result.fit_report: [[Model]]     Model(power) [[Fit Statistics]]     # fitting method   = leastsq     # function evals   = 29     # data points      = 55     # variables        = 2     chi-square         = 49.8796865     reduced chi-square = 0.94112616     Akaike info crit   = -1.37456420     Bayesian info crit = 2.64010217     R-squared          = 0.65884224 [[Variables]]     b0:  33.4032965 +\/- 3.45275807 (10.34%) (init = 0)     b1: -0.18409814 +\/- 0.01572801 (8.54%) (init = 0) [[Correlations]] (unreported correlations are &lt; 0.200)     C(b0, b1) = -0.992  result.params.pretty_print(): Name     Value      Min      Max   Stderr     Vary     Expr Brute_Step b0      33.4     -inf      inf    3.453     True     None     None b1   -0.1841     -inf      inf  0.01573     True     None     None   result.ci_report:        99.73%    95.45%    68.27%    _BEST_    68.27%    95.45%    99.73%  b0:  -9.61176  -6.50967  -3.33032  33.40330  +3.57568  +7.51972 +11.99711  b1:  -0.04701  -0.03103  -0.01551  -0.18410  +0.01594  +0.03283  +0.05128  result.eval_components =  {'power': array([17.1825, 12.2259, 11.9584, 11.2070, 11.1216, 10.7403, 10.4265,        10.3691, 10.3104, 10.2881, 10.2818, 10.1608, 10.1608, 10.0915,        10.0161, 10.0087,  9.9898,  9.9158,  9.8985,  9.7892,  9.7778,         9.7755,  9.7687,  9.7574,  9.7507,  9.6757,  9.6744,  9.6691,         9.6450,  9.5917,  9.5481,  9.4926,  9.4354,  9.4156,  9.4067,         9.3493,  9.3306,  9.3222,  9.3222,  9.3106,  9.2345,  9.1804,         9.1564,  9.0159,  9.0065,  8.9122,  8.8808,  8.8796,  8.8268,         8.6752,  8.6554,  8.1915,  8.1472,  8.1083,  7.7727])}  result.eval_uncertainty(sigma=3) =  [2.5746 0.8186 0.7464 0.5692 0.5522 0.4861 0.4464 0.4407 0.4355 0.4337  0.4332 0.4249 0.4249 0.4213 0.4183 0.4180 0.4174 0.4158 0.4155 0.4151  0.4151 0.4151 0.4152 0.4153 0.4154 0.4167 0.4167 0.4168 0.4174 0.4191  0.4208 0.4234 0.4265 0.4277 0.4282 0.4320 0.4333 0.4339 0.4339 0.4348  0.4408 0.4454 0.4476 0.4613 0.4623 0.4726 0.4762 0.4763 0.4825 0.5013  0.5039 0.5682 0.5747 0.5804 0.6303]<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/63f\/3d2\/465\/63f3d246562274794f6414d88ed346ec.png\" width=\"706\" height=\"559\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/63f\/3d2\/465\/63f3d246562274794f6414d88ed346ec.png\"\/><\/figure>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 3 &#8212; \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 minimize<\/h4>\n<p>\u041f\u0440\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>minimize<\/strong> \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441\u043c. <a href=\"https:\/\/lmfit.github.io\/lmfit-py\/fitting.html#the-minimize-function\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/fitting.html#the-minimize-function<\/a>.<\/p>\n<pre><code class=\"python\"># POWER MODEL func_name = 'power' print(f'{func_name.upper()} MODEL: {formulas_dict[func_name]}')  # define objective function func = models_dict[func_name]  # initial values p0 = p0_dict[func_name]  # create a set of Parameters params = lmfit.Parameters() params.add('b0', value=p0[0], min=-inf, max=inf) params.add('b1', value=p0[1], min=-inf, max=inf)  # function for calculating residuals residual_func = lambda params, x, ydata: func(x, params['b0'].value, params['b1'].value) - ydata  # calculations result = lmfit.minimize(residual_func, params, args=(X_sort, Y_sort)) lmfit.report_fit(result) #print(lmfit.fit_report(result))    # other type of output best_fit = Y_sort + result.residual<\/code><\/pre>\n<pre><code>POWER MODEL: y = b0*x^b1 [[Fit Statistics]]     # fitting method   = leastsq     # function evals   = 29     # data points      = 55     # variables        = 2     chi-square         = 49.8796865     reduced chi-square = 0.94112616     Akaike info crit   = -1.37456420     Bayesian info crit = 2.64010217 [[Variables]]     b0:  33.4032965 +\/- 3.45275807 (10.34%) (init = 0)     b1: -0.18409814 +\/- 0.01572801 (8.54%) (init = 0) [[Correlations]] (unreported correlations are &lt; 0.100)     C(b0, b1) = -0.992<\/code><\/pre>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 4 &#8212; \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 Minimazer<\/h4>\n<p>\u041f\u0440\u043e \u043a\u043b\u0430\u0441\u0441 <strong>Minimazer<\/strong> \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441\u043c. <a href=\"https:\/\/lmfit.github.io\/lmfit-py\/fitting.html#using-the-minimizer-class\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/fitting.html#using-the-minimizer-class<\/a>.<\/p>\n<pre><code class=\"python\"># POWER MODEL func_name = 'power' print(f'{func_name.upper()} MODEL: {formulas_dict[func_name]}')  # define objective function func = models_dict[func_name]  # initial values p0 = p0_dict[func_name]  # create a set of Parameters params = lmfit.Parameters() params.add('b0', value=p0[0], min=-inf, max=inf) params.add('b1', value=p0[1], min=-inf, max=inf)  # function for calculating residuals residual_func = lambda params, x, ydata: func(x, params['b0'].value, params['b1'].value) - ydata  # create Minimizer minner = lmfit.Minimizer(residual_func, params, fcn_args=(X_sort, Y_sort), nan_policy='omit')  # calculations result = minner.minimize() #print(f'\\nfirst solve with {method_1.upper()} algorithm:') lmfit.report_fit(result) #print(lmfit.fit_report(result))    # other type of output best_fit = Y_sort + result.residual #print(best_fit)  # calculate the confidence intervals for parameters ci, tr = lmfit.conf_interval(minner, result, sigmas=[3], trace=True) print('\\nreport_ci(ci):') lmfit.report_ci(ci)  # graphic (data, best-fit, and residuals) fig, axes = plt.subplots(2, 1, figsize=(297\/INCH, 210\/INCH)) fig.suptitle(f'Model({func_name})', fontsize=16)  sns.scatterplot(x=X_sort, y=Y_sort, label='data', s=50, color='red', ax=axes[0]) sns.lineplot(x=X_sort, y=best_fit, color='blue', linewidth=2, legend=True, label='best fit', ax=axes[0]) axes[0].set_ylabel('Y') #axes[0].set_xlim(X1_min_graph, X1_max_graph) #axes[0].set_ylim(Y_min_graph, Y_max_graph)  sns.scatterplot(x=X_sort, y=-result.residual, ax=axes[1], s=50) axes[1].axhline(y = 0, color = 'k', linewidth = 1) axes[1].set_xlabel('X') axes[1].set_ylabel('residuals') #axes[1].set_xlim(X1_min_graph, X1_max_graph) #axes[1].set_ylim(Y_min_graph, Y_max_graph)  plt.show()<\/code><\/pre>\n<pre><code>POWER MODEL: y = b0*x^b1 [[Fit Statistics]]     # fitting method   = leastsq     # function evals   = 29     # data points      = 55     # variables        = 2     chi-square         = 49.8796865     reduced chi-square = 0.94112616     Akaike info crit   = -1.37456420     Bayesian info crit = 2.64010217 [[Variables]]     b0:  33.4032965 +\/- 3.45275807 (10.34%) (init = 0)     b1: -0.18409814 +\/- 0.01572801 (8.54%) (init = 0) [[Correlations]] (unreported correlations are &lt; 0.100)     C(b0, b1) = -0.992  report_ci(ci):        99.73%    _BEST_    99.73%  b0:  -9.61177  33.40330 +11.99711  b1:  -0.04701  -0.18410  +0.05128<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/427\/5f1\/b10\/4275f1b10f62f3ab6cac6ce3f1064fcf.png\" width=\"706\" height=\"559\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/427\/5f1\/b10\/4275f1b10f62f3ab6cac6ce3f1064fcf.png\"\/><\/figure>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 5 &#8212; \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0441 \u0437\u0430\u0434\u0430\u043d\u0438\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (initial values)<\/h4>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u0438 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 &#8212; \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u0435\u043c \u043d\u0443\u043b\u0435\u0439 \u0438\u043b\u0438 \u0435\u0434\u0438\u043d\u0438\u0446 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 <strong>p0<\/strong> \u043d\u0435 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044e \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 I \u0442\u0438\u043f\u0430 \u0441 \u0437\u0430\u0434\u0430\u043d\u0438\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>lmfit<\/strong> \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0441 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 (<strong>best fit<\/strong>) \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0441 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 (<strong>init fit<\/strong>) \u044d\u0442\u043e \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442, \u043a\u0430\u043a \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/p>\n<pre><code class=\"python\"># EXPONENTIAL MODEL TYPE I: y = b0*exp(b1^x) func_name = 'exponential type 1' print(f'{func_name.upper()} MODEL: {formulas_dict[func_name]}')  # define objective function func = models_dict[func_name]  # initial values n = len(Y_sort) (x1, x2, y1, y2) = (X_sort[0], X_sort[n-1], Y_sort[0], Y_sort[n-1]) p0_b0 = y2 * np.exp(np.log(y2\/y1) * x2\/(x1-x2)) p0_b1 = -np.log(y2\/y1) \/ (x1-x2) p0 = [p0_b0, p0_b1] print(f'p0 = {p0}')  # create a Model model = lmfit.Model(func,                        independent_vars=['x'],                     name=func_name)  # create a set of Parameters params = lmfit.Parameters() params.add('b0', value=p0[0], min=-inf, max=inf) params.add('b1', value=p0[1], min=-inf, max=inf)  # calculations result = model.fit(Y_sort, params, x=X_sort,                    method='leastsq',                    nan_policy='raise')  # report of the fitting results (https:\/\/lmfit.github.io\/lmfit-py\/model.html#lmfit.model.ModelResult.fit_report) print(f'result.fit_report:\\n{result.fit_report(min_correl=0.2)}\\n')  # report of the confidence intervals (https:\/\/lmfit.github.io\/lmfit-py\/confidence.html#lmfit.ci_report) print(f'result.ci_report:\\n{result.ci_report()}\\n')  # evaluate the uncertainty of the model function (https:\/\/lmfit.github.io\/lmfit-py\/model.html#lmfit.model.ModelResult.eval_uncertainty) dely = result.eval_uncertainty(sigma=3)  # graphic (data, best-fit, uncertainty band and residuals) fig, axes = plt.subplots(2, 1, figsize=(297\/INCH, 210\/INCH)) fig.suptitle(f'Model({func_name})', fontsize=16)  axes[0].set_title('data, init-fit, best-fit, and uncertainty band') sns.scatterplot(x=X_sort, y=Y_sort, label='data', s=50, color='red', ax=axes[0]) sns.lineplot(x=X_sort, y=result.init_fit, color='cyan', linewidth=2, linestyle='dotted', legend=True, label='init fit', ax=axes[0]) R2 = round(result.rsquared, DecPlace) sns.lineplot(x=X_sort, y=result.best_fit, color='blue', linewidth=2, legend=True, label='best fit (' + r'$R^2 = $' + f'{R2})', ax=axes[0]) axes[0].fill_between(X_sort, result.best_fit-dely, result.best_fit+dely, color=\"grey\", alpha=0.3, label=r'3-$\\sigma$ band') axes[0].legend() axes[0].set_ylabel('Y') #axes[0].set_xlim(X1_min_graph, X1_max_graph) #axes[0].set_ylim(Y_min_graph, Y_max_graph)  sns.scatterplot(x=X_sort, y=-result.residual, ax=axes[1], s=50) axes[1].axhline(y = 0, color = 'k', linewidth = 1) axes[1].set_xlabel('X') axes[1].set_ylabel('residuals') #axes[1].set_xlim(X1_min_graph, X1_max_graph) #axes[1].set_ylim(Y_min_graph, Y_max_graph)  plt.show()<\/code><\/pre>\n<pre><code>EXPONENTIAL TYPE 1 MODEL: y = b0*exp(b1^x) p0 = [17.037879730518267, -0.00023560415890108336] result.fit_report: [[Model]]     Model(exponential type 1) [[Fit Statistics]]     # fitting method   = leastsq     # function evals   = 19     # data points      = 55     # variables        = 2     chi-square         = 75.1949111     reduced chi-square = 1.41877191     Akaike info crit   = 21.2012704     Bayesian info crit = 25.2159368     R-squared          = 0.48569589 [[Variables]]     b0:  12.6241795 +\/- 0.46994783 (3.72%) (init = 17.03788)     b1: -2.7834e-04 +\/- 3.9734e-05 (14.27%) (init = -0.0002356042) [[Correlations]] (unreported correlations are &lt; 0.200)     C(b0, b1) = -0.899  result.ci_report:        99.73%    95.45%    68.27%    _BEST_    68.27%    95.45%    99.73%  b0:  -1.48083  -0.98324  -0.49401  12.62418  +0.51299  +1.06128  +1.66495  b1:  -0.00014  -0.00009  -0.00004  -0.00028  +0.00004  +0.00009  +0.00013<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fbe\/0fd\/4ed\/fbe0fd4ed045647339db6ce74f0c86b9.png\" width=\"706\" height=\"559\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fbe\/0fd\/4ed\/fbe0fd4ed045647339db6ce74f0c86b9.png\"\/><\/figure>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 6 &#8212; \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 lmfit<\/h4>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>lmfit<\/strong>. \u041d\u0430\u0431\u043e\u0440 \u044d\u0442\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0431\u0448\u0438\u0440\u0435\u043d (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441\u043c. <a href=\"https:\/\/lmfit.github.io\/lmfit-py\/builtin_models.html\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/builtin_models.html<\/a>,<br \/> <a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_uncertainty2.html#sphx-glr-examples-documentation-model-uncertainty2-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/documentation\/model_uncertainty2.html#sphx-glr-examples-documentation-model-uncertainty2-py<\/a>), \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<ul>\n<li>\n<p>\u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f <strong>LinearModel<\/strong>;<\/p>\n<\/li>\n<li>\n<p>\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f <strong>QuadraticModel<\/strong>;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043b\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u0430\u044f <strong>PolynomialModel<\/strong> (\u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0439 m=3 &#8212; \u043a\u0443\u0431\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c);<\/p>\n<\/li>\n<li>\n<p>\u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f <strong>ExponentialModel<\/strong>;<\/p>\n<\/li>\n<li>\n<p>\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u0430\u044f <strong>PowerLawModel<\/strong>.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 <strong>lmfit<\/strong> \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u0438\u0434 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0445 \u0441\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c \u043a\u043e\u0434\u0435 (\u0442\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u043c\u0435\u044e\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f <strong>slope<\/strong> \u0438 <strong>intercept<\/strong>):<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p>\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/th>\n<th>\n<p>\u0423\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/p>\n<\/th>\n<th>\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u0438\u0445 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c \u043a\u043e\u0434\u0435<\/p>\n<\/th>\n<th>\n<p>\u0421\u0441\u044b\u043b\u043a\u0430<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">LinearModel<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"f(x;m,b)=mx+b\" alt=\"f(x;m,b)=mx+b\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/76d\/4f9\/662\/76d4f9662cb450cbf11dda9b7aca5aa9.svg\" width=\"165\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>slope<\/strong> (<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"m\" alt=\"m\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3e8\/6b7\/cdb\/3e86b7cdbca4d7b2445374033bc87790.svg\" width=\"17\" height=\"12\"\/>), <strong>intercept<\/strong> (<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"b\" alt=\"b\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/423\/29d\/c8d\/42329dc8d9a394e6dadf61f0bc41f332.svg\" width=\"8\" height=\"17\"\/>)<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/lmfit.github.io\/lmfit-py\/builtin_models.html#lmfit.models.LinearModel\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/builtin_models.html#lmfit.models.LinearModel<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">QuadraticModel<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"f(x;a,b,c)=ax^2+bx+c\" alt=\"f(x;a,b,c)=ax^2+bx+c\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a0b\/776\/69a\/a0b77669a58c64bd60092455d20cad88.svg\" width=\"220\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>a<\/strong>, <strong>b<\/strong>, <strong>c<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/lmfit.github.io\/lmfit-py\/builtin_models.html#lmfit.models.QuadraticModel\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/builtin_models.html#lmfit.models.QuadraticModel<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">PolynomialModel<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"f(x;c_0,c_1...c_7)=\\sum{c_ix^i}\" alt=\"f(x;c_0,c_1...c_7)=\\sum{c_ix^i}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6f2\/322\/fb3\/6f2322fb3beaccd3f2aa7efef1fd3901.svg\" width=\"220\" height=\"30\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>c0<\/strong>&#8230;<strong>c1<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/lmfit.github.io\/lmfit-py\/builtin_models.html#lmfit.models.PolynomialModel\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/builtin_models.html#lmfit.models.PolynomialModel<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">ExponentialModel<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"f(x;A,\\tau)=Ae^{-x\/\\tau}\" alt=\"f(x;A,\\tau)=Ae^{-x\/\\tau}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f05\/16f\/ba1\/f0516fba195835fb2cc1a779dee8d86b.svg\" width=\"162\" height=\"26\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>amplitude<\/strong> (<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"A\" alt=\"A\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2b7\/a48\/ac6\/2b7a48ac63e416f0a5380e029821f812.svg\" width=\"14\" height=\"17\"\/>), <strong>decay<\/strong> (<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\tau\" alt=\"\\tau\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/197\/f42\/b44\/197f42b448c0a3e2137ca516a8eee13f.svg\" width=\"10\" height=\"12\"\/>)<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/lmfit.github.io\/lmfit-py\/builtin_models.html#lmfit.models.ExponentialModel\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/builtin_models.html#lmfit.models.ExponentialModel<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">PowerLawModel<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"f(x;A,k)=Ax^k\" alt=\"f(x;A,k)=Ax^k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e43\/913\/4f0\/e439134f06c57a726b017dc09dff688c.svg\" width=\"139\" height=\"25\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>amplitude<\/strong> (<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"A\" alt=\"A\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a91\/f3e\/cba\/a91f3ecbaa46af493946700ce6d61d14.svg\" width=\"14\" height=\"17\"\/>), <strong>exponent<\/strong> (<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"k\" alt=\"k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5e9\/ffd\/2d8\/5e9ffd2d8fe82b5a026594cde4af6509.svg\" width=\"10\" height=\"17\"\/>)<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/lmfit.github.io\/lmfit-py\/builtin_models.html#lmfit.models.PowerLawModel\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/builtin_models.html#lmfit.models.PowerLawModel<\/a><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0414\u043b\u044f \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 <strong>ExponentialModel<\/strong> \u043c\u044b \u043e\u0446\u0435\u043d\u0438\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <strong>Model.guess<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/model.html#model-class-methods\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/model.html#model-class-methods<\/a>).<\/p>\n<pre><code class=\"python\"># list of model model_list = ['linear', 'quadratic', 'qubic', 'power', 'exponential type 1']  # model reference model_exponential_type_1 = lmfit.models.ExponentialModel(prefix='exponential_type_1_') model_dict = {         'linear':             lmfit.models.LinearModel(prefix='linear_'),         'quadratic':          lmfit.models.QuadraticModel(prefix='quadratic_'),         'qubic':              lmfit.models.PolynomialModel(degree=3, prefix='qubic_'),         'power':              lmfit.models.PowerLawModel(prefix='power_'),         'exponential type 1': model_exponential_type_1}  # create a set of Parameters params_dict = dict()  params_linear = lmfit.Parameters() params_linear.add('linear_intercept',    value = 0, min = -inf, max = inf) params_linear.add('linear_slope',        value = 0, min = -inf, max = inf) params_dict['linear'] = params_linear  params_quadratic = lmfit.Parameters() params_quadratic.add('quadratic_a',    value = 0, min = -inf, max = inf) params_quadratic.add('quadratic_b',    value = 0, min = -inf, max = inf) params_quadratic.add('quadratic_c',    value = 0, min = -inf, max = inf) params_dict['quadratic'] = params_quadratic  params_qubic = lmfit.Parameters() params_qubic.add('qubic_c0',    value = 0, min = -inf, max = inf) params_qubic.add('qubic_c1',    value = 0, min = -inf, max = inf) params_qubic.add('qubic_c2',    value = 0, min = -inf, max = inf) params_qubic.add('qubic_c3',    value = 0, min = -inf, max = inf) params_dict['qubic'] = params_qubic  params_power = lmfit.Parameters() params_power.add('power_amplitude',    value = 0, min = -inf, max = inf) params_power.add('power_exponent',     value = 0, min = -inf, max = inf) params_dict['power'] = params_power  params_exponential_type_1 = lmfit.Parameters() #params_exponential_type_1.add('exponential_type_1_amplitude',    value = 0, min = -inf, max = inf) #params_exponential_type_1.add('exponential_type_1_decay',        value = 0, min = -inf, max = inf) pars_exponential_type_1 = model_exponential_type_1.guess(Y_sort, x=X_sort) params_dict['exponential type 1'] = pars_exponential_type_1  # calculations result_dict = dict() for func_name in model_list:     model = model_dict[func_name]     result = model.fit(Y_sort, params_dict[func_name], x=X_sort)     print(f'{func_name.upper()} MODEL:\\n{result.fit_report(min_correl=0.2)}\\n')     result_dict[func_name] = result  # graphic 1 (various models) fig, axes = plt.subplots(figsize=(420\/INCH, 297\/INCH)) #fig.suptitle(f'Model(various models)', fontsize=16) axes.set_title('Model(various models)', fontsize=16) sns.scatterplot(x=X_sort, y=Y_sort, label='data', s=50, color='red', ax=axes) for func_name in model_list:         result = result_dict[func_name]         R2 = round(result.rsquared, DecPlace)         label = func_name + ' (' + r'$R^2 = $' + f'{R2})'         sns.lineplot(x=X_sort, y=result.best_fit, linewidth=2, color=color_dict[func_name], legend=True, label=label, ax=axes)    # the color_dict was defined earlier plt.show()  # graphic 2 (various models) number_models = len(model_list) fig, axes = plt.subplots(2, number_models, figsize=(210\/INCH*number_models, 297\/INCH)) fig.suptitle('Model(various models)', fontsize=20) for i, func_name in enumerate(model_list):         ax1 = plt.subplot(2, number_models, i+1)         ax2 = plt.subplot(2, number_models, i+1+number_models)         ax1.set_title(f'Model({func_name})', fontsize=16)         result = result_dict[func_name]         dely = result.eval_uncertainty(sigma=3)         sns.scatterplot(x=X_sort, y=Y_sort, label='data', s=50, color='red', ax=ax1)         R2 = round(result.rsquared, DecPlace)         label = func_name + ' (' + r'$R^2 = $' + f'{R2})'         sns.lineplot(x=X_sort, y=result.best_fit, linewidth=2, color=color_dict[func_name], legend=True, label=label, ax=ax1)    # the color_dict was defined earlier         ax1.fill_between(X_sort, result.best_fit-dely, result.best_fit+dely, color=\"grey\", alpha=0.3, label=r'3-$\\sigma$ band')         ax1.legend()         ax1.set_ylabel('Y')         sns.scatterplot(x=X_sort, y=-result.residual, ax=ax2, s=50)         ax2.axhline(y = 0, color = 'k', linewidth = 1)         ax2.set_xlabel('X')         ax2.set_ylabel('residuals') plt.show()<\/code><\/pre>\n<pre><code>LINEAR MODEL: [[Model]]     Model(linear, prefix='linear_') [[Fit Statistics]]     # fitting method   = leastsq     # function evals   = 7     # data points      = 55     # variables        = 2     chi-square         = 84.4203915     reduced chi-square = 1.59283758     Akaike info crit   = 27.5661686     Bayesian info crit = 31.5808350     R-squared          = 0.42259718 [[Variables]]     linear_intercept:  11.8501350 +\/- 0.37396000 (3.16%) (init = 0)     linear_slope:     -0.00217603 +\/- 3.4938e-04 (16.06%) (init = 0) [[Correlations]] (unreported correlations are &lt; 0.200)     C(linear_intercept, linear_slope) = -0.890  QUADRATIC MODEL: [[Model]]     Model(parabolic, prefix='quadratic_') [[Fit Statistics]]     # fitting method   = leastsq     # function evals   = 13     # data points      = 55     # variables        = 3     chi-square         = 53.2610253     reduced chi-square = 1.02425049     Akaike info crit   = 4.23294056     Bayesian info crit = 10.2549401     R-squared          = 0.63571519 [[Variables]]     quadratic_a:  1.8760e-06 +\/- 3.4013e-07 (18.13%) (init = 0)     quadratic_b: -0.00704710 +\/- 9.2652e-04 (13.15%) (init = 0)     quadratic_c:  14.3434596 +\/- 0.54247230 (3.78%) (init = 0) [[Correlations]] (unreported correlations are &lt; 0.200)     C(quadratic_a, quadratic_b) = -0.953     C(quadratic_b, quadratic_c) = -0.943     C(quadratic_a, quadratic_c) = 0.833  QUBIC MODEL: [[Model]]     Model(polynomial, prefix='qubic_') [[Fit Statistics]]     # fitting method   = leastsq     # function evals   = 16     # data points      = 55     # variables        = 4     chi-square         = 52.4138335     reduced chi-square = 1.02772223     Akaike info crit   = 5.35105531     Bayesian info crit = 13.3803880     R-squared          = 0.64150965 [[Variables]]     qubic_c0:  14.8384962 +\/- 0.76977661 (5.19%) (init = 0)     qubic_c1: -0.00880398 +\/- 0.00214609 (24.38%) (init = 0)     qubic_c2:  3.5207e-06 +\/- 1.8432e-06 (52.35%) (init = 0)     qubic_c3: -4.1264e-10 +\/- 4.5449e-10 (110.14%) (init = 0) [[Correlations]] (unreported correlations are &lt; 0.200)     C(qubic_c2, qubic_c3) = -0.983     C(qubic_c1, qubic_c2) = -0.962     C(qubic_c0, qubic_c1) = -0.927     C(qubic_c1, qubic_c3) = 0.902     C(qubic_c0, qubic_c2) = 0.805     C(qubic_c0, qubic_c3) = -0.708  POWER MODEL: [[Model]]     Model(powerlaw, prefix='power_') [[Fit Statistics]]     # fitting method   = leastsq     # function evals   = 29     # data points      = 55     # variables        = 2     chi-square         = 49.8796865     reduced chi-square = 0.94112616     Akaike info crit   = -1.37456420     Bayesian info crit = 2.64010217     R-squared          = 0.65884224 [[Variables]]     power_amplitude:  33.4032965 +\/- 3.45275807 (10.34%) (init = 0)     power_exponent:  -0.18409814 +\/- 0.01572801 (8.54%) (init = 0) [[Correlations]] (unreported correlations are &lt; 0.200)     C(power_amplitude, power_exponent) = -0.992  EXPONENTIAL TYPE 1 MODEL: [[Model]]     Model(exponential, prefix='exponential_type_1_') [[Fit Statistics]]     # fitting method   = leastsq     # function evals   = 16     # data points      = 55     # variables        = 2     chi-square         = 75.1949111     reduced chi-square = 1.41877191     Akaike info crit   = 21.2012705     Bayesian info crit = 25.2159368     R-squared          = 0.48569589 [[Variables]]     exponential_type_1_amplitude:  12.6242247 +\/- 0.46996177 (3.72%) (init = 11.84731)     exponential_type_1_decay:      3592.61300 +\/- 512.762035 (14.27%) (init = 4650.427) [[Correlations]] (unreported correlations are &lt; 0.200)     C(exponential_type_1_amplitude, exponential_type_1_decay) = -0.899<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f23\/058\/d5e\/f23058d5ee5723a39ca3ad9543afc41b.png\" width=\"958\" height=\"686\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f23\/058\/d5e\/f23058d5ee5723a39ca3ad9543afc41b.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/99e\/c7f\/092\/99ec7f09245296ecb026e891f8dce35c.png\" width=\"2361\" height=\"770\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/99e\/c7f\/092\/99ec7f09245296ecb026e891f8dce35c.png\"\/><\/figure>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 7 &#8212; \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430<\/h4>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 <strong>\u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 I \u0442\u0438\u043f\u0430<\/strong><\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=\\frac{b_0}{1+b_1\\cdot e^{-b_2\\cdot X}}\" alt=\"Y=\\frac{b_0}{1+b_1\\cdot e^{-b_2\\cdot X}}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b4e\/39f\/25e\/b4e39f25e54d190b72902438e7b4254e.svg\" width=\"160\" height=\"47\"\/>. <\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u043c\u0438 \u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 &#8212; \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u0430\u0440\u044c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0434\u043b\u044f \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u044f (\u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0442\u0440\u0435\u0445 \u0442\u043e\u0447\u0435\u043a \u0438 \u0442.\u0434.). \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u043c\u043e\u0433\u0443\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f <strong>\u043c\u0435\u0442\u043e\u0434\u044b \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430<\/strong>.<\/p>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0437\u043e\u0440\u0430 \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u0434\u0430\u043d\u043d\u0443\u044e \u0442\u0435\u043c\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 <strong>lmfit<\/strong> &#8212; \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044e \u0432 \u0434\u0432\u0430 \u044d\u0442\u0430\u043f\u0430:<\/p>\n<ol>\n<li>\n<p>\u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u043e\u0446\u0435\u043d\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c <strong>basinhopping<\/strong> (\u0441\u043c. <a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.basinhopping.html\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.basinhopping.html<\/a>, <a href=\"https:\/\/machinelearningmastery.com\/basin-hopping-optimization-in-python\/\" rel=\"noopener noreferrer nofollow\">https:\/\/machinelearningmastery.com\/basin-hopping-optimization-in-python\/<\/a>).<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043e\u0446\u0435\u043d\u043a\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e \u0441\u0435\u0442\u043a\u0435 <strong>brute<\/strong> (\u0441\u043c. <a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_brute.html\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_brute.html<\/a>).<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">logistic_type_1_func = lambda x, b0, b1, b2: b0 \/ (1 + b1*np.exp(-b2*x))  # LOGISTIC MODEL TYPE I: y = b0 \/ (1 + b1*np.exp(-b2*x)) print('LOGISTIC MODEL TYPE I: y = b0 \/ (1 + b1*np.exp(-b2*x))')  # define objective function func = logistic_type_1_func func_name = 'logistic type 1'  # initial values p0 = [0, 0, 0]  # create a set of Parameters params = lmfit.Parameters() params.add('b0', value=p0[0], min=-inf, max=inf, brute_step=0.01) params.add('b1', value=p0[1], min=-inf, max=inf, brute_step=0.01) params.add('b2', value=p0[2], min=-inf, max=inf, brute_step=0.001)  # function for calculating residuals residual_func = lambda params, x, ydata: func(x, params['b0'].value,                                                  params['b1'].value,                                                  params['b2'].value                                                  ) - ydata  # create Minimizer minner = lmfit.Minimizer(residual_func, params, fcn_args=(X_sort, Y_sort), nan_policy='omit')  # first solve with basinhopping algorithm method_1 = 'basinhopping' result_1 = minner.minimize(method=method_1) print(f'\\nfirst solve with {method_1.upper()} algorithm:') lmfit.report_fit(result_1) #print(lmfit.fit_report(result_1)) best_fit_1 = Y_sort + result_1.residual #print(best_fit_1)  # then solve with brute algorithm using the basinhopping solution as a starting point method_2 = 'brute' result_2 = minner.minimize(method=method_2,                            params=result_1.params,                            Ns=30,                            keep=30) print(f'\\nsecond solve with {method_2.upper()} algorithm using the {method_1.upper()} solution as a starting point:') #lmfit.report_fit(result_2) print(lmfit.fit_report(result_2)) best_fit_2 = Y_sort + result_2.residual #print(best_fit_2)  # calculate the confidence intervals for parameters ci, tr = lmfit.conf_interval(minner, result_2, sigmas=[3], trace=True) lmfit.report_ci(ci) #print(tr)  # graphics fig, axes = plt.subplots(2, 1, figsize=(297\/INCH, 210\/INCH)) fig.suptitle(f'Model({func_name})', fontsize=14)  axes[0].set_title('data, first fit and second fit') sns.scatterplot(x=X_sort, y=Y_sort, label='data', s=50, color='red', ax=axes[0]) sns.lineplot(x=X_sort, y=best_fit_1, color='cyan', linewidth=6, legend=True, label=f'first fit ({method_1})', ax=axes[0]) sns.lineplot(x=X_sort, y=best_fit_2, color='blue', linewidth=2, legend=True, label=f'second fit ({method_2})', ax=axes[0]) axes[0].set_ylabel('Y')  sns.scatterplot(x=X_sort, y=-result_2.residual, ax=axes[1], s=50) axes[1].axhline(y = 0, color = 'k', linewidth = 1) axes[1].set_ylabel('residuals')  plt.show()<\/code><\/pre>\n<pre><code>irst solve with BASINHOPPING algorithm: [[Fit Statistics]]     # fitting method   = basinhopping     # function evals   = 17238     # data points      = 55     # variables        = 3     chi-square         = 51.0205702     reduced chi-square = 0.98116481     Akaike info crit   = 1.86926364     Bayesian info crit = 7.89126320 [[Variables]]     b0:  7.71901123 +\/- 0.45562749 (5.90%) (init = 0)     b1: -0.53569038 +\/- 0.03472051 (6.48%) (init = 0)     b2:  0.00118052 +\/- 2.6156e-04 (22.16%) (init = 0) [[Correlations]] (unreported correlations are &lt; 0.100)     C(b0, b2) = 0.912     C(b0, b1) = 0.550     C(b1, b2) = 0.242  second solve with BRUTE algorithm using the BASINHOPPING solution as a starting point: [[Fit Statistics]]     # fitting method   = brute     # function evals   = 28830     # data points      = 55     # variables        = 3     chi-square         = 51.0205702     reduced chi-square = 0.98116481     Akaike info crit   = 1.86926364     Bayesian info crit = 7.89126320 ##  Warning: uncertainties could not be estimated: [[Variables]]     b0:  7.71901123 +\/- 0.45562749 (5.90%) (init = 0)     b1: -0.53569038 +\/- 0.03472051 (6.48%) (init = 0)     b2:  0.00118052 +\/- 2.6156e-04 (22.16%) (init = 0) [[Correlations]] (unreported correlations are &lt; 0.100)     C(b0, b2) = 0.912     C(b0, b1) = 0.550     C(b1, b2) = 0.242        99.73%    _BEST_    99.73%  b0:  -3.89422   7.71901  +1.37162  b1:  -0.20046  -0.53569  +0.12587  b2:  -0.00096   0.00118  +0.00149<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/330\/b16\/6c5\/330b166c5d593ade5d5ce30c4fb6243f.png\" width=\"706\" height=\"541\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/330\/b16\/6c5\/330b166c5d593ade5d5ce30c4fb6243f.png\"\/><\/figure>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 8 &#8212; \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432 (outlier detection) \u043f\u0440\u0438 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438<\/h4>\n<p>\u0412\u043b\u0438\u044f\u043d\u0438\u0435 \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0435\u0441\u044c\u043c\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0438 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0435\u043b\u044c\u0437\u044f. \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441, \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u0438\u0435\u043c \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432 <strong>\u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/strong> (\u0441\u043c. <a href=\"https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_detect_outliers.html#sphx-glr-examples-example-detect-outliers-py\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/examples\/example_detect_outliers.html#sphx-glr-examples-example-detect-outliers-py<\/a>). \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442 \u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c: \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0442\u043e\u0447\u043a\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"(x_i, y_i)\" alt=\"(x_i, y_i)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/335\/885\/1ff\/3358851ff01137b814ee8ca8cf31ee5b.svg\" width=\"57\" height=\"22\"\/> \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u0432\u043b\u0438\u044f\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u043e\u0447\u043a\u0438 \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u0445\u043e\u0434\u0430 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 (FuelFlow) \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0439 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b (Temperature) \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430:<\/p>\n<pre><code class=\"python\">graph_scatterplot_sns(     X2, Y,     Xmin=X2_min_graph, Xmax=X2_max_graph,     Ymin=Y_min_graph, Ymax=Y_max_graph,     color='orange',     title_figure=Title_String, title_figure_fontsize=14,     title_axes='Dependence of FuelFlow (Y) on temperature (X2)', title_axes_fontsize=16,     x_label=Variable_Name_X2,     y_label=Variable_Name_Y,     label_fontsize=14, tick_fontsize=12,     label_legend='', label_legend_fontsize=12,     s=80)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d6f\/105\/446\/d6f10544691c053a6a52cc4b766aa8e4.png\" width=\"713\" height=\"559\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d6f\/105\/446\/d6f10544691c053a6a52cc4b766aa8e4.png\"\/><\/figure>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"python\"># Preparation of input data dataset_sort_df = dataset_df.loc[:, ['X2', 'Y']].sort_values(by=['X2']) display(dataset_sort_df.describe())  Y_sort = np.array(dataset_sort_df['Y']) X_sort = np.array(dataset_sort_df['X2'])<\/code><\/pre>\n<p>\u041f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u043b\u0438\u043d\u0435\u0439\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c:<\/p>\n<pre><code class=\"python\"># LINEAR MODEL func_name = 'linear' print(f'{func_name.upper()} MODEL: {formulas_dict[func_name]}')  func = models_dict[func_name] p0 = p0_dict[func_name]  model = lmfit.Model(func,                        independent_vars=['x'],                     name=func_name)  params = lmfit.Parameters() params.add('b0', value=p0[0], min=-inf, max=inf) params.add('b1', value=p0[1], min=-inf, max=inf)  result = model.fit(Y_sort, params, x=X_sort,                    method='leastsq',                    nan_policy='raise')  print(f'result.fit_report:\\n{result.fit_report(min_correl=0.2)}\\n') dely = result.eval_uncertainty(sigma=3)  # graphic (data, best-fit, uncertainty band and residuals) fig, axes = plt.subplots(2, 1, figsize=(297\/INCH, 210\/INCH)) fig.suptitle(f'Model({func_name})', fontsize=16)  axes[0].set_title('data, init-fit, best-fit, and uncertainty band') sns.scatterplot(x=X_sort, y=Y_sort, label='data', s=50, color='red', ax=axes[0]) R2 = round(result.rsquared, DecPlace) sns.lineplot(x=X_sort, y=result.best_fit, color='blue', linewidth=2, legend=True, label='best fit (' + r'$R^2 = $' + f'{R2})', ax=axes[0]) axes[0].fill_between(X_sort, result.best_fit-dely, result.best_fit+dely, color=\"grey\", alpha=0.3, label=r'3-$\\sigma$ band') axes[0].legend() axes[0].set_ylabel('Y') #axes[0].set_xlim(X1_min_graph, X1_max_graph) axes[0].set_ylim(Y_min_graph, Y_max_graph)  sns.scatterplot(x=X_sort, y=-result.residual, ax=axes[1], s=50) axes[1].axhline(y = 0, color = 'k', linewidth = 1) axes[1].set_xlabel('X') axes[1].set_ylabel('residuals') #axes[1].set_xlim(X1_min_graph, X1_max_graph) #axes[1].set_ylim(Y_min_graph, Y_max_graph)  plt.show()<\/code><\/pre>\n<pre><code>LINEAR MODEL: y = b0 + b1*x result.fit_report: [[Model]]     Model(linear) [[Fit Statistics]]     # fitting method   = leastsq     # function evals   = 7     # data points      = 55     # variables        = 2     chi-square         = 126.256130     reduced chi-square = 2.38219113     Akaike info crit   = 49.7038688     Bayesian info crit = 53.7185352     R-squared          = 0.13645691 [[Variables]]     b0:  10.1218956 +\/- 0.23996519 (2.37%) (init = 0)     b1: -0.06161458 +\/- 0.02129069 (34.55%) (init = 0) [[Correlations]] (unreported correlations are &lt; 0.200)     C(b0, b1) = -0.498 <\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/921\/645\/355\/92164535598f68c9ef6ae48009fc7671.png\" width=\"706\" height=\"559\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/921\/645\/355\/92164535598f68c9ef6ae48009fc7671.png\"\/><\/figure>\n<p>\u0413\u0440\u0430\u0444\u0438\u043a \u0432\u043b\u0438\u044f\u043d\u0438\u044f \u043d\u0430 \u043c\u0435\u0442\u0440\u0438\u043a\u0443 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 &#8212; <strong>reduced chi-square<\/strong><\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"{\\chi}_y^2 = \\frac{\\chi^2}{N-N_{varys}}\" alt=\"{\\chi}_y^2 = \\frac{\\chi^2}{N-N_{varys}}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/89c\/367\/9a1\/89c3679a102981aa0696e6914a86c6d1.svg\" width=\"145\" height=\"51\"\/>:<\/p>\n<pre><code class=\"python\">from collections import defaultdict  best_vals = defaultdict(lambda: np.zeros(X_sort.size)) stderrs = defaultdict(lambda: np.zeros(X_sort.size)) chi_sq = np.zeros_like(X_sort)  for i in range(X_sort.size):     idx2 = np.arange(0, X_sort.size)     idx2 = np.delete(idx2, i)     tmp_x = X_sort[idx2]     tmp = model.fit(Y_sort[idx2], x=tmp_x, b0=result.params['b0'], b1=result.params['b1'])          chi_sq[i] = tmp.chisqr     for p in tmp.params:         tpar = tmp.params[p]         best_vals[p][i] = tpar.value         stderrs[p][i] = (tpar.stderr \/ result.params[p].stderr)  fig, ax = plt.subplots(figsize=(297\/INCH, 210\/INCH)) ax.plot(X_sort, (result.chisqr - chi_sq) \/ chi_sq) ax.set_ylabel(r'Relative red. $\\chi^2$ change') ax.set_xlabel('X') ax.legend() plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/82b\/07b\/9c9\/82b07b9c96739dd2e7444e67d6c2e28e.png\" width=\"717\" height=\"500\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/82b\/07b\/9c9\/82b07b9c96739dd2e7444e67d6c2e28e.png\"\/><\/figure>\n<p>\u0413\u0440\u0430\u0444\u0438\u043a \u0432\u043b\u0438\u044f\u043d\u0438\u044f \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"b_0\" alt=\"b_0\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3c9\/185\/639\/3c918563994516805690e96a4071cd86.svg\" width=\"17\" height=\"20\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"b_1\" alt=\"b_1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/671\/0e4\/fe7\/6710e4fe7c84ac82d7396bf3af411a5b.svg\" width=\"17\" height=\"19\"\/> \u0438 \u0438\u0445 \u043e\u0448\u0438\u0431\u043a\u0438:<\/p>\n<pre><code class=\"python\">fig, axs = plt.subplots(4, figsize=(297\/INCH, 210\/INCH*3), sharex='col') axs[0].plot(X_sort, best_vals['b0']) axs[0].set_ylabel('best b0')  axs[1].plot(X_sort, best_vals['b1']) axs[1].set_ylabel('best b1')  axs[2].plot(X_sort, stderrs['b0']) axs[2].set_ylabel('err b0 change')  axs[3].plot(X_sort, stderrs['b1']) axs[3].set_ylabel('err b1 change')  axs[3].set_xlabel('X') plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dca\/c11\/6ba\/dcac116bac1282dffd0655ab6fd21de2.png\" width=\"737\" height=\"1398\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dca\/c11\/6ba\/dcac116bac1282dffd0655ab6fd21de2.png\"\/><\/figure>\n<p>\u0412\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0432\u044b\u0431\u0440\u043e\u0441 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"y\" alt=\"y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5ab\/8c2\/e26\/5ab8c2e2668526ab42e92513d7db06fe.svg\" width=\"10\" height=\"15\"\/> \u0432 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"x\\in(10; 15)\" alt=\"x\\in(10; 15)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f50\/7db\/391\/f507db391b5ff5b0cd77ac708ad12af8.svg\" width=\"97\" height=\"22\"\/> \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u0430\u043c\u0435\u0442\u0435\u043d \u043d\u0430 \u0432\u0441\u0435\u0445 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445.<br \/> \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u043c \u0432\u044b\u0431\u0440\u043e\u0441 \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u043b\u0438\u043d\u0435\u0439\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e \u043e\u0447\u0438\u0449\u0435\u043d\u043d\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u043c:<\/p>\n<pre><code class=\"python\">mask = dataset_sort_df['Y'] &lt; 15 dataset_sort_df_clear = dataset_sort_df[mask] display(dataset_sort_df_clear.describe())  X_sort_clear = np.array(dataset_sort_df_clear['X2']) Y_sort_clear = np.array(dataset_sort_df_clear['Y'])<\/code><\/pre>\n<pre><code class=\"python\"># LINEAR MODEL func_name = 'linear' print(f'{func_name.upper()} MODEL: {formulas_dict[func_name]}')  func = models_dict[func_name] p0 = p0_dict[func_name]  model = lmfit.Model(func,                        independent_vars=['x'],                     name=func_name)  params = lmfit.Parameters() params.add('b0', value=p0[0], min=-inf, max=inf) params.add('b1', value=p0[1], min=-inf, max=inf)  result = model.fit(Y_sort_clear, params, x=X_sort_clear,                    method='leastsq',                    nan_policy='raise')  print(f'result.fit_report:\\n{result.fit_report(min_correl=0.2)}\\n') dely = result.eval_uncertainty(sigma=3)  # graphic (data, best-fit, uncertainty band and residuals) fig, axes = plt.subplots(2, 1, figsize=(297\/INCH, 210\/INCH)) fig.suptitle(f'Model({func_name})', fontsize=16)  axes[0].set_title('data, init-fit, best-fit, and uncertainty band') sns.scatterplot(x=X_sort_clear, y=Y_sort_clear, label='data', s=50, color='red', ax=axes[0]) R2 = round(result.rsquared, DecPlace) sns.lineplot(x=X_sort_clear, y=result.best_fit, color='blue', linewidth=2, legend=True, label='best fit (' + r'$R^2 = $' + f'{R2})', ax=axes[0]) axes[0].fill_between(X_sort_clear, result.best_fit-dely, result.best_fit+dely, color=\"grey\", alpha=0.3, label=r'3-$\\sigma$ band') axes[0].legend() axes[0].set_ylabel('Y') #axes[0].set_xlim(X1_min_graph, X1_max_graph) axes[0].set_ylim(Y_min_graph, Y_max_graph)  sns.scatterplot(x=X_sort_clear, y=-result.residual, ax=axes[1], s=50) axes[1].axhline(y = 0, color = 'k', linewidth = 1) axes[1].set_xlabel('X') axes[1].set_ylabel('residuals') #axes[1].set_xlim(X1_min_graph, X1_max_graph) #axes[1].set_ylim(Y_min_graph, Y_max_graph)  plt.show()<\/code><\/pre>\n<pre><code>LINEAR MODEL: y = b0 + b1*x result.fit_report: [[Model]]     Model(linear) [[Fit Statistics]]     # fitting method   = leastsq     # function evals   = 7     # data points      = 54     # variables        = 2     chi-square         = 67.8407274     reduced chi-square = 1.30462937     Akaike info crit   = 16.3216480     Bayesian info crit = 20.2996161     R-squared          = 0.28334888 [[Variables]]     b0:  10.0379989 +\/- 0.17802593 (1.77%) (init = 0)     b1: -0.07177285 +\/- 0.01582893 (22.05%) (init = 0) [[Correlations]] (unreported correlations are &lt; 0.200)     C(b0, b1) = -0.488<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ac1\/6da\/2d8\/ac16da2d81d6e6323141bc69bf265d3c.png\" width=\"706\" height=\"559\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ac1\/6da\/2d8\/ac16da2d81d6e6323141bc69bf265d3c.png\"\/><\/figure>\n<p>\u0412\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u044b\u0431\u0440\u043e\u0441\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0441 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"R^2 = 0.1365\" alt=\"R^2 = 0.1365\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/051\/ea2\/06d\/051ea206d2deca7fc601eb2d46885dd4.svg\" width=\"103\" height=\"21\"\/> \u0434\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"R^2 = 0.2833\" alt=\"R^2 = 0.2833\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/edc\/c01\/1bb\/edcc011bb4f192755ff31de9e30f61ef.svg\" width=\"103\" height=\"21\"\/>.<\/p>\n<h4> \u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438<\/h4>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <strong>lmfit<\/strong> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0432 <strong>python<\/strong>, \u043d\u043e \u0438 \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f &#8212; \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u0432 \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u0438. \u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <strong>scipy.optimize.curve_fit<\/strong>.<\/p>\n<p>\u041f\u0440\u043e \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 &#8212; \u0441\u043c., \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/mmas.github.io\/least-squares-fitting-numpy-scipy\" rel=\"noopener noreferrer nofollow\">https:\/\/mmas.github.io\/least-squares-fitting-numpy-scipy<\/a>.<\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u043f\u0440\u0430\u0432\u0435 \u0441\u0430\u043c \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u0445 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<h2>\u0421\u041e\u0417\u0414\u0410\u041d\u0418\u0415 \u041f\u041e\u041b\u042c\u0417\u041e\u0412\u0410\u0422\u0415\u041b\u042c\u0421\u041a\u041e\u0419 \u0424\u0423\u041d\u041a\u0426\u0418\u0418 \u0414\u041b\u042f \u0410\u041f\u041f\u0420\u041e\u041a\u0421\u0418\u041c\u0410\u0426\u0418\u0418 \u0417\u0410\u0412\u0418\u0421\u0418\u041c\u041e\u0421\u0422\u0415\u0419<\/h2>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>simple_approximation<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (\u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 MS Excel), \u0430 \u0438\u043c\u0435\u043d\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 (\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439, \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439, \u043a\u0443\u0431\u0438\u0447\u0435\u0441\u043a\u043e\u0439, \u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e\u0439, \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439, \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439, \u0433\u0438\u043f\u0435\u0440\u0431\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0439);<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 (<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"R^2\" alt=\"R^2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d7f\/afc\/b47\/d7fafcb479dba282fec744e2af1fea90.svg\" width=\"23\" height=\"21\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"MSPE\" alt=\"MSPE\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/304\/268\/72d\/30426872df7e1f7b247608c30d4d1b5a.svg\" width=\"62\" height=\"17\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"MAPE\" alt=\"MAPE\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/906\/bf0\/173\/906bf0173e575f68bd8ac98df657088e.svg\" width=\"64\" height=\"17\"\/>);<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u043c\u0435\u0442\u0440\u0438\u043a \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0432 \u0432\u0438\u0434\u0435 DataFrame;<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y\" alt=\"Y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/011\/c75\/480\/011c754809af5b03b112bd3d50637544.svg\" width=\"15\" height=\"16\"\/>, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043c\u043e\u0434\u0435\u043b\u044f\u043c, \u0432 \u0432\u0438\u0434\u0435 DataFrame.<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0443\u044e \u043f\u043e\u043b\u043d\u043e\u0442\u0443, \u043e\u043d\u0430 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0438\u0448\u044c \u0434\u043b\u044f \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0439. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438\/\u0438\u043b\u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043b\u044e\u0431\u043e\u0439 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u0432 \u0432\u044b\u0448\u0435.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong>simple_approximation<\/strong> \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<ul>\n<li>\n<p><strong>X_in<\/strong>, <strong>Y_in<\/strong> &#8212; \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"X\" alt=\"X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0e4\/4db\/e57\/0e44dbe57f14b73a82875fcf63ef722d.svg\" width=\"16\" height=\"17\"\/> \u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y\" alt=\"Y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b52\/c65\/4a9\/b52c654a9e8f7338d69d80f2fe272044.svg\" width=\"15\" height=\"16\"\/>;<\/p>\n<\/li>\n<li>\n<p><strong>models_list_in<\/strong> &#8212; \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0447\u0435\u043d\u044c <strong>models_list = [&#8216;linear&#8217;, &#8216;quadratic&#8217;, &#8216;qubic&#8217;, &#8216;power&#8217;, &#8216;exponential&#8217;, &#8216;logarithmic&#8217;, &#8216;hyperbolic&#8217;]<\/strong>);<\/p>\n<\/li>\n<li>\n<p><strong>p0_dict_in=None<\/strong> &#8212; \u0441\u043b\u043e\u0432\u0430\u0440\u044c (dict) \u0441 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0440\u0430\u0432\u043d\u044b 1);<\/p>\n<\/li>\n<li>\n<p><strong>Xmin<\/strong>, <strong>Xmax<\/strong>, <strong>Ymin<\/strong>, <strong>Ymax<\/strong> &#8212; \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p><strong>nx_in=100<\/strong> &#8212; \u0447\u0438\u0441\u043b\u043e \u0442\u043e\u0447\u0435\u043a, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"X\" alt=\"X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fa9\/422\/78b\/fa942278b3f63bc931838fbb294569ba.svg\" width=\"16\" height=\"17\"\/> \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p><strong>DecPlace=4<\/strong> &#8212; \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c (\u0447\u0438\u0441\u043b\u043e \u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439) \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u043c\u0435\u0442\u0440\u0438\u043a \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u043e\u0434\u0435\u043b\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p><strong>result_table=False<\/strong>, <strong>value_table_calc=False<\/strong>, <strong>value_table_graph=False<\/strong> &#8212; \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u043b\u0438 \u043d\u0435\u0442 (True\/False) DataFrame \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430, \u0441 \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y\" alt=\"Y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/375\/599\/07f\/37559907f848c5e76d2f928a8c405805.svg\" width=\"15\" height=\"16\"\/>, \u0441 \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y\" alt=\"Y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/435\/733\/52a\/43573352a853bb357a83d3c65eb2c3d4.svg\" width=\"15\" height=\"16\"\/> \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p><strong>title_figure=None<\/strong>, <strong>title_figure_fontsize=16<\/strong>, <strong>title_axes=None<\/strong>, <strong>title_axes_fontsize=18<\/strong> &#8212; \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0438 \u0448\u0440\u0438\u0444\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p><strong>x_label=None<\/strong>, <strong>y_label=None<\/strong> &#8212; \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0441\u0435\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p><strong>linewidth=2<\/strong> &#8212; \u0442\u043e\u043b\u0449\u0438\u043d\u0430 \u043b\u0438\u043d\u0438\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p><strong>label_fontsize=14<\/strong>, <strong>tick_fontsize=12<\/strong>, <strong>label_legend_fontsize=12<\/strong> &#8212; \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0438 \u0448\u0440\u0438\u0444\u0442 \u043b\u0435\u0433\u0435\u043d\u0434\u044b;<\/p>\n<\/li>\n<li>\n<p><strong>color_list_in=None<\/strong> &#8212; \u0441\u043b\u043e\u0432\u0430\u0440\u044c (dict), \u0437\u0430\u0434\u0430\u044e\u0449\u0438\u0439 \u0446\u0432\u0435\u0442\u0430 \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438);<\/p>\n<\/li>\n<li>\n<p><strong>b0_formatter=None<\/strong>, <strong>b1_formatter=None<\/strong>, <strong>b2_formatter=None<\/strong>, <strong>b3_formatter=None<\/strong> &#8212; \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438);<\/p>\n<\/li>\n<li>\n<p><strong>graph_size=(420\/INCH, 297\/INCH)<\/strong> &#8212; \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043a\u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p><strong>file_name=None<\/strong> &#8212; \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong>simple_approximation<\/strong> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442:<\/p>\n<ul>\n<li>\n<p><strong>result_df<\/strong> &#8212; DataFrame \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430;<\/p>\n<\/li>\n<li>\n<p><strong>value_table_calc<\/strong> \u0438 <strong>value_table_graph<\/strong> &#8212; DataFrame \u0441 \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y\" alt=\"Y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ac2\/c48\/615\/ac2c48615d1b7c4a0281c922af48ee57.svg\" width=\"15\" height=\"16\"\/>, \u0441 \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y\" alt=\"Y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/044\/9c9\/f52\/0449c9f52dbed3d6488d04d179b6bef3.svg\" width=\"15\" height=\"16\"\/> \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0433\u0440\u0430\u0444\u0438\u043a \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">def simple_approximation(     X_in, Y_in,     models_list_in,     p0_dict_in=None,     Xmin=None, Xmax=None,     Ymin=None, Ymax=None,     nx_in=100,     DecPlace=4,     result_table=False, value_table_calc=False, value_table_graph=False,     title_figure=None, title_figure_fontsize=16,     title_axes=None, title_axes_fontsize=18,     x_label=None, y_label=None,     linewidth=2,     label_fontsize=14, tick_fontsize=12, label_legend_fontsize=12,     color_list_in=None,     b0_formatter=None, b1_formatter=None, b2_formatter=None, b3_formatter=None,     graph_size=(420\/INCH, 297\/INCH),     file_name=None):          # Equations     linear_func = lambda x, b0, b1: b0 + b1*x     quadratic_func = lambda x, b0, b1, b2: b0 + b1*x + b2*x**2     qubic_func = lambda x, b0, b1, b2, b3: b0 + b1*x + b2*x**2 + b3*x**3     power_func = lambda x, b0, b1: b0 * x**b1     exponential_func = lambda x, b0, b1: b0 * np.exp(b1*x)     logarithmic_func = lambda x, b0, b1: b0 + b1*np.log(x)     hyperbolic_func = lambda x, b0, b1: b0 + b1\/x          # Model reference     p0_dict = {         'linear':      [1, 1],         'quadratic':   [1, 1, 1],         'qubic':       [1, 1, 1, 1],         'power':       [1, 1],         'exponential': [1, 1],         'logarithmic': [1, 1],         'hyperbolic':  [1, 1]}          models_dict = {         'linear':      [linear_func,      p0_dict['linear']],         'quadratic':   [quadratic_func,   p0_dict['quadratic']],         'qubic':       [qubic_func,       p0_dict['qubic']],         'power':       [power_func,       p0_dict['power']],         'exponential': [exponential_func, p0_dict['exponential']],         'logarithmic': [logarithmic_func, p0_dict['logarithmic']],         'hyperbolic':  [hyperbolic_func,  p0_dict['hyperbolic']]}          models_df = pd.DataFrame({         'func': (             linear_func,             quadratic_func,             qubic_func,             power_func,             exponential_func,             logarithmic_func,             hyperbolic_func),         'p0': (             p0_dict['linear'],             p0_dict['quadratic'],             p0_dict['qubic'],             p0_dict['power'],             p0_dict['exponential'],             p0_dict['logarithmic'],             p0_dict['hyperbolic'])},         index=['linear', 'quadratic', 'qubic', 'power', 'exponential', 'logarithmic', 'hyperbolic'])              models_dict_keys_list = list(models_dict.keys())     models_dict_values_list = list(models_dict.values())              # Initial guess for the parameters     if p0_dict_in:         p0_dict_in_keys_list = list(p0_dict_in.keys())         for elem in models_dict_keys_list:             if elem in p0_dict_in_keys_list:                 models_dict[elem][1] = p0_dict_in[elem]                  # Calculations     X_fact = np.array(X_in)     Y_fact = np.array(Y_in)          nx = 100 if not(nx_in) else nx_in     hx = (Xmax - Xmin)\/(nx - 1)     X_calc_graph = np.linspace(Xmin, Xmax, nx)          parameters_list = list()     models_list = list()          error_metrics_df = pd.DataFrame(columns=['MSE', 'RMSE', 'MAE', 'MSPE', 'MAPE', 'RMSLE', 'R2'])     Y_calc_graph_df = pd.DataFrame({'X': X_calc_graph})     Y_calc_df = pd.DataFrame({         'X_fact': X_fact,         'Y_fact': Y_fact})          for elem in models_list_in:         if elem in models_dict_keys_list:             func = models_dict[elem][0]             p0 = models_dict[elem][1]             popt_, _ = curve_fit(func, X_fact, Y_fact, p0=p0)             models_dict[elem].append(popt_)             Y_calc_graph = func(X_calc_graph, *popt_)             Y_calc = func(X_fact, *popt_)             Y_calc_graph_df[elem] = Y_calc_graph             Y_calc_df[elem] = Y_calc             parameters_list.append(popt_)             models_list.append(elem)             (model_error_metrics, result_error_metrics) = regression_error_metrics(Yfact=Y_fact, Ycalc=Y_calc_df[elem], model_name=elem)             error_metrics_df = pd.concat([error_metrics_df, result_error_metrics])                      parameters_df = pd.DataFrame(parameters_list,                                  index=models_list)     parameters_df = parameters_df.add_prefix('b')     result_df = parameters_df.join(error_metrics_df)                              # Legend for a linear model     if \"linear\" in models_list_in:         b0_linear = round(result_df.loc[\"linear\", \"b0\"], DecPlace)         b0_linear_str = str(b0_linear)         b1_linear = round(result_df.loc[\"linear\", \"b1\"], DecPlace)         b1_linear_str = f' + {b1_linear}' if b1_linear > 0 else f' - {abs(b1_linear)}'         R2_linear = round(result_df.loc[\"linear\", \"R2\"], DecPlace)         MSPE_linear = result_df.loc[\"linear\", \"MSPE\"]         MAPE_linear = result_df.loc[\"linear\", \"MAPE\"]         label_linear = 'linear: ' + r'$Y_{calc} = $' + b0_linear_str + b1_linear_str + f'{chr(183)}X' + ' ' + \\             r'$(R^2 = $' + f'{R2_linear}' + ', ' + f'MSPE = {MSPE_linear}' + ', ' + f'MAPE = {MAPE_linear})'          # Legend for a quadratic model     if \"quadratic\" in models_list_in:         b0_quadratic = round(result_df.loc[\"quadratic\", \"b0\"], DecPlace)         b0_quadratic_str = str(b0_quadratic)         b1_quadratic = result_df.loc[\"quadratic\", \"b1\"]         b1_quadratic_str = f' + {b1_quadratic:.{DecPlace}e}' if b1_quadratic > 0 else f' - {abs(b1_quadratic):.{DecPlace}e}'         b2_quadratic = result_df.loc[\"quadratic\", \"b2\"]         b2_quadratic_str = f' + {b2_quadratic:.{DecPlace}e}' if b2_quadratic > 0 else f' - {abs(b2_quadratic):.{DecPlace}e}'         R2_quadratic = round(result_df.loc[\"quadratic\", \"R2\"], DecPlace)         MSPE_quadratic = result_df.loc[\"quadratic\", \"MSPE\"]         MAPE_quadratic = result_df.loc[\"quadratic\", \"MAPE\"]         label_quadratic = 'quadratic: ' + r'$Y_{calc} = $' + b0_quadratic_str + b1_quadratic_str + f'{chr(183)}X' + b2_quadratic_str + f'{chr(183)}' + r'$X^2$' + ' ' + \\             r'$(R^2 = $' + f'{R2_quadratic}' + ', ' + f'MSPE = {MSPE_quadratic}' + ', ' + f'MAPE = {MAPE_quadratic})'          # Legend for a qubic model     if \"qubic\" in models_list_in:         b0_qubic = round(result_df.loc[\"qubic\", \"b0\"], DecPlace)         b0_qubic_str = str(b0_qubic)         b1_qubic = result_df.loc[\"qubic\", \"b1\"]         b1_qubic_str = f' + {b1_qubic:.{DecPlace}e}' if b1_qubic > 0 else f' - {abs(b1_qubic):.{DecPlace}e}'         b2_qubic = result_df.loc[\"qubic\", \"b2\"]         b2_qubic_str = f' + {b2_qubic:.{DecPlace}e}' if b2_qubic > 0 else f' - {abs(b2_qubic):.{DecPlace}e}'         b3_qubic = result_df.loc[\"qubic\", \"b3\"]         b3_qubic_str = f' + {b3_qubic:.{DecPlace}e}' if b3_qubic > 0 else f' - {abs(b3_qubic):.{DecPlace}e}'         R2_qubic = round(result_df.loc[\"qubic\", \"R2\"], DecPlace)         MSPE_qubic = result_df.loc[\"qubic\", \"MSPE\"]         MAPE_qubic = result_df.loc[\"qubic\", \"MAPE\"]         label_qubic = 'qubic: ' + r'$Y_{calc} = $' + b0_qubic_str + b1_qubic_str + f'{chr(183)}X' + \\             b2_qubic_str + f'{chr(183)}' + r'$X^2$' + b3_qubic_str + f'{chr(183)}' + r'$X^3$' + ' ' + \\             r'$(R^2 = $' + f'{R2_qubic}' + ', ' + f'MSPE = {MSPE_qubic}' + ', ' + f'MAPE = {MAPE_qubic})'          # Legend for a power model     if \"power\" in models_list_in:         b0_power = round(result_df.loc[\"power\", \"b0\"], DecPlace)         b0_power_str = str(b0_power)         b1_power = round(result_df.loc[\"power\", \"b1\"], DecPlace)         b1_power_str = str(b1_power)         R2_power = round(result_df.loc[\"power\", \"R2\"], DecPlace)         MSPE_power = result_df.loc[\"power\", \"MSPE\"]         MAPE_power = result_df.loc[\"power\", \"MAPE\"]         label_power = 'power: ' + r'$Y_{calc} = $' + b0_power_str + f'{chr(183)}' + r'$X$'         for elem in b1_power_str:             label_power = label_power + r'$^{}$'.format(elem)         label_power = label_power  + ' ' + r'$(R^2 = $' + f'{R2_power}' + ', ' + f'MSPE = {MSPE_power}' + ', ' + f'MAPE = {MAPE_power})'          # Legend for a exponential model     if \"exponential\" in models_list_in:         b0_exponential = round(result_df.loc[\"exponential\", \"b0\"], DecPlace)         b0_exponential_str = str(b0_exponential)         b1_exponential = result_df.loc[\"exponential\", \"b1\"]         b1_exponential_str = f'{b1_exponential:.{DecPlace}e}'         R2_exponential = round(result_df.loc[\"exponential\", \"R2\"], DecPlace)         MSPE_exponential = result_df.loc[\"exponential\", \"MSPE\"]         MAPE_exponential = result_df.loc[\"exponential\", \"MAPE\"]         label_exponential = 'exponential: ' + r'$Y_{calc} = $' + b0_exponential_str + f'{chr(183)}' + r'$e$'         for elem in b1_exponential_str:             label_exponential = label_exponential + r'$^{}$'.format(elem)         label_exponential = label_exponential + r'$^{}$'.format(chr(183)) + r'$^X$' + ' ' + \\             r'$(R^2 = $' + f'{R2_exponential}' + ', ' + f'MSPE = {MSPE_exponential}' + ', ' + f'MAPE = {MAPE_exponential})'          # Legend for a logarithmic model     if \"logarithmic\" in models_list_in:         b0_logarithmic = round(result_df.loc[\"logarithmic\", \"b0\"], DecPlace)         b0_logarithmic_str = str(b0_logarithmic)         b1_logarithmic = round(result_df.loc[\"logarithmic\", \"b1\"], DecPlace)         b1_logarithmic_str = f' + {b1_logarithmic}' if b1_logarithmic > 0 else f' - {abs(b1_logarithmic)}'         R2_logarithmic = round(result_df.loc[\"logarithmic\", \"R2\"], DecPlace)         MSPE_logarithmic = result_df.loc[\"logarithmic\", \"MSPE\"]         MAPE_logarithmic = result_df.loc[\"logarithmic\", \"MAPE\"]         label_logarithmic = 'logarithmic: ' + r'$Y_{calc} = $' + b0_logarithmic_str + b1_logarithmic_str + f'{chr(183)}ln(X)' + ' ' + \\             r'$(R^2 = $' + f'{R2_logarithmic}' + ', ' + f'MSPE = {MSPE_logarithmic}' + ', ' + f'MAPE = {MAPE_logarithmic})'          # Legend for a hyperbolic model     if \"hyperbolic\" in models_list_in:         b0_hyperbolic = round(result_df.loc[\"hyperbolic\", \"b0\"], DecPlace)         b0_hyperbolic_str = str(b0_hyperbolic)         b1_hyperbolic = round(result_df.loc[\"hyperbolic\", \"b1\"], DecPlace)         b1_hyperbolic_str = f' + {b1_hyperbolic}' if b1_hyperbolic > 0 else f' - {abs(b1_hyperbolic)}'         R2_hyperbolic = round(result_df.loc[\"hyperbolic\", \"R2\"], DecPlace)         MSPE_hyperbolic = result_df.loc[\"hyperbolic\", \"MSPE\"]         MAPE_hyperbolic = result_df.loc[\"hyperbolic\", \"MAPE\"]         label_hyperbolic = 'hyperbolic: ' + r'$Y_{calc} = $' + b0_hyperbolic_str + b1_hyperbolic_str + f' \/ X' + ' ' + \\             r'$(R^2 = $' + f'{R2_hyperbolic}' + ', ' + f'MSPE = {MSPE_hyperbolic}' + ', ' + f'MAPE = {MAPE_hyperbolic})'              # Legends     label_legend_dict = {         'linear':      label_linear if \"linear\" in models_list_in else '',         'quadratic':   label_quadratic if \"quadratic\" in models_list_in else '',         'qubic':       label_qubic if \"qubic\" in models_list_in else '',         'power':       label_power if \"power\" in models_list_in else '',         'exponential': label_exponential if \"exponential\" in models_list_in else '',         'logarithmic': label_logarithmic if \"logarithmic\" in models_list_in else '',         'hyperbolic':  label_hyperbolic if \"hyperbolic\" in models_list_in else ''}          # Graphics     color_dict = {         'linear':      'blue',         'quadratic':   'green',         'qubic':       'brown',         'power':       'magenta',         'exponential': 'cyan',         'logarithmic': 'orange',         'hyperbolic':  'grey'}          if not(Xmin) and not(Xmax):         Xmin = min(X_fact)*0.99         Xmax = max(X_fact)*1.01     if not(Ymin) and not(Ymax):         Ymin = min(Y_fact)*0.99         Ymax = max(Y_fact)*1.01                   fig, axes = plt.subplots(figsize=(graph_size))     fig.suptitle(title_figure, fontsize = title_figure_fontsize)     axes.set_title(title_axes, fontsize = title_axes_fontsize)          sns.scatterplot(         x=X_fact, y=Y_fact,         label='data',         s=50,         color='red',         ax=axes)             for elem in models_list_in:         if elem in models_dict_keys_list:             sns.lineplot(                 x=X_calc_graph, y=Y_calc_graph_df[elem],                 color=color_dict[elem],                 linewidth=linewidth,                 legend=True,                 label=label_legend_dict[elem],                 ax=axes)      axes.set_xlim(Xmin, Xmax)     axes.set_ylim(Ymin, Ymax)     axes.set_xlabel(x_label, fontsize = label_fontsize)     axes.set_ylabel(y_label, fontsize = label_fontsize)     axes.tick_params(labelsize = tick_fontsize)     axes.legend(prop={'size': label_legend_fontsize})      plt.show()          if file_name:         fig.savefig(file_name, orientation = \"portrait\", dpi = 300)          # result output     output_list = [result_df, Y_calc_df, Y_calc_graph_df]     result_list = [result_table, value_table_calc, value_table_graph]     result = list()     for i, elem in enumerate(result_list):         if elem:             result.append(output_list[i])          # result display     for elem in ['MSPE', 'MAPE']:         result_df[elem] = result_df[elem].apply(lambda s: float(s[:-1]))     b_formatter = [b0_formatter, b1_formatter, b2_formatter, b3_formatter]     if result_table:         display(result_df                 .style                     .format(                         precision=DecPlace, na_rep='-',                         formatter={                             'b0': b0_formatter if b0_formatter else '{:.4f}',                             'b1': b1_formatter if b1_formatter else '{:.4f}',                             'b2': b2_formatter if b2_formatter else '{:.4e}',                             'b3': b3_formatter if b3_formatter else '{:.4e}'})                     .highlight_min(color='green', subset=['MSE', 'RMSE', 'MAE', 'MSPE', 'MAPE'])                     .highlight_max(color='red', subset=['MSE', 'RMSE', 'MAE', 'MSPE', 'MAPE'])                     .highlight_max(color='green', subset='R2')                     .highlight_min(color='red', subset='R2')                     .applymap(lambda x: 'color: orange;' if abs(x) &lt;= 10**(-(DecPlace-1)) else None, subset=parameters_df.columns))          if value_table_calc:         display(Y_calc_df)     if value_table_graph:         display(Y_calc_graph_df)                          return result<\/code><\/pre>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 <strong>\u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0445\u043e\u0434\u0430 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f (\u043b\/100 \u043a\u043c) (FuelFlow)<\/strong> \u043e\u0442 <strong>\u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0431\u0435\u0433\u0430 (\u043a\u043c) (Mileage)<\/strong>:<\/p>\n<pre><code class=\"python\">title_figure = Title_String + '\\n' + Task_Theme + '\\n' title_axes = 'Fuel mileage ratio'      models_list = ['linear', 'power', 'exponential', 'quadratic', 'qubic', 'logistic', 'logarithmic', 'hyperbolic']  p0_dict_in= {'exponential': [1, -0.1],              'power': [1, -0.1]}  (result_df, value_table_calc, value_table_graph ) = simple_approximation(     X1, Y,     models_list, p0_dict_in,     Xmin = X1_min_graph, Xmax = X1_max_graph,     Ymin = Y_min_graph, Ymax = Y_max_graph,     DecPlace=DecPlace,     result_table=True, value_table_calc=True, value_table_graph=True,     title_figure = title_figure,     title_axes = title_axes,     x_label=Variable_Name_X1,     y_label=Variable_Name_Y,     linewidth=2,     b1_formatter='{:.' + str(DecPlace + 3) + 'f}', b2_formatter='{:.' + str(DecPlace) + 'e}', b3_formatter='{:.' + str(DecPlace) + 'e}')<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/763\/9f5\/424\/7639f542455e5d4b1c01399b9de55439.png\" width=\"990\" height=\"770\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/763\/9f5\/424\/7639f542455e5d4b1c01399b9de55439.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/776\/84f\/fd1\/77684ffd11788132350958eefdcbf24c.png\" width=\"894\" height=\"245\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/776\/84f\/fd1\/77684ffd11788132350958eefdcbf24c.png\"\/><\/figure>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 <strong>\u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0445\u043e\u0434\u0430 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f (\u043b\/100 \u043a\u043c) (FuelFlow)<\/strong> \u043e\u0442 <strong>\u0441\u0440\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0439 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b (Temperature)<\/strong>:<\/p>\n<pre><code class=\"python\">models_list = ['linear', 'exponential', 'quadratic']  (result_df, value_table_calc, value_table_graph ) = simple_approximation(     X_sort_clear, Y_sort_clear,     models_list, p0_dict_in,     Xmin = X2_min_graph, Xmax = X2_max_graph,     Ymin = Y_min_graph, Ymax = Y_max_graph,     DecPlace=DecPlace,     result_table=True, value_table_calc=True, value_table_graph=True,     title_figure = title_figure,     title_axes = 'Dependence of FuelFlow on temperature',     x_label=Variable_Name_X2,     y_label=Variable_Name_Y,     linewidth=2,     b1_formatter='{:.' + str(DecPlace + 3) + 'f}', b2_formatter='{:.' + str(DecPlace) + 'e}', b3_formatter='{:.' + str(DecPlace) + 'e}')<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2b4\/555\/33b\/2b455533b9c49303224e8447509b9c6e.png\" width=\"983\" height=\"770\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2b4\/555\/33b\/2b455533b9c49303224e8447509b9c6e.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/595\/2eb\/7cf\/5952eb7cfd6ba34618a8142c953c84bb.png\" width=\"779\" height=\"133\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/595\/2eb\/7cf\/5952eb7cfd6ba34618a8142c953c84bb.png\"\/><\/figure>\n<h2>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 offtop &#8212; \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u0432 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f<\/h2>\n<p>\u041d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u0445\u043e\u0447\u0443 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432:<\/p>\n<ul>\n<li>\n<p><strong>Python<\/strong>, \u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>scipy.optimize.curve_fit<\/strong>;<\/p>\n<\/li>\n<li>\n<p><strong>MS Excel<\/strong>;<\/p>\n<\/li>\n<li>\n<p>\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0439 \u0430\u043b\u0433\u0435\u0431\u0440\u044b <strong>Maxima<\/strong> (\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043e\u0441\u0432\u043e\u0438\u0442\u044c \u0432\u0441\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0430\u043c, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u043c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0430\u0441\u0447\u0435\u0442\u044b).<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0441 \u0440\u0430\u0441\u0447\u0435\u0442\u0430\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 \u043c\u043e\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 GitHub (<a href=\"https:\/\/github.com\/AANazarov\/MyModulePython\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/AANazarov\/MyModulePython<\/a>).<\/p>\n<p>\u0418\u0442\u0430\u043a:<\/p>\n<p><strong>Python<\/strong>, \u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>scipy.optimize.curve_fit<\/strong>:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c<\/p>\n<\/th>\n<th>\n<p>\u0423\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/p>\n<\/th>\n<th>\n<p>\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"R^2\" alt=\"R^2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7aa\/430\/9f9\/7aa4309f9d0077358233f59fef4f222e.svg\" width=\"23\" height=\"21\"\/><\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=11.8501-2.1760 \\cdot 10^{-3} \\cdot X\" alt=\"Y=11.8501-2.1760 \\cdot 10^{-3} \\cdot X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/011\/180\/c56\/011180c569d463f04293585c0c9f6521.svg\" width=\"264\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.4226<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=14.3435-7.0471 \\cdot 10^{-3} \\cdot X+1.8760 \\cdot 10^{-6} \\cdot X^2\" alt=\"Y=14.3435-7.0471 \\cdot 10^{-3} \\cdot X+1.8760 \\cdot 10^{-6} \\cdot X^2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/599\/46b\/e51\/59946be515f11aae9620929111376f58.svg\" width=\"433\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.6357<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043a\u0443\u0431\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=14.8385-8.804 \\cdot 10^{-3} \\cdot X+3.5207 \\cdot 10^{-6} \\cdot X^2-4.1264 \\cdot 10^{-10} \\cdot X^3\" alt=\"Y=14.8385-8.804 \\cdot 10^{-3} \\cdot X+3.5207 \\cdot 10^{-6} \\cdot X^2-4.1264 \\cdot 10^{-10} \\cdot X^3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/edd\/990\/50e\/edd99050e81dc6b456a4d9aae047b8e7.svg\" width=\"599\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.6415<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=33.4033\\cdot X^{-0.1841}\" alt=\"Y=33.4033\\cdot X^{-0.1841}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5db\/f28\/584\/5dbf28584a8d206d9c561c70bae30346.svg\" width=\"185\" height=\"21\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.6588<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f I \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=12.6242\\cdot e^{2.783\\cdot 10^{-4} \\cdot X}\" alt=\"Y=12.6242\\cdot e^{2.783\\cdot 10^{-4} \\cdot X}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/43d\/8b2\/456\/43d8b2456bb36a487c0589abea732ba0.svg\" width=\"206\" height=\"23\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.4857<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f II \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=12.6242\\cdot 0.9997^X\" alt=\"Y=12.6242\\cdot 0.9997^X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/685\/46a\/18b\/68546a18b94f923ec931428db054bbb5.svg\" width=\"185\" height=\"21\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.4857<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=23.9866-2.1169\\cdot ln X\" alt=\"Y=23.9866-2.1169\\cdot ln X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d5b\/225\/f90\/d5b225f90f6303fca35de045e182235f.svg\" width=\"228\" height=\"18\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.6625<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0433\u0438\u043f\u0435\u0440\u0431\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=9.2219+\\frac{315.7336}{X}\" alt=\"Y=9.2219+\\frac{315.7336}{X}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/aaf\/de7\/3bd\/aafde73bd3edebad39240f593902712a.svg\" width=\"197\" height=\"43\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.4618<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><strong>MS Excel<\/strong>:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c<\/p>\n<\/th>\n<th>\n<p>\u0423\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/p>\n<\/th>\n<th>\n<p>\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"R^2\" alt=\"R^2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/daf\/0fd\/354\/daf0fd354a24d70a7ca0b43377332e52.svg\" width=\"23\" height=\"21\"\/><\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=11.85-0.0022 \\cdot X\" alt=\"Y=11.85-0.0022 \\cdot X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/87b\/8b8\/c31\/87b8b8c3101fc3f3f5e6aaee69220055.svg\" width=\"192\" height=\"18\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.4226<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=14.345-0.007 \\cdot X+2 \\cdot 10^{-6} \\cdot X^2\" alt=\"Y=14.345-0.007 \\cdot X+2 \\cdot 10^{-6} \\cdot X^2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/abb\/ff1\/7e3\/abbff17e359cfd18cbc19fe3d4bc9e28.svg\" width=\"317\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.6359<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043a\u0443\u0431\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=14.84-0.0088 \\cdot X+4 \\cdot 10^{-6} \\cdot X^2-4 \\cdot 10^{-10} \\cdot X^3\" alt=\"Y=14.84-0.0088 \\cdot X+4 \\cdot 10^{-6} \\cdot X^2-4 \\cdot 10^{-10} \\cdot X^3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cde\/137\/57b\/cde13757b5e2daead11d916f2fe8e6af.svg\" width=\"449\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.6417<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=35.303\\cdot X^{-0.193}\" alt=\"Y=35.303\\cdot X^{-0.193}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cae\/dcd\/da6\/caedcdda6c3f595cb94600495f07c47d.svg\" width=\"168\" height=\"21\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.6582<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f I \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=11.848\\cdot e^{2\\cdot 10^{-4} \\cdot X}\" alt=\"Y=11.848\\cdot e^{2\\cdot 10^{-4} \\cdot X}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4f2\/5da\/f39\/4f25daf392ab7eead5dc4e6fd821c40a.svg\" width=\"172\" height=\"23\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.4739<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f II \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8212;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8212;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=23.989-2.117\\cdot ln X\" alt=\"Y=23.989-2.117\\cdot ln X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/42a\/438\/400\/42a438400dff52f866773e19e08bcd79.svg\" width=\"209\" height=\"18\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.6627<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0433\u0438\u043f\u0435\u0440\u0431\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8212;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8212;<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><strong>Maxima:<\/strong><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c<\/p>\n<\/th>\n<th>\n<p>\u0423\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/p>\n<\/th>\n<th>\n<p>\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"R^2\" alt=\"R^2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ad9\/b2a\/7c8\/ad9b2a7c88f3e73f94f4d5a42ee899ec.svg\" width=\"23\" height=\"21\"\/><\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=11.85-2.1760 \\cdot 10^{-3} \\cdot X\" alt=\"Y=11.85-2.1760 \\cdot 10^{-3} \\cdot X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5f8\/c5b\/afb\/5f8c5bafb01884cb13836cb543e6fcef.svg\" width=\"244\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.4226<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=14.343-7.0471 \\cdot 10^{-3} \\cdot X+1.8760 \\cdot 10^{-6} \\cdot X^2\" alt=\"Y=14.343-7.0471 \\cdot 10^{-3} \\cdot X+1.8760 \\cdot 10^{-6} \\cdot X^2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cc4\/a27\/0b6\/cc4a270b6cafc31eb543378f1ee8e02c.svg\" width=\"423\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.6357<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043a\u0443\u0431\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=14.838-8.804 \\cdot 10^{-3} \\cdot X+3.5207 \\cdot 10^{-6} \\cdot X^2-4.1264 \\cdot 10^{-10} \\cdot X^3\" alt=\"Y=14.838-8.804 \\cdot 10^{-3} \\cdot X+3.5207 \\cdot 10^{-6} \\cdot X^2-4.1264 \\cdot 10^{-10} \\cdot X^3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/13e\/5e7\/8b1\/13e5e78b17cec7ac4ea54f50fc55fe87.svg\" width=\"589\" height=\"22\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.6415<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=33.355\\cdot X^{-0.18388}\" alt=\"Y=33.355\\cdot X^{-0.18388}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a18\/89f\/7c7\/a1889f7c76b833f54505566394179039.svg\" width=\"182\" height=\"21\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.6588<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f I \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=12.624\\cdot e^{2.7835\\cdot 10^{-4} \\cdot X}\" alt=\"Y=12.624\\cdot e^{2.7835\\cdot 10^{-4} \\cdot X}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/377\/207\/028\/377207028f2c901169e01132021adb2c.svg\" width=\"203\" height=\"23\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.4857<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f II \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=12.624\\cdot 0.99972^X\" alt=\"Y=12.624\\cdot 0.99972^X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b86\/7bb\/93c\/b867bb93c300eb88159a23e9017c223e.svg\" width=\"185\" height=\"21\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.4857<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=23.987-2.117\\cdot ln  X\" alt=\"Y=23.987-2.117\\cdot ln  X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b7f\/e5a\/8b4\/b7fe5a8b4ceffdfb8dc3fe9290897a88.svg\" width=\"209\" height=\"18\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.6625<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0433\u0438\u043f\u0435\u0440\u0431\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y=9.2219+\\frac{315.73}{X}\" alt=\"Y=9.2219+\\frac{315.73}{X}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/60d\/e58\/2e0\/60de582e0d0776bf8bac9458250dc538.svg\" width=\"178\" height=\"43\"\/><\/p>\n<\/td>\n<td>\n<p align=\"left\">0.4618<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438\u043c\u0435\u044e\u0442 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u0434\u043b\u044f \u0441\u0442\u0435\u043f\u0435\u043d\u043d\u044b\u0445 \u0438 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0415\u0441\u0442\u044c \u043d\u0430\u0434 \u0447\u0435\u043c \u0437\u0430\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f&#8230;<\/p>\n<h2>\u0418\u0422\u041e\u0413\u0418 <\/h2>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e\u0434\u0432\u0435\u0434\u0435\u043c \u0438\u0442\u043e\u0433\u0438:<\/p>\n<ul>\n<li>\n<p>\u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b <strong>Python<\/strong> \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (\u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 Excel), \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u044e\u0449\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0443 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u044e\u0449\u0430\u044f \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439, \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0437\u043e\u0440\u0430 \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0435\u0439; \u0442\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f, \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e, \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>\u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (\u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u0440\u0438\u0432\u044b\u0445, S-\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u0440\u0438\u0432\u044b\u0445 \u0438 \u043f\u0440.), \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0434\u043b\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u0432\u044b\u0431\u043e\u0440\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438 \u0431\u044b\u0441\u0442\u0440\u043e\u0439\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0432\u0438\u0434\u0435 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 (<strong>bounds<\/strong>) \u0438 \u0432 \u0432\u0438\u0434\u0435 \u0430\u043b\u0433\u0435\u0431\u0440\u0430\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 (<strong>constraints<\/strong>);<\/p>\n<\/li>\n<li>\n<p>\u0431\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>lmfit<\/strong> \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438,<\/p>\n<\/li>\n<\/ul>\n<p>\u0438 \u0442.\u0434.<\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u0435\u0441\u0442\u044c \u043a\u0443\u0434\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043c\u043e\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 GitHub (<a href=\"https:\/\/github.com\/AANazarov\/Statistical-methods\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/AANazarov\/Statistical-methods<\/a>).<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0434\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u0437\u043e\u0440 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0430\u043c <strong>DataScience<\/strong> \u0432 \u0440\u0430\u0431\u043e\u0442\u0435.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/729048\/\"> https:\/\/habr.com\/ru\/articles\/729048\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>  \u0410\u041a\u0422\u0423\u0410\u041b\u042c\u041d\u041e\u0421\u0422\u042c \u0422\u0415\u041c\u042b<\/h2>\n<p> \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043e\u0431\u0437\u043e\u0440\u0430\u0445 (<a href=\"https:\/\/habr.com\/ru\/articles\/690414\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/690414\/<\/a>, <a href=\"https:\/\/habr.com\/ru\/articles\/695556\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/695556\/<\/a>) \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u0443\u044e \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044e. \u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438. \u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>\u041f\u0440\u043e \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e, \u0447\u0442\u043e, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0443\u0436\u0435 \u043d\u0435\u0447\u0435\u0433\u043e. \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u043e\u0435-\u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f.<\/p>\n<p>\u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c. \u041f\u043e\u0434\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u044e &#8212; \u0440\u0435\u0447\u044c \u043d\u0435 \u0438\u0434\u0435\u0442 \u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u043c \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0435\u0433\u043e \u044d\u0442\u0430\u043f\u0430\u043c\u0438, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0433\u0438\u043f\u043e\u0442\u0435\u0437 \u0438 \u0442.\u0434., \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0438\u0448\u044c \u043e \u043f\u043e\u0434\u0431\u043e\u0440\u0435 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0438 \u043e\u0446\u0435\u043d\u043a\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u043a\u0438\u043c\u0438-\u043b\u0438\u0431\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0432 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 \u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0438 \u0431\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0433\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0442\u043e\u0442 \u0436\u0435 Excel &#8212; \u0432\u0441\u0435 \u043c\u044b \u043f\u043e\u043c\u043d\u0438\u043c, \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043b\u0438\u043d\u0438\u044e \u0442\u0440\u0435\u043d\u0434\u0430 \u043d\u0430 \u0442\u043e\u0447\u0435\u0447\u043d\u043e\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0435:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0430\u043a\u043e\u0439 \u0436\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0438 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0432 Python, \u043f\u0440\u0438\u0447\u0435\u043c \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0432 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u043e &#8212; \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0438 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432, \u043f\u0440\u0438\u0441\u0443\u0449\u0438\u0445 Excel:<\/p>\n<ul>\n<li>\n<p>\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u043c\u0435\u0442\u0440\u0438\u043a \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u044b \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043e\u0431\u0437\u043e\u0440\u0435.<\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/h4>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043e\u0431\u0437\u043e\u0440\u0430\u0445, \u0437\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. \u0412\u0441\u0435 \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0434\u043b\u044f \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0414\u0430\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f <strong>my_module__stat.py<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u043c\u043e\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 GitHub (<a href=\"https:\/\/github.com\/AANazarov\/MyModulePython\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/AANazarov\/MyModulePython<\/a>).<\/p>\n<p>\u0412\u043e\u0442 \u043f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/p>\n<ul>\n<li>\n<p><strong>graph_lineplot_sns<\/strong> &#8212; \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u0433\u0440\u0430\u0444\u0438\u043a \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 seaborn \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a \u0432 \u0432\u0438\u0434\u0435 png-\u0444\u0430\u0439\u043b\u0430;<\/p>\n<\/li>\n<li>\n<p><strong>graph_scatterplot_sns<\/strong> &#8212; \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u043e\u0447\u0435\u0447\u043d\u0443\u044e \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0443 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 seaborn \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a \u0432 \u0432\u0438\u0434\u0435 png-\u0444\u0430\u0439\u043b\u0430;<\/p>\n<\/li>\n<li>\n<p><strong>regression_error_metrics<\/strong>  &#8212; \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438;<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>simple_approximation<\/strong> \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0437\u043e\u0440\u0430 (\u043e\u043d\u0430 \u0442\u043e\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c <strong>my_module__stat.py<\/strong>).<\/p>\n<h2>\u0418\u0421\u0425\u041e\u0414\u041d\u042b\u0415 \u0414\u0410\u041d\u041d\u042b\u0415<\/h2>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043e\u0431\u0437\u043e\u0440\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 <strong>\u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0445\u043e\u0434\u0430 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f (\u043b\/100 \u043a\u043c) (FuelFlow)<\/strong> \u043e\u0442 <strong>\u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0431\u0435\u0433\u0430 (\u043a\u043c) (Mileage)<\/strong> \u0438 <strong>\u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0439 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b (Temperature)<\/strong> (\u044d\u0442\u043e\u0442 \u0436\u0435 \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0432 \u0441\u0432\u043e\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445: <a href=\"https:\/\/habr.com\/ru\/post\/683442\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/post\/683442\/<\/a>, <a href=\"https:\/\/habr.com\/ru\/post\/695556\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/post\/695556\/<\/a>).<\/p>\n<pre><code class=\"python\"># \u041e\u0431\u0449\u0438\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Task_Project = \"Analysis of fuel consumption of a car\"  # \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 AsOfTheDate = \"\"  # \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Task_Theme = \"\"  # \u041e\u0431\u0449\u0438\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 Title_String = f\"{Task_Project}\\n{AsOfTheDate}\"  # \u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 Variable_Name_T_month = \"Monthly data\" Variable_Name_Y = \"FuelFlow (liters per 100 km)\" Variable_Name_X1 = \"Mileage (km)\" Variable_Name_X2 = \"Temperature (\u00b0\u0421)\"<\/code><\/pre>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 csv-\u0444\u0430\u0439\u043b\u0430. \u042d\u0442\u043e \u0443\u0436\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u0434\u0430\u0442\u0430\u0441\u0435\u0442, \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 (\u043f\u0435\u0440\u0432\u0438\u0447\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u0430\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 <strong>Preparation of input <\/strong><a href=\"http:\/\/data.py\" rel=\"noopener noreferrer nofollow\"><strong>data.py<\/strong><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u043c\u043e\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 GitHub).<\/p>\n<p><strong>\u0421\u0442\u043e\u043b\u0431\u0446\u044b \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/strong>:<\/p>\n<ul>\n<li>\n<p><strong>Month<\/strong> \u2014 \u043c\u0435\u0441\u044f\u0446 (\u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 Excel)<\/p>\n<\/li>\n<li>\n<p><strong>Mileage<\/strong> &#8212; \u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0431\u0435\u0433 (\u043a\u043c)<\/p>\n<\/li>\n<li>\n<p><strong>Temperature<\/strong> &#8212; \u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u0430\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 (\u00b0C)<\/p>\n<\/li>\n<li>\n<p><strong>FuelFlow<\/strong> &#8212; \u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0439 \u0440\u0430\u0441\u0445\u043e\u0434 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 (\u043b\/100 \u043a<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">dataset_df = pd.read_csv(filepath_or_buffer='data\/dataset_df.csv', sep=';')<\/code><\/pre>\n<h4>\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/h4>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 (\u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430).<br \/>\u0421\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0439 \u0440\u0430\u0441\u0445\u043e\u0434 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 (\u043b\/100 \u043a\u043c) \/ Fuel Flow (liters per 100 km):<\/p>\n<pre><code class=\"python\">Y = np.array(dataset_df['Y'])<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0431\u0435\u0433 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f \u0437\u0430 \u043c\u0435\u0441\u044f\u0446 (\u043a\u043c) \/ Mileage (km):<\/p>\n<pre><code class=\"python\">X1 = np.array(dataset_df['X1'])<\/code><\/pre>\n<p>\u0421\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u0430\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 (\u00b0\u0421) \/ Temperature (degrees celsius):<\/p>\n<pre><code class=\"python\">X2 = np.array(dataset_df['X2'])<\/code><\/pre>\n<h4>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h4>\n<p>\u0413\u0440\u0430\u043d\u0438\u0446\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 (\u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432):<\/p>\n<pre><code class=\"python\">(X1_min_graph, X1_max_graph) = (0, 3000) (X2_min_graph, X2_max_graph) = (-20, 25) (Y_min_graph, Y_max_graph) = (0, 30)<\/code><\/pre>\n<p>\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0430:<\/p>\n<pre><code class=\"python\">graph_scatterplot_sns(     X1, Y,     Xmin=X1_min_graph, Xmax=X1_max_graph,     Ymin=Y_min_graph, Ymax=Y_max_graph,     color='orange',     title_figure=Title_String, title_figure_fontsize=14,     title_axes='Dependence of FuelFlow (Y) on mileage (X1)', title_axes_fontsize=16,     x_label=Variable_Name_X1,     y_label=Variable_Name_Y,     label_fontsize=14, tick_fontsize=12,     label_legend='', label_legend_fontsize=12,     s=80)<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<h2>\u041e\u0421\u041d\u041e\u0412\u042b \u0422\u0415\u041e\u0420\u0418\u0418 <\/h2>\n<p>\u041a\u0440\u0430\u0442\u043a\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0445.<\/p>\n<h4>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b Python \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438<\/h4>\n<p><strong>Python<\/strong> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441\u043c. <a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/optimize.html\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.scipy.org\/doc\/scipy\/reference\/optimize.html<\/a>). \u041c\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0437 \u043d\u0438\u0445:<\/p>\n<ul>\n<li>\n<p>\u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>scipy.optimize.leastsq<\/strong> (<a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.leastsq.html#scipy.optimize.leastsq\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.leastsq.html#scipy.optimize.leastsq<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>scipy.optimize.least_squares<\/strong> (<a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.least_squares.html#scipy.optimize.least_squares\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.least_squares.html#scipy.optimize.least_squares<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>scipy.optimize.curve_fit<\/strong> (<a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.curve_fit.html\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.curve_fit.html<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>scipy.optimize.minimize<\/strong> (<a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.minimize.html#scipy.optimize.minimize\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.minimize.html#scipy.optimize.minimize<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <strong>lmfit<\/strong> (<a href=\"https:\/\/lmfit.github.io\/lmfit-py\/\" rel=\"noopener noreferrer nofollow\">https:\/\/lmfit.github.io\/lmfit-py\/<\/a>)<\/p>\n<\/li>\n<\/ul>\n<h4> \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0432\u0438\u0434\u044b \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438<\/h4>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0441\u043e\u0442\u043d\u0438 \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u043e\u0432, \u043c\u043e\u043d\u043e\u0433\u0440\u0430\u0444\u0438\u0439, \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438 \u0441\u0442\u0430\u0442\u0435\u0439. \u041e\u0434\u043d\u0430\u043a\u043e, \u0432 \u0446\u0435\u043b\u044f\u0445 \u0443\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043d\u0438\u0436\u0435 \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0432\u0438\u0434\u044b \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 &#8212; \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u044d\u0442\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u0447\u0435\u0440\u043f\u044b\u0432\u0430\u044e\u0449\u0438\u043c, \u043d\u043e \u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0438\u043b\u0438 \u043c\u0435\u043d\u0435\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u043b\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p>\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/th>\n<th>\n<p>\u0423\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8216;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043a\u0443\u0431\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043f\u043e\u043b\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f I \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f II \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0433\u0438\u043f\u0435\u0440\u0431\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f I \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0433\u0438\u043f\u0435\u0440\u0431\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f II \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0433\u0438\u043f\u0435\u0440\u0431\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f III \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f I \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f II \u0442\u0438\u043f\u0430 (\u041f\u0435\u0440\u043b\u0430-\u0420\u0438\u0434\u0430)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043a\u0440\u0438\u0432\u0430\u044f \u0413\u043e\u043c\u043f\u0435\u0440\u0446\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u0430 I \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u0430 II \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f I \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f II \u0442\u0438\u043f\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><strong><u>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f:<\/u><\/strong><\/p>\n<ol>\n<li>\n<p>\u041d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u0440\u044f\u0434\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 2 \u0433\u0440\u0443\u043f\u043f\u044b: <\/p>\n<ul>\n<li>\n<p><strong>\u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0435 \u043f\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u0430\u043c<\/strong> &#8212; \u043f\u0443\u0442\u0435\u043c \u0437\u0430\u043c\u0435\u043d\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043b\u0438\u043d\u0435\u0430\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u044b, \u0442.\u0435. \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043a \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443, \u0438 \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p><strong>\u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0435 \u043f\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c<\/strong> &#8212; \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043b\u0438\u043d\u0435\u0430\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u044b, \u0438 \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u041a \u043c\u043e\u0434\u0435\u043b\u044f\u043c, \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u043f\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c, \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u0440\u0438\u0432\u044b\u0435 (\u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f), \u043a\u0440\u0438\u0432\u0430\u044f \u0413\u043e\u043c\u043f\u0435\u0440\u0446\u0430 \u0438 \u043f\u0440. \u041e\u0446\u0435\u043d\u043a\u0430 \u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 Python \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0441\u043e\u0431\u044b\u0445 \u043f\u0440\u0438\u0435\u043c\u043e\u0432 (\u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439). \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0430\u0437\u0431\u043e\u0440\u0435 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u0441\u043e\u0431\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445.<\/p>\n<h4> \u041e\u0446\u0435\u043d\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438<\/h4>\n<ol start=\"2\">\n<li>\n<p>\u042d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u044b \u0432 2-\u0445 \u0444\u043e\u0440\u043c\u0430\u0445:<\/p>\n<ul>\n<li>\n<p>\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e <strong>\u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/strong> ;<\/p>\n<\/li>\n<li>\n<p>\u0432 <strong>\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0435<\/strong> <\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u0441\u043e\u0431\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0443\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u0434\u043b\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0442\u043c\u0435\u0442\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e, \u0441 \u043e\u0441\u043e\u0431\u044b\u043c \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u043e\u043c \u0437\u0430\u0434\u0430\u0447\u0438, \u0430 \u043f\u043e\u043b\u0438\u043d\u043e\u043c\u044b \u0432\u044b\u0448\u0435 3-\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f.<\/p>\n<h4> \u041c\u0435\u0442\u0440\u0438\u043a\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438<\/h4>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430:<\/p>\n<ol>\n<li>\n<p><strong>Mean squared error (MSE)<\/strong>  &#8212; \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0438 <strong>Root mean square error (RMSE)<\/strong> &#8212; \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u0440\u0435\u043d\u044c \u0438\u0437 \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 <strong>MSE<\/strong>:<\/p>\n<\/li>\n<\/ol>\n<\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438: \u0442\u0435\u043d\u0434\u0435\u043d\u0446\u0438\u044f \u043a \u0437\u0430\u043d\u0438\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u043e\u0434\u0435\u043b\u0438, \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a \u0432\u044b\u0431\u0440\u043e\u0441\u0430\u043c.<\/p>\n<p> 2. <strong>Mean absolute error (MAE)<\/strong> &#8212; \u0441\u0440\u0435\u0434\u043d\u044f\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430:<\/p>\n<\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c: \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u0435\u0435 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u0430 \u043a \u0432\u044b\u0431\u0440\u043e\u0441\u0430\u043c, \u0447\u0435\u043c <strong>RMSE<\/strong>.<\/p>\n<p> 3. <strong>Mean squared prediction error (MSPE)<\/strong> &#8212; \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0430 (\u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430\u0445):<\/p>\n<\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438: \u043d\u0435\u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a \u0432\u044b\u0431\u0440\u043e\u0441\u0430\u043c; \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0432\u043d\u044b \u043d\u0443\u043b\u044e.<\/p>\n<p> 4. <strong>Mean absolute percentage error (MAPE)<\/strong> &#8212; \u0441\u0440\u0435\u0434\u043d\u044f\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430\u0445:<\/p>\n<\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438: \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0432\u043d\u044b \u043d\u0443\u043b\u044e.<\/p>\n<p> 5. <strong>Root Mean Square Logarithmic Error (RMSLE)<\/strong> &#8212; c\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u0430\u044f \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438 \u0432\u044b\u0448\u0435:<\/p>\n<\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438: \u043d\u0435\u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a \u0432\u044b\u0431\u0440\u043e\u0441\u0430\u043c; \u0441\u043c\u0435\u0449\u0435\u043d\u0430 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a (\u043d\u0430\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0430 \u043d\u0435\u0434\u043e\u043e\u0446\u0435\u043d\u043a\u0443, \u0447\u0435\u043c \u0437\u0430 \u043f\u0435\u0440\u0435\u043e\u0446\u0435\u043d\u043a\u0443); \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 1, \u0442\u0430\u043a \u043a\u0430\u043a \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c 0 \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d.<\/p>\n<p> 6.  &#8212; \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0446\u0438\u0438:<\/p>\n<\/p>\n<\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c: \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435  \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 [0; 1], \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (\u0435\u0441\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f).<br \/> \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u043c\u0435\u0442\u0440\u0438\u043a \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u0447\u0435\u0440\u043f\u044b\u0432\u0430\u044e\u0449\u0438\u043c.<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043c\u0435\u0442\u0440\u0438\u043a \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0432\u00a0<a href=\"https:\/\/machinelearningmastery.ru\/how-to-select-the-right-evaluation-metric-for-machine-learning-models-part-1-regrression-metrics-3606e25beae0\/\" rel=\"noopener noreferrer nofollow\">https:\/\/machinelearningmastery.ru\/how-to-select-the-right-evaluation-metric-for-machine-learning-models-part-1-regrression-metrics-3606e25beae0\/<\/a>,\u00a0<a href=\"https:\/\/machinelearningmastery.ru\/how-to-select-the-right-evaluation-metric-for-machine-learning-models-part-2-regression-metrics-d4a1a9ba3d74\/\" rel=\"noopener noreferrer nofollow\">https:\/\/machinelearningmastery.ru\/how-to-select-the-right-evaluation-metric-for-machine-learning-models-part-2-regression-metrics-d4a1a9ba3d74\/<\/a>,\u00a0<a href=\"https:\/\/loginom.ru\/blog\/quality-metrics\" rel=\"noopener noreferrer nofollow\">https:\/\/loginom.ru\/blog\/quality-metrics<\/a>.<\/p>\n<h4>\u041e\u0446\u0435\u043d\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438<\/h4>\n<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438\u00a0<strong>Python<\/strong>\u00a0\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0431\u0448\u0438\u0440\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0442\u0435\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u0434\u0430\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-416221","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/416221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=416221"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/416221\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=416221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=416221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=416221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}