{"id":345509,"date":"2023-02-16T15:00:29","date_gmt":"2023-02-16T15:00:29","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=345509"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2023-02-16T15:00:29","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=345509","title":{"rendered":"<span>\u041a\u0430\u043a \u043c\u044b \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u043b\u0438 CatBoost \u043d\u0430 Spark<\/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<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u042f \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u0438\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u04255 Tech. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043f\u0440\u0438 \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u0438 CatBoost \u043d\u0430 Spark, \u0438 \u043a\u0430\u043a \u043c\u044b \u043d\u0430\u0448\u043b\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u043d\u0435 rocket science, \u043d\u043e \u0435\u0441\u043b\u0438 \u0431\u044b \u0441\u043e \u043c\u043d\u043e\u0439 \u043f\u043e\u0434\u0435\u043b\u0438\u043b\u0438\u0441\u044c \u0442\u0430\u043a\u0438\u043c\u0438 \u043e\u0442\u0432\u0435\u0442\u0430\u043c\u0438 \u0437\u0430\u0440\u0430\u043d\u0435\u0435, \u044f \u0431\u044b \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043b \u0441\u0435\u0431\u0435 \u043f\u0430\u0440\u0443 \u0432\u0435\u0447\u0435\u0440\u043e\u0432 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. <\/p>\n<h2>\u041f\u0430\u0440\u0430 \u0432\u0432\u043e\u0434\u043d\u044b\u0445<\/h2>\n<p>\u041f\u043e\u043a\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043a \u0437\u0430\u0434\u0430\u0447\u0435, \u0441\u043a\u0430\u0436\u0443 \u043f\u0430\u0440\u0443 \u0441\u043b\u043e\u0432 \u043f\u0440\u043e \u043d\u0430\u0448\u0443 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 (\u0447\u0442\u043e\u0431\u044b \u0432\u044b \u043f\u043e\u043d\u044f\u043b\u0438, \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0432\u0430\u043c \u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442). \u041c\u044b \u0436\u0438\u0432\u0451\u043c \u0432 Kubernetes 1.17, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0434\u043d\u044f\u0442 Airflow 1.10.15 (c Kubernetes Executor). \u0414\u0430\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043d\u0430 HDFS \u0432 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0435 Hadoop. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c PySpark 2.4.5, \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438: \u0447\u0435\u0440\u0435\u0437 Spark Submit Operator \u0438\u043b\u0438 \u043d\u0430 \u043f\u043e\u0434\u043d\u044f\u0442\u043e\u043c \u043f\u043e\u0434\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 Python Operator) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 Spark \u0438\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439 \u0440\u0435\u0436\u0438\u043c (client mode).<\/p>\n<p>\u0421\u0430\u043c\u0430 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0431\u0438\u0437\u043d\u0435\u0441\u043e\u0432\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0437\u0430\u0434\u0430\u0447\u0438 \u0437\u0432\u0443\u0447\u0438\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u0438\u0439 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d, \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u044d\u0442\u0430\u043f\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0435\u0434\u0438\u043a\u0442 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c CatBoost: \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0449\u043d\u044b\u0445 \u043f\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043a\u0435 \u043f\u043e\u0434\u043e\u0432 (Python Operator \u0432 Airflow) \u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 CatBoost (\u0434\u0430\u043d\u043d\u044b\u0435 \u0441 HDFS \u043d\u0435 \u043f\u043e\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u0431\u0430\u0442\u0447\u0430\u043c\u0438 \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e).\u00a0<\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b<\/h2>\n<p>\u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u0435 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u041f\u0435\u0440\u0432\u0430\u044f \u2013 \u043d\u0435\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0432 Kubernetes. \u0412\u0442\u043e\u0440\u0430\u044f \u2013 \u043a\u0430\u0436\u0434\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0434\u0435\u0441\u044f\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0440\u0430\u0441\u0442\u0435\u0442, \u0435\u0441\u043b\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>\u0422\u0430\u043a \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u201c\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043d\u044b\u0439\u201d CatBoost, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u2013 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0440\u0430\u0441\u0447\u0451\u0442\u044b \u0432 Hadoop-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043d\u043e\u043c Spark-\u0435, \u0442. \u043a. \u0434\u043b\u044f CatBoost \u0435\u0441\u0442\u044c \u201c\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u201d, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0430: <a href=\"https:\/\/catboost.ai\/en\/docs\/installation\/spark-installation-pyspark\"><u>https:\/\/catboost.ai\/en\/docs\/installation\/spark-installation-pyspark<\/u><\/a>.<\/p>\n<h2>Client Mode Spark<\/h2>\n<p>\u0414\u043b\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 Spark-\u0430: \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0443 \u043d\u0430\u0441 \u043d\u0430 \u043f\u043e\u0434\u0435 \u0432 Kubernetes-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435, \u044d\u043a\u0437\u0435\u043a\u044c\u044e\u0442\u043e\u0440\u044b \u2013 \u0432 Hadoop-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0442\u044f\u043d\u0443\u0442\u044c\u0441\u044f \u0438\u0437 Kubernetes \u043f\u043e\u0434\u0430 \u0434\u043e Hadoop-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0442\u0438\u043f\u0430 NodePort:\u00a0<\/p>\n<pre><code class=\"markdown\">spark-driver-node-port    NodePort   10.43.92.218   &lt;none>     39571:39571\/TCP,35931:35931\/TCP,30409:30409\/TCP<\/code><\/pre>\n<p>\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c 3 \u043f\u043e\u0440\u0442\u0430 (driver, block-manager, ui) \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 Spark-\u0430:<\/p>\n<pre><code>SparkSession   .builder   \u2026   .config('spark.driver.port', driver_port)   .config('spark.driver.blockManager.port', block_manager_port)   .config('spark.ui.port', ui_port)   .getOrCreate() <\/code><\/pre>\n<p>\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0438 catboost listeningport=0 <a href=\"https:\/\/github.com\/catboost\/catboost\/blob\/dfc3f04050ef9acc3f070f38fe363fec93a3bc8d\/catboost\/spark\/catboost4j-spark\/core\/src\/main\/scala\/ai\/catboost\/spark\/CatBoostPredictor.scala#L228\"><u>https:\/\/github.com\/catboost\/catboost\/blob\/dfc3f04050ef9acc3f070f38fe363fec93a3bc8d\/catboost\/spark\/catboost4j-spark\/core\/src\/main\/scala\/ai\/catboost\/spark\/CatBoostPredictor.scala#L228<\/u><\/a><\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u0438 \u0435\u0451 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0434\u0435\u043d\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0434\u0435\u0441\u044c: <a href=\"https:\/\/github.com\/catboost\/catboost\/issues\/2181\"><u>https:\/\/github.com\/catboost\/catboost\/issues\/2181<\/u><\/a><\/p>\n<h2>Cluster Mode Spark<\/h2>\n<p>\u041d\u0430 \u043f\u0440\u043e\u0434\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Spark Submit Operator, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u043b\u0438 spark_config: <a href=\"https:\/\/catboost.ai\/en\/docs\/installation\/spark-installation-pyspark\"><u>https:\/\/catboost.ai\/en\/docs\/installation\/spark-installation-pyspark<\/u><\/a>.<\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043d\u0430 Hadoop-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u043e\u0442 \u044d\u0442\u0438 jar \u0444\u0430\u0439\u043b\u044b \u043d\u0430 HDFS:<\/p>\n<pre><code>ai.catboost_catboost-common-1.1.jar  ai.catboost_catboost-spark_2.4_2.11-1.1.jar io.github.classgraph_classgraph-4.8.98.jar<\/code><\/pre>\n<p>\u0438 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433 \u0432 \u201cspark.jars\u201d.\u00a0<\/p>\n<p>\u041d\u043e \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439:<\/p>\n<pre><code>Py4JJavaError: An error occurred while calling o663.fit.<\/code><\/pre>\n<p>\u041e \u043d\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u0430\u0440\u0443 \u0441\u0441\u044b\u043b\u043e\u043a \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u0432\u0440\u043e\u0434\u0435 \u044d\u0442\u043e\u0439: <a href=\"https:\/\/github.com\/catboost\/catboost\/issues\/1585?ysclid=le1hctqn2n472605600\"><u>https:\/\/github.com\/catboost\/catboost\/issues\/1585?ysclid=le1hctqn2n472605600<\/u><\/a>, \u043d\u043e \u043d\u0438 \u043e\u0434\u043d\u043e \u0438\u0437 \u043d\u0438\u0445 \u043d\u0435 \u043f\u043e\u0444\u0438\u043a\u0441\u0438\u043b\u043e \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041c\u0435\u0442\u043e\u0434\u043e\u043c \u043f\u0440\u043e\u0431 \u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u0442\u0432\u0435\u0442:<\/p>\n<pre><code class=\"python\">jars = \"hdfs:\/\/\/share\/path\/to\/catboost\/jars*\" SparkSubmitOperator(      \u2026      conf=spark_submit_config,      executor_config=kubernetes_executor,      jars=jars,      py_files=jars, ) <\/code><\/pre>\n<p>\u041d\u0443\u0436\u043d\u043e \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u044b\u0448\u0435, \u0430 \u043d\u0430 HDFS \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 jars. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043d\u0435 \u0442\u0435 \u0442\u0440\u0438 \u0434\u0436\u0430\u0440\u043d\u0438\u043a\u0430, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u043f\u0438\u0441\u0430\u043b \u0432\u044b\u0448\u0435, \u0430 \u0432\u043e\u0442 \u044d\u0442\u043e\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/333\/887\/fee\/333887feed315028a2710870a1a869fe.png\" width=\"806\" height=\"216\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/333\/887\/fee\/333887feed315028a2710870a1a869fe.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c: \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 CatBoost \u0438 \u0438\u0437 \u0441\u043a\u0430\u0447\u0430\u043d\u043d\u044b\u0445 \u0434\u0436\u0430\u0440\u043d\u0438\u043a\u043e\u0432 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 (\u0432\u0435\u0440\u0441\u0438\u0438, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f).<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0434\u0430\u0439\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 sparkPartitionCount:<\/p>\n<pre><code class=\"python\">catboost_spark.CatBoostClassifier(sparkPartitionCount=10)<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 Spark History Server, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e 10 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u044d\u043a\u0437\u0435\u043a\u044c\u044e\u0442\u043e\u0440\u043e\u0432. <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043d\u044f\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0441 Kubernetes-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/X5Tech\/blog\/717450\/\"> https:\/\/habr.com\/ru\/company\/X5Tech\/blog\/717450\/<\/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<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u042f \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u0438\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u04255 Tech. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043f\u0440\u0438 \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u0438 CatBoost \u043d\u0430 Spark, \u0438 \u043a\u0430\u043a \u043c\u044b \u043d\u0430\u0448\u043b\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u043d\u0435 rocket science, \u043d\u043e \u0435\u0441\u043b\u0438 \u0431\u044b \u0441\u043e \u043c\u043d\u043e\u0439 \u043f\u043e\u0434\u0435\u043b\u0438\u043b\u0438\u0441\u044c \u0442\u0430\u043a\u0438\u043c\u0438 \u043e\u0442\u0432\u0435\u0442\u0430\u043c\u0438 \u0437\u0430\u0440\u0430\u043d\u0435\u0435, \u044f \u0431\u044b \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043b \u0441\u0435\u0431\u0435 \u043f\u0430\u0440\u0443 \u0432\u0435\u0447\u0435\u0440\u043e\u0432 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. <\/p>\n<h2>\u041f\u0430\u0440\u0430 \u0432\u0432\u043e\u0434\u043d\u044b\u0445<\/h2>\n<p>\u041f\u043e\u043a\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043a \u0437\u0430\u0434\u0430\u0447\u0435, \u0441\u043a\u0430\u0436\u0443 \u043f\u0430\u0440\u0443 \u0441\u043b\u043e\u0432 \u043f\u0440\u043e \u043d\u0430\u0448\u0443 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 (\u0447\u0442\u043e\u0431\u044b \u0432\u044b \u043f\u043e\u043d\u044f\u043b\u0438, \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0432\u0430\u043c \u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442). \u041c\u044b \u0436\u0438\u0432\u0451\u043c \u0432 Kubernetes 1.17, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0434\u043d\u044f\u0442 Airflow 1.10.15 (c Kubernetes Executor). \u0414\u0430\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043d\u0430 HDFS \u0432 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0435 Hadoop. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c PySpark 2.4.5, \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438: \u0447\u0435\u0440\u0435\u0437 Spark Submit Operator \u0438\u043b\u0438 \u043d\u0430 \u043f\u043e\u0434\u043d\u044f\u0442\u043e\u043c \u043f\u043e\u0434\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 Python Operator) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 Spark \u0438\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439 \u0440\u0435\u0436\u0438\u043c (client mode).<\/p>\n<p>\u0421\u0430\u043c\u0430 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0431\u0438\u0437\u043d\u0435\u0441\u043e\u0432\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0437\u0430\u0434\u0430\u0447\u0438 \u0437\u0432\u0443\u0447\u0438\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u0438\u0439 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d, \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u044d\u0442\u0430\u043f\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0435\u0434\u0438\u043a\u0442 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c CatBoost: \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0449\u043d\u044b\u0445 \u043f\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043a\u0435 \u043f\u043e\u0434\u043e\u0432 (Python Operator \u0432 Airflow) \u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 CatBoost (\u0434\u0430\u043d\u043d\u044b\u0435 \u0441 HDFS \u043d\u0435 \u043f\u043e\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u0431\u0430\u0442\u0447\u0430\u043c\u0438 \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e).\u00a0<\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b<\/h2>\n<p>\u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u0435 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u041f\u0435\u0440\u0432\u0430\u044f \u2013 \u043d\u0435\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0432 Kubernetes. \u0412\u0442\u043e\u0440\u0430\u044f \u2013 \u043a\u0430\u0436\u0434\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0434\u0435\u0441\u044f\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0440\u0430\u0441\u0442\u0435\u0442, \u0435\u0441\u043b\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>\u0422\u0430\u043a \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u201c\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043d\u044b\u0439\u201d CatBoost, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u2013 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0440\u0430\u0441\u0447\u0451\u0442\u044b \u0432 Hadoop-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043d\u043e\u043c Spark-\u0435, \u0442. \u043a. \u0434\u043b\u044f CatBoost \u0435\u0441\u0442\u044c \u201c\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u201d, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0430: <a href=\"https:\/\/catboost.ai\/en\/docs\/installation\/spark-installation-pyspark\"><u>https:\/\/catboost.ai\/en\/docs\/installation\/spark-installation-pyspark<\/u><\/a>.<\/p>\n<h2>Client Mode Spark<\/h2>\n<p>\u0414\u043b\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 Spark-\u0430: \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0443 \u043d\u0430\u0441 \u043d\u0430 \u043f\u043e\u0434\u0435 \u0432 Kubernetes-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435, \u044d\u043a\u0437\u0435\u043a\u044c\u044e\u0442\u043e\u0440\u044b \u2013 \u0432 Hadoop-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0442\u044f\u043d\u0443\u0442\u044c\u0441\u044f \u0438\u0437 Kubernetes \u043f\u043e\u0434\u0430 \u0434\u043e Hadoop-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0442\u0438\u043f\u0430 NodePort:\u00a0<\/p>\n<pre><code class=\"markdown\">spark-driver-node-port    NodePort   10.43.92.218   &lt;none>     39571:39571\/TCP,35931:35931\/TCP,30409:30409\/TCP<\/code><\/pre>\n<p>\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c 3 \u043f\u043e\u0440\u0442\u0430 (driver, block-manager, ui) \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 Spark-\u0430:<\/p>\n<pre><code>SparkSession   .builder   \u2026   .config('spark.driver.port', driver_port)   .config('spark.driver.blockManager.port', block_manager_port)   .config('spark.ui.port', ui_port)   .getOrCreate() <\/code><\/pre>\n<p>\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0438 catboost listeningport=0 <a href=\"https:\/\/github.com\/catboost\/catboost\/blob\/dfc3f04050ef9acc3f070f38fe363fec93a3bc8d\/catboost\/spark\/catboost4j-spark\/core\/src\/main\/scala\/ai\/catboost\/spark\/CatBoostPredictor.scala#L228\"><u>https:\/\/github.com\/catboost\/catboost\/blob\/dfc3f04050ef9acc3f070f38fe363fec93a3bc8d\/catboost\/spark\/catboost4j-spark\/core\/src\/main\/scala\/ai\/catboost\/spark\/CatBoostPredictor.scala#L228<\/u><\/a><\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u0438 \u0435\u0451 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0434\u0435\u043d\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0434\u0435\u0441\u044c: <a href=\"https:\/\/github.com\/catboost\/catboost\/issues\/2181\"><u>https:\/\/github.com\/catboost\/catboost\/issues\/2181<\/u><\/a><\/p>\n<h2>Cluster Mode Spark<\/h2>\n<p>\u041d\u0430 \u043f\u0440\u043e\u0434\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Spark Submit Operator, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u043b\u0438 spark_config: <a href=\"https:\/\/catboost.ai\/en\/docs\/installation\/spark-installation-pyspark\"><u>https:\/\/catboost.ai\/en\/docs\/installation\/spark-installation-pyspark<\/u><\/a>.<\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043d\u0430 Hadoop-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u043e\u0442 \u044d\u0442\u0438 jar \u0444\u0430\u0439\u043b\u044b \u043d\u0430 HDFS:<\/p>\n<pre><code>ai.catboost_catboost-common-1.1.jar  ai.catboost_catboost-spark_2.4_2.11-1.1.jar io.github.classgraph_classgraph-4.8.98.jar<\/code><\/pre>\n<p>\u0438 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433 \u0432 \u201cspark.jars\u201d.\u00a0<\/p>\n<p>\u041d\u043e \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439:<\/p>\n<pre><code>Py4JJavaError: An error occurred while calling o663.fit.<\/code><\/pre>\n<p>\u041e \u043d\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u0430\u0440\u0443 \u0441\u0441\u044b\u043b\u043e\u043a \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u0432\u0440\u043e\u0434\u0435 \u044d\u0442\u043e\u0439: <a href=\"https:\/\/github.com\/catboost\/catboost\/issues\/1585?ysclid=le1hctqn2n472605600\"><u>https:\/\/github.com\/catboost\/catboost\/issues\/1585?ysclid=le1hctqn2n472605600<\/u><\/a>, \u043d\u043e \u043d\u0438 \u043e\u0434\u043d\u043e \u0438\u0437 \u043d\u0438\u0445 \u043d\u0435 \u043f\u043e\u0444\u0438\u043a\u0441\u0438\u043b\u043e \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041c\u0435\u0442\u043e\u0434\u043e\u043c \u043f\u0440\u043e\u0431 \u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u0442\u0432\u0435\u0442:<\/p>\n<pre><code class=\"python\">jars = \"hdfs:\/\/\/share\/path\/to\/catboost\/jars*\" SparkSubmitOperator(      \u2026      conf=spark_submit_config,      executor_config=kubernetes_executor,      jars=jars,      py_files=jars, ) <\/code><\/pre>\n<p>\u041d\u0443\u0436\u043d\u043e \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u044b\u0448\u0435, \u0430 \u043d\u0430 HDFS \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 jars. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043d\u0435 \u0442\u0435 \u0442\u0440\u0438 \u0434\u0436\u0430\u0440\u043d\u0438\u043a\u0430, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u043f\u0438\u0441\u0430\u043b \u0432\u044b\u0448\u0435, \u0430 \u0432\u043e\u0442 \u044d\u0442\u043e\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c: \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 CatBoost \u0438 \u0438\u0437 \u0441\u043a\u0430\u0447\u0430\u043d\u043d\u044b\u0445 \u0434\u0436\u0430\u0440\u043d\u0438\u043a\u043e\u0432 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 (\u0432\u0435\u0440\u0441\u0438\u0438, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f).<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0434\u0430\u0439\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 sparkPartitionCount:<\/p>\n<pre><code class=\"python\">catboost_spark.CatBoostClassifier(sparkPartitionCount=10)<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 Spark History Server, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e 10 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u044d\u043a\u0437\u0435\u043a\u044c\u044e\u0442\u043e\u0440\u043e\u0432. <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043d\u044f\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0441 Kubernetes-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/X5Tech\/blog\/717450\/\"> https:\/\/habr.com\/ru\/company\/X5Tech\/blog\/717450\/<\/a><br \/><\/br><\/br><\/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-345509","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/345509","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=345509"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/345509\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=345509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=345509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=345509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}