{"id":340590,"date":"2022-11-01T15:00:51","date_gmt":"2022-11-01T15:00:51","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=340590"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=340590","title":{"rendered":"<span>ML | Hydra<\/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<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/aee\/329\/161\/aee329161dfa60888b62aa05e3d222d3.png\" width=\"275\" height=\"183\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/aee\/329\/161\/aee329161dfa60888b62aa05e3d222d3.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438: <a href=\"https:\/\/github.com\/facebookresearch\/hydra\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/github.com\/facebookresearch\/hydra<\/u><\/a><u><br \/><\/u>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f: <a href=\"https:\/\/hydra.cc\/docs\/intro\/\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/hydra.cc\/docs\/intro\/<\/u><\/a><\/p>\n<p>Hydra \u044d\u0442\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0434 ML-\u043f\u0440\u043e\u0435\u043a\u0442\u044b.<\/p>\n<p>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b: \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443. \u041d\u043e \u043d\u0435 \u0432\u0441\u0435 \u0442\u0430\u043a \u0433\u043b\u0430\u0434\u043a\u043e. \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u0412\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0438 \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u043f\u0438\u044e \u0444\u0430\u0439\u043b\u0430 \u0441 \u043d\u043e\u0432\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u0438 \u043e\u0447\u0435\u043d\u044c \u0441\u043a\u043e\u0440\u043e \u0432\u0430\u0448\u0430 \u043f\u0430\u043f\u043a\u0430 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 \u043c\u0443\u0441\u043e\u0440\u043a\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u0442\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u041a\u0430\u043a \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043e\u0434\u0438\u043d \u043a\u043e\u043d\u0444\u0438\u0433-\u0444\u0430\u0439\u043b, \u043d\u043e \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0433\u043e \u0442\u0440\u0443\u0434\u043d\u043e \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c. \u0418\u043b\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0430\u0437\u043d\u0435\u0441\u0442\u0438 \u0438\u0445 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438, \u0441 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0431\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438, \u0447\u0442\u043e \u0432\u0441\u043a\u043e\u0440\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c. \u041f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u043e\u0433\u043e \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a-\u0442\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u0445 \u0432\u044b\u0437\u043e\u0432 \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0435 \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b (\u0438 \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0435) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0435\u0448\u0438\u0442\u044c Hydra. \u0415\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p>\u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/p>\n<\/li>\n<li>\n<p>\u0418 \u043f\u0440.<\/p>\n<\/li>\n<\/ul>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0432\u0441\u0435 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041d\u043e \u043d\u0430\u0447\u043d\u0435\u043c \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438\u2026<\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/h2>\n<p>\u0422\u0443\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e. \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435:<\/p>\n<pre><code class=\"bash\">pip install hydra-core --upgrade<\/code><\/pre>\n<blockquote>\n<p>\u0412\u043c\u0435\u0441\u0442\u0435 \u0441 \u0433\u0438\u0434\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 OmegaConf, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u0444\u043e\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0433\u0438\u0434\u0440\u043e\u0439. OmegaConf \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 YAML. \u0418\u043c\u0435\u043d\u043d\u043e \u0432 YAML \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0434\u043b\u044f \u0433\u0438\u0434\u0440\u044b.<\/p>\n<\/blockquote>\n<h2>\u041d\u0430\u0447\u0430\u043b\u043e<\/h2>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0430\u043c\u044b\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u043c \u0433\u0438\u0434\u0440\u0443. <br \/>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c ML-\u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439:<\/p>\n<pre><code>config - config.yaml app.py df.csv<\/code><\/pre>\n<p>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<pre><code class=\"yaml\">#config.yaml model: lgbm params: \u00a0learning_rate: 0.05 \u00a0n_estimators: 100 \u00a0max_depth: 9<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0444\u0438\u0433, \u0438 \u0437\u0430\u0434\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0435\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"python\">#app.py import hydra import pandas as pd from omegaconf import OmegaConf, DictConfig from sklearn.model_selection import train_test_split from sklearn.metrics import mean_squared_error from lightgbm import LGBMRegressor import logging log = logging.getLogger(__name__)   @hydra.main(version_base=None, config_path='config', config_name='config') def my_app(cfg: DictConfig):     print(OmegaConf.to_yaml(cfg))          # \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435     df = pd.read_csv('df.csv')     X = df.drop(columns='target')     y = df['target']      # \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0442\u0440\u0435\u0439\u043d\/\u0442\u0435\u0441\u0442     X_train, X_test, y_train, y_test = train_test_split(         X, y, test_size=0.30, random_state=42)      # \u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438     model = LGBMRegressor()     lgbm_params = OmegaConf.to_container(cfg['params'])     model.set_params(**lgbm_params)     model.fit(X_train, y_train)          # \u041e\u0446\u0435\u043d\u043a\u0430     y_pred = model.predict(X_test)     mse = round(mean_squared_error(y_test, y_pred), 2)     log.info(f'MSE: {mse}')  if __name__ == \"__main__\":     my_app()<\/code><\/pre>\n<p>\u0427\u0442\u043e \u043c\u044b \u0442\u0443\u0442 \u0434\u0435\u043b\u0430\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u0430 @hydra.main \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0438\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0438 \u0434\u0435\u043b\u0438\u043c \u0435\u0433\u043e \u043d\u0430 \u0442\u0440\u0435\u0439\u043d \u0438 \u0442\u0435\u0441\u0442.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u0443\u0447\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u044b \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 DictConfig \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 Dict, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u0435\u0433\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 set_params.<\/p>\n<\/li>\n<li>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u043a\u043e\u0440. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u044b\u0432\u043e\u0434 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0434\u0443\u043b\u044c logger \u2212 \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u2212 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 logger \u0431\u0443\u0434\u0443\u0442 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0433\u0438\u0434\u0440\u043e\u0439 (\u0443\u0432\u0438\u0434\u0438\u043c \u0434\u0430\u043b\u044c\u0448\u0435). \u041e\u0431\u044b\u0447\u043d\u044b\u0439 print \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0417.\u042b. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u043a\u0430\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445:<\/p>\n<pre><code class=\"yaml\">server:   ip: \"127.0.0.1\"   port: \"8080\"   address: \"${server.ip}:${server.port}\"<\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u0438 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0433\u0438\u0434\u0440\u044b&#8230;<\/p>\n<blockquote>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442 DictConfig, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u043f\u0438\u0442\u043e\u043d\u0430, \u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c). \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u044f\u0445 DictConfig \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438: <a href=\"https:\/\/omegaconf.readthedocs.io\/en\/latest\/usage.html#access-and-manipulation\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/omegaconf.readthedocs.io\/en\/latest\/usage.html#access-and-manipulation<\/u><\/a><\/p>\n<\/blockquote>\n<h2>\u041b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h2>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435:<\/p>\n<pre><code>> python3 app.py model: lgbm params: \u00a0\u00a0learning_rate: 0.05 \u00a0\u00a0n_estimators: 100 \u00a0\u00a0max_depth: 9  [2022-10-31 19:53:29,960][main][INFO] - MSE: 2948.27<\/code><\/pre>\n<p>\u0421\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043f\u0430\u043f\u043a\u0430 outputs, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 hydra \u0431\u0443\u0434\u0435\u0442 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0438. \u041a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435: outputs\/YYYY-mm-dd\/HH-MM-SS<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2a2\/4a4\/974\/2a24a497411d1b19748daecb3f6c5bec.png\" width=\"223\" height=\"226\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2a2\/4a4\/974\/2a24a497411d1b19748daecb3f6c5bec.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0439\u0434\u0435\u043c \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0438 \u0437\u0430\u043d\u043e\u0432\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443. \u0412\u0443\u0430\u043b\u044f \u2212 \u0443 \u043d\u0430\u0441 \u043d\u043e\u0432\u0430\u044f \u043f\u0430\u043f\u043a\u0430 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043b\u043e\u0433\u0430\u043c\u0438.\u00a0<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2f9\/423\/b24\/2f9423b24622e1cf27ac1bc1abc8fdd0.png\" width=\"166\" height=\"272\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2f9\/423\/b24\/2f9423b24622e1cf27ac1bc1abc8fdd0.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u043a\u0430\u043a\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a \u043a\u0430\u043a \u0443 \u0432\u0430\u0441 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u0430\u044f \u043a\u043e\u043f\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<blockquote>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 \u043b\u043e\u0433\u043e\u0432:<\/p>\n<p><code>> python3 app.py hydra.run.dir=my_folder<\/code><\/p>\n<\/blockquote>\n<p>\u0427\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u044d\u0442\u0438 \u043b\u043e\u0433\u0438:<\/p>\n<ul>\n<li>\n<p>config.yaml \u2014 \u043a\u043e\u043f\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0447\u0435\u0440\u0435\u0437 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>hydra.yaml \u2014 \u043a\u043e\u043f\u0438\u044f \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 Hydra.<\/p>\n<\/li>\n<li>\n<p>overrides.yaml \u2014 \u043a\u043e\u043f\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0442 \u043e\u0434\u043d\u043e \u0438\u0437 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433 \u0444\u0430\u0439\u043b\u0430 (\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0434\u0430\u043b\u0435\u0435).<\/p>\n<\/li>\n<li>\n<p>&lt;file_name>.log \u2014 \u0437\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0434\u0443\u043b\u044c<a href=\"https:\/\/docs.python.org\/3\/library\/logging.html\" rel=\"noopener noreferrer nofollow\"> <u>logging<\/u><\/a>.<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u043b\u043e\u0433 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 info \u0438 warning, \u043d\u043e \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 debug:<\/p>\n<p><code>> python3 app.py hydra.verbose=true<\/code><\/p>\n<\/blockquote>\n<h2>\u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435:<\/p>\n<pre><code>> python3 app.py params.max_depth=11 model: lgbm params: \u00a0\u00a0learning_rate: 0.05 \u00a0\u00a0n_estimators: 100 \u00a0\u00a0max_depth: 11  [2022-10-31 21:40:13,889][main][INFO] - MSE: 2943.45<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043b\u043e\u0433\u0435 &#8212; overrides.yaml.<\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u043e\u0433\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435, \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435:<\/p>\n<pre><code>> python3 app.py +params.reg_alpha=0.5 > python3 app.py ~params.n_estimators<\/code><\/pre>\n<h2>\u0413\u0440\u0443\u043f\u043f\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439<\/h2>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u0438\u0437\u043e\u0431\u0440\u0435\u043b\u0438 \u0440\u044f\u0434 \u0444\u0438\u0447\u0435\u0439 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0438\u0445 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438. \u0418 \u0442\u0443\u0442 \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0413\u0440\u0443\u043f\u043f\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u041f\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u201c\u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b\u201d \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0418\u0437\u043c\u0435\u043d\u0438\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 config \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0443 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430:<\/p>\n<pre><code>config - dataset   - ds1.yaml   - ds2.yaml - config.yaml app.py df.csv<\/code><\/pre>\n<p>config.yaml \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0436\u043d\u0435\u043c, \u0430 \u0432\u043e\u0442 \u0434\u0432\u0430 \u043d\u043e\u0432\u044b\u0445 YAML \u0444\u0430\u0439\u043b\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"yaml\">#ds1.yaml name: ds1 columns: [age,bp,s1,s2,s5,s6] target: target<\/code><\/pre>\n<pre><code class=\"yaml\">#ds2.yaml name: ds2 columns: [sex,bmi,s3,s4] target: target<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0431\u0440\u0430\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043e\u043b\u043e\u043d\u043a\u0430\u0445 \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0430:<\/p>\n<pre><code class=\"python\"># \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 df = pd.read_csv('df.csv') X = df[cfg['dataset']['columns']] y = df[cfg['dataset']['target']]<\/code><\/pre>\n<blockquote>\n<p>\u041a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<p><code>cfg.dataset.image.channels<\/code><\/p>\n<p><code>cfg['dataset']['classes']<\/code><\/p>\n<\/blockquote>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c:<\/p>\n<pre><code>> python3 app.py dataset=ds1 dataset: \u00a0\u00a0name: ds1 \u00a0\u00a0columns: \u00a0\u00a0- age \u00a0\u00a0- bp \u00a0\u00a0- s1 \u00a0\u00a0- s2 \u00a0\u00a0- s5 \u00a0\u00a0- s6 \u00a0\u00a0target: target model: lgbm params: \u00a0\u00a0learning_rate: 0.05 \u00a0\u00a0n_estimators: 100 \u00a0\u00a0max_depth: 9  [2022-10-31 22:15:28,575][main][INFO] - MSE: 3580.19<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c, \u0445\u043e\u0442\u044f \u043d\u0430\u0448\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u044b, \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043e\u0434\u0438\u043d \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433.<\/p>\n<p>\u041d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438:<\/p>\n<pre><code class=\"yaml\">#config.yaml defaults:  - dataset: ds1  model: lgbm params:   learning_rate: 0.05   n_estimators: 100   max_depth: 9<\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043f\u043e\u0432\u044b\u0445 \u201c\u043c\u043e\u0434\u0443\u043b\u0435\u0439\u201d,  \u0434\u043b\u044f \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0420\u0430\u0437\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043c\u043e\u0434\u0435\u043b\u0435\u0439 (AlexNet, ResNet50).<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u043d\u044b\u0435 \u043d\u0430\u0431\u043e\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u043d\u044b\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u043d\u044b\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0418 \u043a\u0443\u0447\u0430 \u0432\u0441\u0435\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e\u2026<\/p>\n<\/li>\n<\/ul>\n<h2>Multirun<\/h2>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043c\u044b \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0430\u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u043b\u0438 \u043a\u0443\u0447\u0443 \u201c\u043c\u043e\u0434\u0443\u043b\u0435\u0439\u201d. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445 \u043f\u043e\u00a0 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u044f \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u2212 \u0443\u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0433\u0438\u0434\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 multirun:<\/p>\n<pre><code>> python3 app.py -m dataset=ds1,ds2 [2022-10-31 22:48:22,886][HYDRA] Launching 2 jobs locally [2022-10-31 22:48:22,886][HYDRA]\u00a0 \u00a0 \u00a0\u00a0\u00a0 #0 : dataset=ds1 ... [2022-10-31 22:48:25,233][main][INFO] - MSE: 3580.19 [2022-10-31 22:48:25,234][HYDRA]\u00a0 \u00a0 \u00a0\u00a0\u00a0 #1 : dataset=ds2 ... [2022-10-31 22:48:25,656][main][INFO] - MSE: 3414.61<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0431\u0440\u0430\u0442\u044c \u0434\u0432\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0434\u043b\u044f \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430. \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d \u0441 \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u043c \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u043d\u0430 \u0432\u0445\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. \u0415\u0441\u043b\u0438 \u0431\u044b \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u0438 \u0435\u0449\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0442\u043e \u0433\u0438\u0434\u0440\u0430 \u0431\u044b \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0430 \u0432\u0441\u0435 \u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438 \u043c\u0443\u043b\u044c\u0442\u0438-\u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043b\u043e\u0433\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 multirun, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u043c\u0438\u043c\u043e \u0434\u0430\u0442\u044b \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0430 (\u0441 \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u044b\u043c \u043d\u043e\u043c\u0435\u0440\u043e\u043c) \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u044f.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/07c\/042\/c26\/07c042c266e2436f9b27351850b7f8a9.png\" width=\"230\" height=\"362\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/07c\/042\/c26\/07c042c266e2436f9b27351850b7f8a9.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0411\u0430\u0437\u043e\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f multirun \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u0434 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0443\u0437\u043b\u0430\u0445:<\/p>\n<ul>\n<li>\n<p>Joblib: <a href=\"https:\/\/hydra.cc\/docs\/plugins\/joblib_launcher\" rel=\"noopener noreferrer nofollow\">https:\/\/hydra.cc\/docs\/plugins\/joblib_launcher<\/a><\/p>\n<\/li>\n<li>\n<p>Ray: <a href=\"https:\/\/hydra.cc\/docs\/plugins\/ray_launcher\" rel=\"noopener noreferrer nofollow\">https:\/\/hydra.cc\/docs\/plugins\/ray_launcher<\/a><\/p>\n<\/li>\n<li>\n<p>RQ: <a href=\"https:\/\/hydra.cc\/docs\/plugins\/rq_launcher\" rel=\"noopener noreferrer nofollow\">https:\/\/hydra.cc\/docs\/plugins\/rq_launcher<\/a><\/p>\n<\/li>\n<li>\n<p>Submitit <a href=\"https:\/\/hydra.cc\/docs\/plugins\/submitit_launcher\" rel=\"noopener noreferrer nofollow\">https:\/\/hydra.cc\/docs\/plugins\/submitit_launcher<\/a><\/p>\n<\/li>\n<\/ul>\n<h2>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432<\/h2>\n<p>\u0423\u0441\u043b\u043e\u0436\u043d\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438. \u041d\u043e \u043c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u044d\u0442\u043e \u043a\u0430\u043a-\u0442\u043e \u043e\u0431\u044b\u0433\u0440\u044b\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u0434\u0435 \u2212 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0445\u043e\u0442\u0438\u043c \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0430\u0448\u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043d\u043e\u0432\u0443\u044e \u043f\u0430\u043f\u043a\u0443 model \u0438 \u0434\u0432\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u043f\u043e\u0434 \u0434\u0432\u0435 \u043c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<pre><code>config - dataset   - ds1.yaml   - ds2.yaml - model   - catboost.yaml   - lgbm.yaml - config.yaml app.py df.csv<\/code><\/pre>\n<p>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043d\u043e\u0432\u044b\u0445 YAML-\u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<pre><code class=\"yaml\">#catboost.yaml _target_: catboost.CatBoostRegressor learning_rate: 0.05 n_estimators: 100 max_depth: 9 silent: True<\/code><\/pre>\n<pre><code class=\"yaml\">#lgbm.yaml _target_: lightgbm.LGBMRegressor learning_rate: 0.05 n_estimators: 100 max_depth: 9 verbose: -1<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 _target_ \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u043e\u0442\u0438\u043c \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 (\u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e). \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 \u0443\u0440\u043e\u0432\u043d\u0435, \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u043a\u0430\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<p>\u041f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u043a\u043e\u0434 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<pre><code class=\"python\">... from hydra.utils import instantiate ...      # \u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438     model = instantiate(cfg['model'])     model.fit(X_train, y_train)  ...<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e hydra.utils.instantiate, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043c\u043e\u0434\u0435\u043b\u0438, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435. \u0412 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434 \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u043f\u0440\u0435\u0436\u043d\u0435\u043c.<\/p>\n<p>\u0423\u043a\u0430\u0436\u0435\u043c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0432 \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u0438 \u0443\u0431\u0435\u0440\u0435\u043c \u043e\u0442\u0442\u0443\u0434\u0430 \u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<pre><code>defaults:  - dataset: ds1  - model: lgbm<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c:<\/p>\n<pre><code>> python3 app.py dataset: \u00a0\u00a0name: ds1 \u00a0\u00a0columns: \u00a0\u00a0- age \u00a0\u00a0- bp \u00a0\u00a0- s1 \u00a0\u00a0- s2 \u00a0\u00a0- s5 \u00a0\u00a0- s6 \u00a0\u00a0target: target model: \u00a0\u00a0target: lightgbm.LGBMRegressor \u00a0\u00a0learning_rate: 0.05 \u00a0\u00a0n_estimators: 100 \u00a0\u00a0max_depth: 9  [2022-11-01 11:30:49,648][main][INFO] - MSE: 3580.19<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0433\u0438\u0434\u0440\u0430 \u0432\u0437\u044f\u043b\u0430 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438. \u0418 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u0443\u043b\u044c\u0442\u0438\u0440\u0430\u043d \u043d\u0430 \u0432\u0441\u0435\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c:<\/p>\n<pre><code>> python3 app.py -m dataset=ds1,ds2 model=catboost,lgbm [2022-11-01 12:33:16,334][HYDRA] Launching 4 jobs locally [2022-11-01 12:33:16,334][HYDRA]\u00a0 \u00a0 \u00a0\u00a0\u00a0 #0 : dataset=ds1 model=catboost ... [2022-11-01 12:33:17,089][main][INFO] - MSE: 3295.95 [2022-11-01 12:33:17,090][HYDRA]\u00a0 \u00a0 \u00a0\u00a0\u00a0 #1 : dataset=ds1 model=lgbm ... [2022-11-01 12:33:17,652][main][INFO] - MSE: 3580.19 [2022-11-01 12:33:17,653][HYDRA]\u00a0 \u00a0 \u00a0\u00a0\u00a0 #2 : dataset=ds2 model=catboost ... [2022-11-01 12:33:17,863][main][INFO] - MSE: 3330.02 [2022-11-01 12:33:17,864][HYDRA]\u00a0 \u00a0 \u00a0\u00a0\u00a0 #3 : dataset=ds2 model=lgbm ... [2022-11-01 12:33:18,124][main][INFO] - MSE: 3414.61<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0433\u0438\u0434\u0440\u0430 \u043f\u0435\u0440\u0435\u0431\u0440\u0430\u043b\u0430 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438.<\/p>\n<h2>Jupyter Notebook<\/h2>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043d\u0430\u0448 \u043a\u043e\u043d\u0444-\u0444\u0430\u0439\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u044f\u0447\u0435\u0439\u043a\u0435 Jupyter Notebook. \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c Compose API \u2212 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">from hydra import initialize, compose from omegaconf import OmegaConf  with initialize(version_base=None, config_path=\"cloud_app\/conf\"): \u00a0\u00a0\u00a0\u00a0cfg = compose(overrides=[\"+db=mysql\"]) \u00a0\u00a0\u00a0\u00a0print(cfg)<\/code><\/pre>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438: <a href=\"https:\/\/hydra.cc\/docs\/advanced\/compose_api\/\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/hydra.cc\/docs\/advanced\/compose_api\/<\/u><\/a><\/p>\n<h2>\u041f\u0440\u043e\u0447\u0435\u0435<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0447\u0430\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0433\u0438\u0434\u0440\u044b. \u0421 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0441\u044f \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u0432\u043a\u043b\u0430\u0434\u043e\u043a: <a href=\"https:\/\/hydra.cc\/docs\/0.11\/tutorial\/tab_completion\/\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/hydra.cc\/docs\/0.11\/tutorial\/tab_completion\/<\/u><\/a><\/p>\n<\/li>\n<li>\n<p>\u0422\u043e\u043d\u043a\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f: <a href=\"https:\/\/hydra.cc\/docs\/0.11\/configure_hydra\/logging\/\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/hydra.cc\/docs\/0.11\/configure_hydra\/logging\/<\/u><\/a><\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0433\u0438\u0434\u0440\u044b \u0432 \u0432\u0430\u0448 \u043f\u0438\u0442\u043e\u043d \u043f\u0430\u043a\u0435\u0442: <a href=\"https:\/\/hydra.cc\/docs\/advanced\/app_packaging\/\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/hydra.cc\/docs\/advanced\/app_packaging\/<\/u><\/a><\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430: <a href=\"https:\/\/hydra.cc\/docs\/configure_hydra\/intro\/\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/hydra.cc\/docs\/configure_hydra\/intro\/<\/u><\/a><\/p>\n<\/li>\n<li>\n<p>\u0418 \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u0435\u0449\u0435\u2026<\/p>\n<\/li>\n<\/ul>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>\u041a\u043e\u0434 \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438: <a href=\"https:\/\/github.com\/slivka83\/article\/tree\/main\/hydra\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/slivka83\/article\/tree\/main\/hydra<\/a><\/p>\n<p><a href=\"https:\/\/t.me\/ds_private_sharing\" rel=\"noopener noreferrer nofollow\">\u041c\u043e\u0439 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u043a\u0430\u043d\u0430\u043b<\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/696820\/\"> https:\/\/habr.com\/ru\/post\/696820\/<\/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<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438: <a href=\"https:\/\/github.com\/facebookresearch\/hydra\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/github.com\/facebookresearch\/hydra<\/u><\/a><u><br \/><\/u>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f: <a href=\"https:\/\/hydra.cc\/docs\/intro\/\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/hydra.cc\/docs\/intro\/<\/u><\/a><\/p>\n<p>Hydra \u044d\u0442\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0434 ML-\u043f\u0440\u043e\u0435\u043a\u0442\u044b.<\/p>\n<p>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b: \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443. \u041d\u043e \u043d\u0435 \u0432\u0441\u0435 \u0442\u0430\u043a \u0433\u043b\u0430\u0434\u043a\u043e. \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u0412\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0438 \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u043f\u0438\u044e \u0444\u0430\u0439\u043b\u0430 \u0441 \u043d\u043e\u0432\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u0438 \u043e\u0447\u0435\u043d\u044c \u0441\u043a\u043e\u0440\u043e \u0432\u0430\u0448\u0430 \u043f\u0430\u043f\u043a\u0430 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 \u043c\u0443\u0441\u043e\u0440\u043a\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u0442\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u041a\u0430\u043a \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043e\u0434\u0438\u043d \u043a\u043e\u043d\u0444\u0438\u0433-\u0444\u0430\u0439\u043b, \u043d\u043e \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0433\u043e \u0442\u0440\u0443\u0434\u043d\u043e \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c. \u0418\u043b\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0430\u0437\u043d\u0435\u0441\u0442\u0438 \u0438\u0445 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438, \u0441 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0431\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438, \u0447\u0442\u043e \u0432\u0441\u043a\u043e\u0440\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c. \u041f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u043e\u0433\u043e \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a-\u0442\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u0445 \u0432\u044b\u0437\u043e\u0432 \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0435 \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b (\u0438 \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0435) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0435\u0448\u0438\u0442\u044c Hydra. \u0415\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p>\u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/p>\n<\/li>\n<li>\n<p>\u0418 \u043f\u0440.<\/p>\n<\/li>\n<\/ul>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0432\u0441\u0435 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041d\u043e \u043d\u0430\u0447\u043d\u0435\u043c \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438\u2026<\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/h2>\n<p>\u0422\u0443\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e. \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435:<\/p>\n<pre><code class=\"bash\">pip install hydra-core --upgrade<\/code><\/pre>\n<blockquote>\n<p>\u0412\u043c\u0435\u0441\u0442\u0435 \u0441 \u0433\u0438\u0434\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 OmegaConf, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u0444\u043e\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0433\u0438\u0434\u0440\u043e\u0439. OmegaConf \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 YAML. \u0418\u043c\u0435\u043d\u043d\u043e \u0432 YAML \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0434\u043b\u044f \u0433\u0438\u0434\u0440\u044b.<\/p>\n<\/blockquote>\n<h2>\u041d\u0430\u0447\u0430\u043b\u043e<\/h2>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0430\u043c\u044b\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u043c \u0433\u0438\u0434\u0440\u0443. <br \/>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c ML-\u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439:<\/p>\n<pre><code>config - config.yaml app.py df.csv<\/code><\/pre>\n<p>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<pre><code class=\"yaml\">#config.yaml model: lgbm params: \u00a0learning_rate: 0.05 \u00a0n_estimators: 100 \u00a0max_depth: 9<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0444\u0438\u0433, \u0438 \u0437\u0430\u0434\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0435\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"python\">#app.py import hydra import pandas as pd from omegaconf import OmegaConf, DictConfig from sklearn.model_selection import train_test_split from sklearn.metrics import mean_squared_error from lightgbm import LGBMRegressor import logging log = logging.getLogger(__name__)   @hydra.main(version_base=None, config_path='config', config_name='config') def my_app(cfg: DictConfig):     print(OmegaConf.to_yaml(cfg))          # \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435     df = pd.read_csv('df.csv')     X = df.drop(columns='target')     y = df['target']      # \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0442\u0440\u0435\u0439\u043d\/\u0442\u0435\u0441\u0442     X_train, X_test, y_train, y_test = train_test_split(         X, y, test_size=0.30, random_state=42)      # \u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438     model = LGBMRegressor()     lgbm_params = OmegaConf.to_container(cfg['params'])     model.set_params(**lgbm_params)     model.fit(X_train, y_train)          # \u041e\u0446\u0435\u043d\u043a\u0430     y_pred = model.predict(X_test)     mse = round(mean_squared_error(y_test, y_pred), 2)     log.info(f'MSE: {mse}')  if __name__ == \"__main__\":     my_app()<\/code><\/pre>\n<p>\u0427\u0442\u043e \u043c\u044b \u0442\u0443\u0442 \u0434\u0435\u043b\u0430\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u0430 @hydra.main \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0438\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0438 \u0434\u0435\u043b\u0438\u043c \u0435\u0433\u043e \u043d\u0430 \u0442\u0440\u0435\u0439\u043d \u0438 \u0442\u0435\u0441\u0442.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u0443\u0447\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u044b \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 DictConfig \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 Dict, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u0435\u0433\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 set_params.<\/p>\n<\/li>\n<li>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u043a\u043e\u0440. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u044b\u0432\u043e\u0434 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0434\u0443\u043b\u044c logger \u2212 \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u2212 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 logger \u0431\u0443\u0434\u0443\u0442 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0433\u0438\u0434\u0440\u043e\u0439 (\u0443\u0432\u0438\u0434\u0438\u043c \u0434\u0430\u043b\u044c\u0448\u0435). \u041e\u0431\u044b\u0447\u043d\u044b\u0439 print \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0417.\u042b. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u043a\u0430\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445:<\/p>\n<pre><code class=\"yaml\">server:   ip: \"127.0.0.1\"   port: \"8080\"   address: \"${server.ip}:${server.port}\"<\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u0438 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0433\u0438\u0434\u0440\u044b&#8230;<\/p>\n<blockquote>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442 DictConfig, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u043f\u0438\u0442\u043e\u043d\u0430, \u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c). \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u044f\u0445 DictConfig \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438: <a href=\"https:\/\/omegaconf.readthedocs.io\/en\/latest\/usage.html#access-and-manipulation\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/omegaconf.readthedocs.io\/en\/latest\/usage.html#access-and-manipulation<\/u><\/a><\/p>\n<\/blockquote>\n<h2>\u041b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h2>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435:<\/p>\n<pre><code>> python3 app.py model: lgbm params: \u00a0\u00a0learning_rate: 0.05 \u00a0\u00a0n_estimators: 100 \u00a0\u00a0max_depth: 9  [2022-10-31 19:53:29,960][main][INFO] - MSE: 2948.27<\/code><\/pre>\n<p>\u0421\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043f\u0430\u043f\u043a\u0430 outputs, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 hydra \u0431\u0443\u0434\u0435\u0442 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0438. \u041a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435: outputs\/YYYY-mm-dd\/HH-MM-SS<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0439\u0434\u0435\u043c \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0438 \u0437\u0430\u043d\u043e\u0432\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443. \u0412\u0443\u0430\u043b\u044f \u2212 \u0443 \u043d\u0430\u0441 \u043d\u043e\u0432\u0430\u044f \u043f\u0430\u043f\u043a\u0430 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043b\u043e\u0433\u0430\u043c\u0438.\u00a0<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u043a\u0430\u043a\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a \u043a\u0430\u043a \u0443 \u0432\u0430\u0441 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u0430\u044f \u043a\u043e\u043f\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<blockquote>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 \u043b\u043e\u0433\u043e\u0432:<\/p>\n<p><code>> python3 app.py hydra.run.dir=my_folder<\/code><\/p>\n<\/blockquote>\n<p>\u0427\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u044d\u0442\u0438 \u043b\u043e\u0433\u0438:<\/p>\n<ul>\n<li>\n<p>config.yaml \u2014 \u043a\u043e\u043f\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0447\u0435\u0440\u0435\u0437 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>hydra.yaml \u2014 \u043a\u043e\u043f\u0438\u044f \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 Hydra.<\/p>\n<\/li>\n<li>\n<p>overrides.yaml \u2014 \u043a\u043e\u043f\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0442 \u043e\u0434\u043d\u043e \u0438\u0437 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433 \u0444\u0430\u0439\u043b\u0430 (\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0434\u0430\u043b\u0435\u0435).<\/p>\n<\/li>\n<li>\n<p>&lt;file_name>.log \u2014 \u0437\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0434\u0443\u043b\u044c<a href=\"https:\/\/docs.python.org\/3\/library\/logging.html\" rel=\"noopener noreferrer nofollow\"> <u>logging<\/u><\/a>.<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u043b\u043e\u0433 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 info \u0438 warning, \u043d\u043e \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 debug:<\/p>\n<p><code>> python3 app.py hydra.verbose=true<\/code><\/p>\n<\/blockquote>\n<h2>\u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435:<\/p>\n<pre><code>> python3 app.py params.max_depth=11 model: lgbm params: \u00a0\u00a0learning_rate: 0.05 \u00a0\u00a0n_estimators: 100 \u00a0\u00a0max_depth: 11  [2022-10-31 21:40:13,889][main][INFO] - MSE: 2943.45<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043b\u043e\u0433\u0435 &#8212; overrides.yaml.<\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u043e\u0433\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435, \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435:<\/p>\n<pre><code>> python3 app.py +params.reg_alpha=0.5 > python3 app.py ~params.n_estimators<\/code><\/pre>\n<h2>\u0413\u0440\u0443\u043f\u043f\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439<\/h2>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u0438\u0437\u043e\u0431\u0440\u0435\u043b\u0438 \u0440\u044f\u0434 \u0444\u0438\u0447\u0435\u0439 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0438\u0445 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438. \u0418 \u0442\u0443\u0442 \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0413\u0440\u0443\u043f\u043f\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u041f\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u201c\u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b\u201d \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0418\u0437\u043c\u0435\u043d\u0438\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 config \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0443 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430:<\/p>\n<pre><code>config - dataset   - ds1.yaml   - ds2.yaml - config.yaml app.py df.csv<\/code><\/pre>\n<p>config.yaml \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0436\u043d\u0435\u043c, \u0430 \u0432\u043e\u0442 \u0434\u0432\u0430 \u043d\u043e\u0432\u044b\u0445 YAML \u0444\u0430\u0439\u043b\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"yaml\">#ds1.yaml name: ds1 columns: [age,bp,s1,s2,s5,s6] target: target<\/code><\/pre>\n<pre><code class=\"yaml\">#ds2.yaml name: ds2 columns: [sex,bmi,s3,s4] target: target<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0431\u0440\u0430\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043e\u043b\u043e\u043d\u043a\u0430\u0445 \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0430:<\/p>\n<pre><code class=\"python\"># \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 df = pd.read_csv('df.csv') X = df[cfg['dataset']['columns']] y = df[cfg['dataset']['target']]<\/code><\/pre>\n<blockquote>\n<p>\u041a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<p><code>cfg.dataset.image.channels<\/code><\/p>\n<p><code>cfg['dataset']['classes']<\/code><\/p>\n<\/blockquote>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c:<\/p>\n<pre><code>> python3 app.py dataset=ds1 dataset: \u00a0\u00a0name: ds1 \u00a0\u00a0columns: \u00a0\u00a0- age \u00a0\u00a0- bp \u00a0\u00a0- s1 \u00a0\u00a0- s2 \u00a0\u00a0- s5 \u00a0\u00a0- s6 \u00a0\u00a0target: target model: lgbm params: \u00a0\u00a0learning_rate: 0.05 \u00a0\u00a0n_estimators: 100 \u00a0\u00a0max_depth: 9  [2022-10-31 22:15:28,575][main][INFO] - MSE: 3580.19<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c, \u0445\u043e\u0442\u044f \u043d\u0430\u0448\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u044b, \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043e\u0434\u0438\u043d \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433.<\/p>\n<p>\u041d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438:<\/p>\n<pre><code class=\"yaml\">#config.yaml defaults:  - dataset: ds1  model: lgbm params:   learning_rate: 0.05   n_estimators: 100   max_depth: 9<\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043f\u043e\u0432\u044b\u0445 \u201c\u043c\u043e\u0434\u0443\u043b\u0435\u0439\u201d,  \u0434\u043b\u044f \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0420\u0430\u0437\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043c\u043e\u0434\u0435\u043b\u0435\u0439 (AlexNet, ResNet50).<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u043d\u044b\u0435 \u043d\u0430\u0431\u043e\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u043d\u044b\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u043d\u044b\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0418 \u043a\u0443\u0447\u0430 \u0432\u0441\u0435\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e\u2026<\/p>\n<\/li>\n<\/ul>\n<h2>Multirun<\/h2>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043c\u044b \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0430\u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u043b\u0438 \u043a\u0443\u0447\u0443 \u201c\u043c\u043e\u0434\u0443\u043b\u0435\u0439\u201d. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445 \u043f\u043e\u00a0 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u044f \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u2212 \u0443\u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0433\u0438\u0434\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 multirun:<\/p>\n<pre><code>> python3 app.py -m dataset=ds1,ds2 [2022-10-31 22:48:22,886][HYDRA] Launching 2 jobs locally [2022-10-31 22:48:22,886][HYDRA]\u00a0 \u00a0 \u00a0\u00a0\u00a0 #0 : dataset=ds1 ... [2022-10-31 22:48:25,233][main][INFO] - MSE: 3580.19 [2022-10-31 22:48:25,234][HYDRA]\u00a0 \u00a0 \u00a0\u00a0\u00a0 #1 : dataset=ds2 ... [2022-10-31 22:48:25,656][main][INFO] - MSE: 3414.61<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0431\u0440\u0430\u0442\u044c \u0434\u0432\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0434\u043b\u044f \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430. \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d \u0441 \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u043c \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u043d\u0430 \u0432\u0445\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. \u0415\u0441\u043b\u0438 \u0431\u044b \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u0438 \u0435\u0449\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0442\u043e \u0433\u0438\u0434\u0440\u0430 \u0431\u044b \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0430 \u0432\u0441\u0435 \u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438 \u043c\u0443\u043b\u044c\u0442\u0438-\u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043b\u043e\u0433\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 multirun, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u043c\u0438\u043c\u043e \u0434\u0430\u0442\u044b \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0430 (\u0441 \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u044b\u043c \u043d\u043e\u043c\u0435\u0440\u043e\u043c) \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u044f.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0411\u0430\u0437\u043e\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f multirun \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u0434 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0443\u0437\u043b\u0430\u0445:<\/p>\n<ul>\n<li>\n<p>Joblib: <a href=\"https:\/\/hydra.cc\/docs\/plugins\/joblib_launcher\" rel=\"noopener noreferrer nofollow\">https:\/\/hydra.cc\/docs\/plugins\/joblib_launcher<\/a><\/p>\n<\/li>\n<li>\n<p>Ray: <a href=\"https:\/\/hydra.cc\/docs\/plugins\/ray_launcher\" rel=\"noopener noreferrer nofollow\">https:\/\/hydra.cc\/docs\/plugins\/ray_launcher<\/a><\/p>\n<\/li>\n<li>\n<p>RQ: <a href=\"https:\/\/hydra.cc\/docs\/plugins\/rq_launcher\" rel=\"noopener noreferrer nofollow\">https:\/\/hydra.cc\/docs\/plugins\/rq_launcher<\/a><\/p>\n<\/li>\n<li>\n<p>Submitit <a href=\"https:\/\/hydra.cc\/docs\/plugins\/submitit_launcher\" rel=\"noopener noreferrer nofollow\">https:\/\/hydra.cc\/docs\/plugins\/submitit_launcher<\/a><\/p>\n<\/li>\n<\/ul>\n<h2>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432<\/h2>\n<p>\u0423\u0441\u043b\u043e\u0436\u043d\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438. \u041d\u043e \u043c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u044d\u0442\u043e \u043a\u0430\u043a-\u0442\u043e \u043e\u0431\u044b\u0433\u0440\u044b\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u0434\u0435 \u2212 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0445\u043e\u0442\u0438\u043c \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0430\u0448\u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043d\u043e\u0432\u0443\u044e \u043f\u0430\u043f\u043a\u0443 model \u0438 \u0434\u0432\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u043f\u043e\u0434 \u0434\u0432\u0435 \u043c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<pre><code>config - dataset   - ds1.yaml   - ds2.yaml - model   - catboost.yaml   - lgbm.yaml - config.yaml app.py df.csv<\/code><\/pre>\n<p>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043d\u043e\u0432\u044b\u0445 YAML-\u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<pre><code class=\"yaml\">#catboost.yaml _target_: catboost.CatBoostRegressor learning_rate: 0.05 n_estimators: 100 max_depth: 9 silent: True<\/code><\/pre>\n<pre><code class=\"yaml\">#lgbm.yaml _target_: lightgbm.LGBMRegressor learning_rate: 0.05 n_estimators: 100 max_depth: 9 verbose: -1<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 _target_ \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u043e\u0442\u0438\u043c \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438<\/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-340590","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/340590","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=340590"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/340590\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=340590"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=340590"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=340590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}