{"id":299603,"date":"2020-03-03T15:00:21","date_gmt":"2020-03-03T15:00:21","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=299603"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=299603","title":{"rendered":"\u041a\u0430\u043a \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043d\u044b \u043d\u0430 \u0430\u0432\u0438\u0430\u0431\u0438\u043b\u0435\u0442\u044b?"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/490762\/\">\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! <br \/>  \u042d\u0442\u043e \u0442\u0440\u0435\u0442\u044c\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0442\u0430\u043c, \u043a\u0430\u043a \u044f \u0434\u0435\u043b\u0430\u044e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438 \u0443\u044e\u0442\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 <s>\u0432 \u0442\u0435\u043e\u0440\u0438\u0438<\/s> \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043c\u043e\u0447\u044c \u0441 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0439. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u0442\u043e, \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0446\u0435\u043d\u044b \u043d\u0430 \u0430\u0432\u0438\u0430\u0431\u0438\u043b\u0435\u0442\u044b, \u0438\u043c\u0435\u044f \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 Clickhouse, Catboost \u0438 1TB* \u0434\u0430\u043d\u043d\u044b\u0445.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zn\/c5\/vi\/znc5vi1_whqyxeqiyvne_ql96hw.png\" alt=\"image\"><br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>\u0414\u043b\u044f \u0447\u0435\u0433\u043e \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e?<\/h3>\n<p>  \u041e\u0434\u043d\u0430 \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0444\u0438\u0447\u0435\u0439 <a href=\"https:\/\/cheapster.travel\/\" rel=\"nofollow\">cheapster.travel<\/a> \u2014 \u044d\u0442\u043e \u0433\u0438\u0431\u043a\u043e\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0432 <a href=\"https:\/\/habr.com\/ru\/post\/489510\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>). \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u00ab\u0432\u0441\u0435-\u0441\u043e-\u0432\u0441\u0435\u043c\u00bb \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u044d\u0448 \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0440\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0431\u0438\u043b\u0435\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0434\u043a\u043e \u0438\u0449\u0443\u0442, \u0430 \u0438\u0445 \u043a\u0430\u0442\u0430\u0441\u0442\u0440\u043e\u0444\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b. \u0422.\u0435. \u0433\u043e\u0440\u044f\u0447\u0438\u0435 \u0431\u0438\u043b\u0435\u0442\u044b (\u0434\u0435\u0448\u0435\u0432\u044b\u0435) \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 <b>\u0435\u0441\u0442\u044c<\/b>, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 1-2 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0437 \u00ab\u043e\u0431\u044b\u0447\u043d\u044b\u0445\u00bb \u0431\u0438\u043b\u0435\u0442\u043e\u0432 (\u043f\u043e \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0446\u0435\u043d\u0435, \u043d\u0430 \u043d\u0435 \u0441\u0430\u043c\u043e\u043c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438). \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u0438\u0432\u0435\u043b\u0430 \u043c\u0435\u043d\u044f \u043a \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043c\u043e\u0433\u043b\u0430 \u0431\u044b \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0446\u0435\u043d\u044b \u043d\u0430 \u0430\u0432\u0438\u0430\u0431\u0438\u043b\u0435\u0442\u044b.<\/p>\n<h3>\u0424\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438<\/h3>\n<p>  <\/p>\n<ul>\n<li>\u041d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0431\u0438\u043b\u0435\u0442\u044b \u043d\u0430 \u043f\u0440\u044f\u043c\u044b\u0435 \u0440\u0435\u0439\u0441\u044b (\u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0443\u0434\u0430 \u0438\u043b\u0438 \u0442\u0443\u0434\u0430-\u043e\u0431\u0440\u0430\u0442\u043d\u043e)<\/li>\n<li>\u041d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u0442\u044c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u044d\u0442\u043e \u0432 \u0431\u0430\u0437\u0443 (\u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439)<\/li>\n<li>\u041d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u00ab\u043d\u0430 \u043b\u0435\u0442\u0443\u00bb (\u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439)<\/li>\n<li>\u042d\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u043c \u0436\u0435\u043b\u0435\u0437\u0435 \u2014 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u043e\u0431\u044a\u0435\u043c\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<\/ul>\n<h3>\u041a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c?<\/h3>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u0443\u0447\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u044c: \u0433\u043e\u0442\u043e\u0432\u0438\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442, \u0432\u044b\u0434\u0435\u043b\u044f\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0444\u0438\u0447\u0435\u0439 \u0432 \u043a\u043e\u043b\u043e\u043d\u043a\u0438, \u0432\u044b\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0435\u0433\u043e \u0432 tsv, \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0435\u0433\u043e \u0432 DataFrame\/Pool, <s>\u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043c \u0430\u043d\u0430\u043b\u0438\u0437, \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b&#8230;<\/s> \u0421\u0442\u043e\u043f, \u0443 \u043d\u0430\u0441 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043e\u043d\u0438 \u043d\u0435 \u043f\u043e\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u044c, \u2014 \u043b\u043e\u0432\u0438\u043c \u0442\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438:<br \/>  <code>MemoryError: Unable to allocate array with shape (38, 288224989) and data type float64<br \/>  OSError: [Errno 12] Cannot allocate memory<br \/>  <\/code><br \/>  \u0427\u0442\u043e\u0431\u044b \u043e\u0431\u043e\u0439\u0442\u0438 \u044d\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043e\u0431\u0443\u0447\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u043a\u0443\u0441\u043e\u0447\u043a\u0430\u0445, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"python\">model = CatBoostRegressor(cat_features=cat_features,           iterations=100,           learning_rate=.5,           depth=10,           l2_leaf_reg=9,           one_hot_max_size=5000)  for df in tqdm(pd.read_csv('history.tsv', sep='\\t',                             na_values=['\\\\N'],                             chunksize=2_000_000)):     ...      model.fit(X=df[df.columns[:-1]][:train_size].values,                   y=df['price'][:train_size].values,                   eval_set=eval_pool,                   verbose=False,                   plot=False,                   init_model=model) # &lt;-- \u0412 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043f\u043e\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c <\/code><\/pre>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0441 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Root-mean-square_deviation\" rel=\"nofollow\">RMSE<\/a>~100 \u2014 \u0432 \u0446\u0435\u043b\u043e\u043c \u043c\u0435\u043d\u044f \u0431\u044b \u0443\u0441\u0442\u0440\u043e\u0438\u043b \u0438 \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043d\u043e \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u00ab\u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438\u00bb \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0439 (\u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 min\/max \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u0438, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0446\u0435\u043d). \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0446\u0435\u043b\u0435\u0432\u0430\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0430~80, \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u043e \u043c\u043e\u0435\u043c\u0443 \u043e\u043f\u044b\u0442\u0443, \u043b\u043e\u0433\u0438\u043a\u0438 \u0438 \u0437\u0434\u0440\u0430\u0432\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430 \u043f\u0440\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0446\u0435\u043d \u043d\u0430 \u0430\u0432\u0438\u0430\u0431\u0438\u043b\u0435\u0442\u044b \u043f\u043e\u0447\u0442\u0438 \u043d\u0435\u0442.<\/p>\n<p>  \u0424\u0438\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0446\u0435\u043d\u0443:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2g\/pm\/s2\/2gpms2_h9whp0yyh6zx7ugl_t3m.png\" alt=\"image\"><br \/>  \u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0434\u043b\u044f \u0444\u0438\u0447\u0438 \u00ab\u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0433\u043e\u0440\u043e\u0434\u0430\u043c\u0438\u00bb:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hr\/zw\/iq\/hrzwiqej5qmome9d3qtbg4r1qwk.png\" alt=\"image\"><\/p>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u043c\u043e\u0434\u0435\u043b\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u2014 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0440\u0430 \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u041a\u0425, \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u043c:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u043d\u0444\u0438\u0433<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;models&gt;     &lt;model&gt;         &lt;!-- Model type. Now catboost only. --&gt;         &lt;type&gt;catboost&lt;\/type&gt;         &lt;!-- Model name. --&gt;         &lt;name&gt;price&lt;\/name&gt;         &lt;!-- Path to trained model. --&gt;         &lt;path&gt;\/opt\/models\/price_iter_model_2.bin&lt;\/path&gt;         &lt;!-- Update interval. --&gt;         &lt;lifetime&gt;0&lt;\/lifetime&gt;     &lt;\/model&gt; &lt;\/models&gt;<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u0435\u043b\u0430\u0435\u043c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0431\u0430\u0442\u0447\u0435\u0432\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u2014 \u044d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Apache Airflow. <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f DAG \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ky\/yb\/ii\/kyybii8xookvvptuf1asg5ovy0y.png\" alt=\"image\"><br \/>  \u041e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 DAGa \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a(\u0434\u043b\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c \u0441 Airflow):  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">SimpleHttpOperator<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">insert_ow_in_tmp = SimpleHttpOperator(     task_id='insert_ow_in_tmp',     http_conn_id='clickhouse_http',     endpoint=dll_endpoint,     method='POST',     data=sql_templates.INSERT_OW_PREDICTIONS_IN_TMP,     pool='clickhouse_select',     dag=dag )<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u00ab\u043d\u0430 \u043b\u0435\u0442\u0443\u00bb \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0439 sql:  <\/p>\n<pre><code class=\"sql\">select origin, destination, date,          modelEvaluate('price', *)  predicted_price -- \u0434\u0430, \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e from log.history  +--------+-------------+------------+-----------------+ | origin | destination | date       | predicted_price | +--------+-------------+------------+-----------------+ | VKO    | DEB         | 2020-03-20 | 3234.43244      | +--------+-------------+------------+-----------------+ --*\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0449\u0435 \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0441\u044f <\/code><\/pre>\n<p>  \u0425\u043e\u0447\u0443 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432\u044b\u0431\u0440\u0430\u043d, \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0435\u0433\u043e \u043f\u0440\u043e\u0449\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c, \u2014 \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043f\u043b\u044e\u0441\u044b:  <\/p>\n<ul>\n<li>\u041d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u043e \u0432\u043d\u0435 \u041a\u0425 (\u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u043c\u0435\u043d\u0435\u0435 \u0437\u0430\u0442\u0440\u0430\u0442\u043d\u043e \u043f\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043d\u0430 \u0436\u0435\u043b\u0435\u0437\u043e)<\/li>\n<li>\u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c etl-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b (\u043f\u0440\u043e\u0449\u0435=\u043d\u0430\u0434\u0435\u0436\u043d\u0435\u0435)<\/li>\n<\/ul>\n<p>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043c API \u0438 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u043e\u043b\u0433\u043e\u0436\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f.<br \/>  \u042d\u0442\u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b \u0418\u0441\u0442\u043e\u0440\u0438\u044f \u0446\u0435\u043d \u043d\u0430 \u0430\u0432\u0438\u0430\u0431\u0438\u043b\u0435\u0442\u044b:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pt\/cg\/wy\/ptcgwybzkpxernss_rr-3mafu_s.png\" alt=\"image\"><br \/>  \u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 <a href=\"https:\/\/cheapster.travel\/history\" rel=\"nofollow\">cheapster.travel\/history<\/a> (\u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u043c \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043a\u0440\u0438\u0432\u043e, \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u044d\u043a\u0440\u0430\u043d\u044b)<\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0451, \u0432\u0441\u0435\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0434\u043d\u044f!<\/p>\n<h4>\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438<\/h4>\n<p>  <a href=\"https:\/\/habr.com\/ru\/post\/484222\/\">\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0432\u044b\u0431\u043e\u0440\u0430 \u0430\u0432\u0438\u0430\u0431\u0438\u043b\u0435\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0443\u0441\u043a\u043e\u043c<\/a><br \/>  <a href=\"https:\/\/habr.com\/ru\/post\/489510\/\">\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0432\u044b\u0431\u043e\u0440\u0430 \u0430\u0432\u0438\u0430\u0431\u0438\u043b\u0435\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0443\u0441\u043a\u043e\u043c #2<\/a><\/p>\n<h4>\u0414\u0440\u0443\u0433\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b<\/h4>\n<p>  <a href=\"https:\/\/cheapster.travel\/combinator\" rel=\"nofollow\">\u041a\u043e\u043c\u0431\u0438\u043d\u0430\u0442\u043e\u0440 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432<\/a><br \/>  <a href=\"https:\/\/cheapster.travel\/complex\" rel=\"nofollow\">\u0421\u043b\u043e\u0436\u043d\u044b\u0435 \u0431\u0438\u043b\u0435\u0442\u044b (\u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438)<\/a><\/p>\n<p>  P.S.<br \/>  \u0412\u0430\u0436\u043d\u043e! \u041d\u0435 \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0439\u0442\u0435 \u044d\u0442\u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f, \u043a\u0430\u043a \u0447\u0442\u043e-\u0442\u043e \u0447\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u0442\u0443 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u2014 \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e \u0435\u0435 \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u0430 \u043c\u043d\u043e\u0439 \u0438\u043b\u0438 \u043a\u0435\u043c-\u043b\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u0438\u043c (\u0432\u0441\u0435 \u043d\u0430 \u0441\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u0445 \u0438 \u0440\u0438\u0441\u043a, \u0431\u0435\u0437 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0439).<\/p>\n<p>  1TB* \u2014 \u044d\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 tsv, \u0432 \u041a\u0425 \u044d\u0442\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043c\u0435\u043d\u044c\u0448\u0435.<\/p><\/div>\n<p> \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\/490762\/\"> https:\/\/habr.com\/ru\/post\/490762\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/490762\/\">\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! <br \/>  \u042d\u0442\u043e \u0442\u0440\u0435\u0442\u044c\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0442\u0430\u043c, \u043a\u0430\u043a \u044f \u0434\u0435\u043b\u0430\u044e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438 \u0443\u044e\u0442\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 <s>\u0432 \u0442\u0435\u043e\u0440\u0438\u0438<\/s> \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043c\u043e\u0447\u044c \u0441 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0439. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u0442\u043e, \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0446\u0435\u043d\u044b \u043d\u0430 \u0430\u0432\u0438\u0430\u0431\u0438\u043b\u0435\u0442\u044b, \u0438\u043c\u0435\u044f \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 Clickhouse, Catboost \u0438 1TB* \u0434\u0430\u043d\u043d\u044b\u0445.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zn\/c5\/vi\/znc5vi1_whqyxeqiyvne_ql96hw.png\" alt=\"image\">  <\/p>\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-299603","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/299603","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=299603"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/299603\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=299603"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=299603"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=299603"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}