{"id":470892,"date":"2025-08-15T15:01:37","date_gmt":"2025-08-15T15:01:37","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=470892"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=470892","title":{"rendered":"<span>7 \u0432\u0437\u0430\u0438\u043c\u043e\u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u044f\u0442 \u0432\u0430\u0448\u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b Data Science \u043d\u0430 Python<\/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>\u0412\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u044d\u0442\u0438\u043c. \u0412\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 Python, \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0435\u0433\u043e \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c CSV-\u0444\u0430\u0439\u043b\u0435 \u2014 \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e. \u041d\u043e \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0435\u0433\u043e \u043d\u0430 \u043f\u043e\u043b\u043d\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 10 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u043e\u0432 \u0441\u0442\u0440\u043e\u043a, \u0432\u0435\u043d\u0442\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430 \u043d\u0430\u0447\u0430\u043b \u0433\u0443\u0434\u0435\u0442\u044c, \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0437\u0430\u0432\u0438\u0441\u043b\u0430, \u0438 \u0443 \u0432\u0430\u0441 \u0431\u044b\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0442\u043e\u0431\u044b \u0441\u0432\u0430\u0440\u0438\u0442\u044c \u0442\u0440\u0438 \u043a\u043e\u0444\u0435\u0439\u043d\u0438\u043a\u0430, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0432\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>\u0410 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0442\u0435 \u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430?<\/p>\n<p>\u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u041c\u043d\u043e\u0433\u0438\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f Data Science \u043d\u0430 Python \u2014 \u0432\u043a\u043b\u044e\u0447\u0430\u044f pandas, Polars, scikit-learn \u0438 XGBoost \u2014 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043d\u0430 GPU \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u0434\u0435. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u0430\u043a\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u0430\u043a NVIDIA cuDF, cuML \u0438 cuGraph, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u043a\u0430\u043a \u0435\u0441\u0442\u044c \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u0434 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c 7 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a Python \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0437\u0430\u043c\u0435\u043d \u2014 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0438.<\/p>\n<hr\/>\n<h2>\u0423\u0441\u043a\u043e\u0440\u044c\u0442\u0435 pandas \u0438 Polars \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p><strong>\u21161: %load_ext cudf.pandas: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 pandas \u0441 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435\u043c \u043d\u0430 GPU<\/strong><\/p>\n<p>pandas \u2014 \u043a\u0440\u0430\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u044b\u0439 \u043a\u0430\u043c\u0435\u043d\u044c Data Science \u043d\u0430 Python, \u043d\u043e \u043e\u043d \u0431\u044b\u0441\u0442\u0440\u043e \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u043e\u0431\u044a\u0451\u043c\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e cudf.pandas \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u0448 \u043a\u043e\u0434 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u043d\u0430 GPU.<\/p>\n<p><strong>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/strong> \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0438\u043b\u0438 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430. cuDF \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b pandas \u043d\u0430 GPU, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<pre><code class=\"python\"># \u041f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u044d\u0442\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430!  %load_ext cudf.pandas  import pandas as pd df = pd.read_csv(\"your_large_dataset.csv\")  # ...\u0432\u0441\u0435 \u0432\u0430\u0448\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 pandas \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u044b<\/code><\/pre>\n<p><em>\u0412\u0438\u0434\u0435\u043e 1: \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 pandas \u0441 \u0432\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u044b\u043c \u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c cuDF \u043d\u0430 18 \u043c\u043b\u043d \u0441\u0442\u0440\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0431\u0438\u0440\u0436\u0435\u0432\u044b\u0445 \u0430\u043a\u0446\u0438\u044f\u0445.<\/em><\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/689f221d8f3d780a7fb65f2b\" data-style=\"\" id=\"689f221d8f3d780a7fb65f2b\" width=\"\"><\/div>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=eThOYTJrbtA\" rel=\"noopener noreferrer nofollow\">https:\/\/www.youtube.com\/watch?v=eThOYTJrbtA<\/a> <\/p>\n<p>\u0418\u0441\u043f\u044b\u0442\u0430\u0442\u044c:<\/p>\n<p><a href=\"https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cudf_pandas_colab_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cudf_pandas_colab_demo.ipynb<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cudf_pandas_demo.ipynb\" rel=\"noopener noreferrer nofollow\"><em>https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cudf_pandas_demo.ipynb<\/em><\/a><em> <\/em><\/p>\n<hr\/>\n<p><strong>\u21162: .collect(engine=&#187;gpu&#187;): \u0423\u0441\u043a\u043e\u0440\u044c\u0442\u0435 Polars \u0435\u0449\u0451 \u0441\u0438\u043b\u044c\u043d\u0435\u0435<\/strong><\/p>\n<p>Polars \u0443\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u0441\u0432\u043e\u0435\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c\u044e GPU \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e cuDF.<\/p>\n<p><strong>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/strong> \u0423 Polars \u0435\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0434\u0432\u0438\u0436\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0430 GPU, \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0432 engine=&#187;gpu&#187;.<\/p>\n<pre><code>pip install polars[gpu]<\/code><\/pre>\n<pre><code class=\"python\">import polars as pl  (transactions \u00a0.group_by(\"CUST_ID\") \u00a0.agg(pl.col(\"AMOUNT\").sum()) \u00a0.sort(by=\"AMOUNT\", descending=True) \u00a0.head() \u00a0.collect(engine=\"gpu\"))<\/code><\/pre>\n<p><em>\u0412\u0438\u0434\u0435\u043e 2: \u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 100 \u043c\u043b\u043d \u0441\u0442\u0440\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c GPU-\u0434\u0432\u0438\u0436\u043a\u0430 Polars.<\/em><\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/689f22ac61240a0a7148bcaf\" data-style=\"\" id=\"689f22ac61240a0a7148bcaf\" width=\"\"><\/div>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=AoKeit2Fbmw\" rel=\"noopener noreferrer nofollow\">https:\/\/www.youtube.com\/watch?v=AoKeit2Fbmw<\/a> <\/p>\n<p>\u0418\u0441\u043f\u044b\u0442\u0430\u0442\u044c:<\/p>\n<p><a href=\"https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/accelerated_data_processing_examples\/polars_gpu_engine_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/accelerated_data_processing_examples\/polars_gpu_engine_demo.ipynb<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/rapidsai-community\/showcase\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/rapidsai-community\/showcase<\/a><\/p>\n<hr\/>\n<h2>\u0423\u0441\u043a\u043e\u0440\u044c\u0442\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432 scikit-learn \u0438 XGBoost<\/h2>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u044b, \u043f\u043e\u0440\u0430 \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u2014 \u0438 \u0437\u0434\u0435\u0441\u044c Python \u0447\u0430\u0441\u0442\u043e \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, scikit-learn \u0438 XGBoost \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043b\u0435\u0433\u043a\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c GPU \u0438 \u0440\u0435\u0437\u043a\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>\u21163: %load_ext cuml.accel: \u0423\u0441\u043a\u043e\u0440\u044c\u0442\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 scikit-learn \u043d\u0430 GPU<\/strong><\/p>\n<p>scikit-learn \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0435\u043d \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u041d\u043e \u043f\u0440\u0438 \u0440\u043e\u0441\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e\u0434\u0431\u043e\u0440\u0435 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0434\u043e\u043b\u0433\u0438\u043c. \u0421 cuML \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0435 \u043c\u0435\u043d\u044f\u044f \u043a\u043e\u0434.<\/p>\n<pre><code class=\"python\">%load_ext cuml.accel  from sklearn.datasets import make_classification from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier  X, y = make_classification(n_samples=500000, n_features=100) X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)  rf = RandomForestClassifier(n_estimators=100, n_jobs=-1) rf.fit(X_train, y_train)<\/code><\/pre>\n<p><em>\u0412\u0438\u0434\u0435\u043e 3: \u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 RandomForestClassifier \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c cuML \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0432\u043c\u0435\u0441\u0442\u043e \u043c\u0438\u043d\u0443\u0442.<\/em><\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/689f23296420910a656f6818\" data-style=\"\" id=\"689f23296420910a656f6818\" width=\"\"><\/div>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=cIJsVq8CPys\" rel=\"noopener noreferrer nofollow\">https:\/\/www.youtube.com\/watch?v=cIJsVq8CPys<\/a> <\/p>\n<p>\ud83d\udca1 \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 scikit-learn \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f. \u0421\u043c. \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e.<\/p>\n<p><a href=\"https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb<\/a> <\/p>\n<p><a href=\"https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb<\/a><\/p>\n<hr\/>\n<p><strong>\u21164: device = &#171;cuda&#187;: \u0412\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 CUDA \u0432 XGBoost<\/strong><\/p>\n<p>XGBoost \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043b\u0443\u0447\u0448\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f ML. \u0423\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u043d\u0430 GPU \u0443\u0436\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u2014 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0435\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c.<\/p>\n<pre><code class=\"python\">xgb_model = xgb.XGBRegressor(device=\"cuda\")   xgb_model.fit(X, y)<\/code><\/pre>\n<p><em>\u0412\u0438\u0434\u0435\u043e 4: \u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f XGBoost \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u0435\u0437\u0434\u043e\u043a \u043d\u0430 \u0442\u0430\u043a\u0441\u0438.<\/em><\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/689f23623ee88c0a928b02d3\" data-style=\"\" id=\"689f23623ee88c0a928b02d3\" width=\"\"><\/div>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=lhraJRaDkOA&amp;t=617s\" rel=\"noopener noreferrer nofollow\">https:\/\/www.youtube.com\/watch?v=lhraJRaDkOA&amp;t=617s<\/a> <\/p>\n<p>\u0418\u0441\u043f\u044b\u0442\u0430\u0442\u044c:<\/p>\n<p><a href=\"https:\/\/colab.research.google.com\/gist\/will-hill\/2edd85e351e62e52fccd43da9b027434\/xgboost_rapids_taxi.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/colab.research.google.com\/gist\/will-hill\/2edd85e351e62e52fccd43da9b027434\/xgboost_rapids_taxi.ipynb<\/a> <\/p>\n<hr\/>\n<h2>\u0423\u0441\u043a\u043e\u0440\u044c\u0442\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044e<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0434 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u0438 \u0447\u0430\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043b\u0438 \u043d\u0430\u0439\u0442\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u044b. UMAP \u0438 HDBSCAN \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442, \u043d\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0430 CPU. \u0421 cuML \u0432\u0441\u0451 \u0431\u044b\u0441\u0442\u0440\u0435\u0435.<\/p>\n<hr\/>\n<p><strong>\u21165: %load_ext cuml.accel: \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441 UMAP \u0437\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u044b<\/strong><\/p>\n<pre><code class=\"python\">%%load_ext cuml.accel  import umap umap_model = umap.UMAP(n_neighbors=15, n_components=2, min_dist=0.0) X_train_umap = umap_model.fit_transform(X_train_scaled)<\/code><\/pre>\n<p><em>\u0412\u0438\u0434\u0435\u043e 5: \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u0438 UMAP \u043d\u0430 CPU \u0438 GPU. \u041d\u0430 GPU \u2014 \u043c\u0435\u043d\u0435\u0435 1 \u0441\u0435\u043a\u0443\u043d\u0434\u044b.<\/em><\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/689f23de8f3d780a7fb66077\" data-style=\"\" id=\"689f23de8f3d780a7fb66077\" width=\"\"><\/div>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=cIJsVq8CPys\" rel=\"noopener noreferrer nofollow\">https:\/\/www.youtube.com\/watch?v=cIJsVq8CPys<\/a> <\/p>\n<p>\u0418\u0441\u043f\u044b\u0442\u0430\u0442\u044c:<\/p>\n<p><a href=\"https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb<\/a><\/p>\n<hr\/>\n<p><strong>\u21166: %load_ext cuml.accel: \u0411\u044b\u0441\u0442\u0440\u0430\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0441 HDBSCAN<\/strong><\/p>\n<pre><code class=\"python\">%%load_ext cuml.accel  import hdbscan clusterer = hdbscan.HDBSCAN() clusterer.fit(X)<\/code><\/pre>\n<p>\u00a0<em>\u0412\u0438\u0434\u0435\u043e 6: \u0421\u043d\u0438\u0436\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 45 \u0434\u043e 2 \u0441\u0435\u043a\u0443\u043d\u0434 \u2014 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u0434\u0435.<\/em><\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/689f2414d465afabb73213ac\" data-style=\"\" id=\"689f2414d465afabb73213ac\" width=\"\"><\/div>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=cIJsVq8CPys&amp;t=35s\" rel=\"noopener noreferrer nofollow\">https:\/\/www.youtube.com\/watch?v=cIJsVq8CPys&amp;t=35s<\/a> <\/p>\n<p>\u0418\u0441\u043f\u044b\u0442\u0430\u0442\u044c:<\/p>\n<p><a href=\"https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb<\/a> <\/p>\n<p><a href=\"https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb<\/a> <\/p>\n<hr\/>\n<h2>\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0433\u0440\u0430\u0444\u043e\u0432 \u0441 NetworkX<\/h2>\n<p>NetworkX \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0433\u0440\u0430\u0444\u0430\u043c\u0438, \u043d\u043e \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 Python \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0433\u0440\u0430\u0444\u0430\u0445.<\/p>\n<hr\/>\n<p><strong>\u21167: %env NX_CUGRAPH_AUTOCONFIG=True: \u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0439\u0442\u0435 \u0433\u0440\u0430\u0444\u044b \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043a\u043e\u0434\u0430<\/strong><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0435\u0441\u0442\u044c nx-cugraph \u2014 GPU-\u0431\u044d\u043a\u044d\u043d\u0434 \u0434\u043b\u044f NetworkX.<\/p>\n<p><strong>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/strong> \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 nx-cugraph, \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0438 \u0432\u0430\u0448 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043a\u043e\u0434 NetworkX \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u0441\u044f.<\/p>\n<pre><code class=\"bash\">pip install nx-cugraph-cu11 --extra-index-url https:\/\/pypi.nvidia.com<\/code><\/pre>\n<pre><code class=\"python\">%env NX_CUGRAPH_AUTOCONFIG=True  import pandas as pd import networkx as nx  df = pd.read_csv(\"your_edgelist.csv\", names=[\"src\", \"dst\"]) G = nx.from_pandas_edgelist(df, source=\"src\", target=\"dst\")  centrality_scores = nx.betweenness_centrality(G, k=10)<\/code><\/pre>\n<p><em>\u0412\u0438\u0434\u0435\u043e 7: \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 NetworkX \u043d\u0430 CPU \u0438 GPU. \u0422\u0435 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432 \u0440\u0430\u0437\u044b \u0431\u044b\u0441\u0442\u0440\u0435\u0435.<\/em><\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/689f24798f3d780a7fb66101\" data-style=\"\" id=\"689f24798f3d780a7fb66101\" width=\"\"><\/div>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=3EsbU1gcH5c\" rel=\"noopener noreferrer nofollow\">https:\/\/www.youtube.com\/watch?v=3EsbU1gcH5c<\/a> <\/p>\n<p>\u0418\u0441\u043f\u044b\u0442\u0430\u0442\u044c:<\/p>\n<p><a href=\"https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/accelerated_networkx_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/accelerated_networkx_demo.ipynb<\/a> <\/p>\n<p><a href=\"https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/accelerated_networkx_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/accelerated_networkx_demo.ipynb<\/a><\/p>\n<hr\/>\n<p><strong>\u0412\u044b\u0432\u043e\u0434: \u0422\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434. \u0411\u043e\u043b\u044c\u0448\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438.<\/strong><\/p>\n<p>\u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u043e\u043c \u043f\u043e CUDA, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c GPU. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u0430\u043a\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c, \u043a\u0430\u043a cuDF, cuML \u0438 cuGraph, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b.<\/p>\n<hr\/>\n<p><strong>\u0413\u043e\u0442\u043e\u0432\u044b \u043d\u0430\u0447\u0430\u0442\u044c?<\/strong> \u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0430 [GitHub (\u0441\u0441\u044b\u043b\u043a\u0430 \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0435)].<\/p>\n<p><a href=\"https:\/\/github.com\/rapidsai-community\/showcase\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/rapidsai-community\/showcase<\/a> <\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/937542\/\"> https:\/\/habr.com\/ru\/articles\/937542\/<\/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>\u0412\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u044d\u0442\u0438\u043c. \u0412\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 Python, \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0435\u0433\u043e \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c CSV-\u0444\u0430\u0439\u043b\u0435 \u2014 \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e. \u041d\u043e \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0435\u0433\u043e \u043d\u0430 \u043f\u043e\u043b\u043d\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 10 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u043e\u0432 \u0441\u0442\u0440\u043e\u043a, \u0432\u0435\u043d\u0442\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430 \u043d\u0430\u0447\u0430\u043b \u0433\u0443\u0434\u0435\u0442\u044c, \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0437\u0430\u0432\u0438\u0441\u043b\u0430, \u0438 \u0443 \u0432\u0430\u0441 \u0431\u044b\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0442\u043e\u0431\u044b \u0441\u0432\u0430\u0440\u0438\u0442\u044c \u0442\u0440\u0438 \u043a\u043e\u0444\u0435\u0439\u043d\u0438\u043a\u0430, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0432\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>\u0410 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0442\u0435 \u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430?<\/p>\n<p>\u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u041c\u043d\u043e\u0433\u0438\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f Data Science \u043d\u0430 Python \u2014 \u0432\u043a\u043b\u044e\u0447\u0430\u044f pandas, Polars, scikit-learn \u0438 XGBoost \u2014 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043d\u0430 GPU \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u0434\u0435. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u0430\u043a\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u0430\u043a NVIDIA cuDF, cuML \u0438 cuGraph, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u043a\u0430\u043a \u0435\u0441\u0442\u044c \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u0434 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c 7 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a Python \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0437\u0430\u043c\u0435\u043d \u2014 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0438.<\/p>\n<hr\/>\n<h2>\u0423\u0441\u043a\u043e\u0440\u044c\u0442\u0435 pandas \u0438 Polars \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p><strong>\u21161: %load_ext cudf.pandas: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 pandas \u0441 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435\u043c \u043d\u0430 GPU<\/strong><\/p>\n<p>pandas \u2014 \u043a\u0440\u0430\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u044b\u0439 \u043a\u0430\u043c\u0435\u043d\u044c Data Science \u043d\u0430 Python, \u043d\u043e \u043e\u043d \u0431\u044b\u0441\u0442\u0440\u043e \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u043e\u0431\u044a\u0451\u043c\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e cudf.pandas \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u0448 \u043a\u043e\u0434 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u043d\u0430 GPU.<\/p>\n<p><strong>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/strong> \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0438\u043b\u0438 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430. cuDF \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b pandas \u043d\u0430 GPU, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<pre><code class=\"python\"># \u041f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u044d\u0442\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430!  %load_ext cudf.pandas  import pandas as pd df = pd.read_csv(\"your_large_dataset.csv\")  # ...\u0432\u0441\u0435 \u0432\u0430\u0448\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 pandas \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u044b<\/code><\/pre>\n<p><em>\u0412\u0438\u0434\u0435\u043e 1: \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 pandas \u0441 \u0432\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u044b\u043c \u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c cuDF \u043d\u0430 18 \u043c\u043b\u043d \u0441\u0442\u0440\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0431\u0438\u0440\u0436\u0435\u0432\u044b\u0445 \u0430\u043a\u0446\u0438\u044f\u0445.<\/em><\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/689f221d8f3d780a7fb65f2b\" data-style=\"\" id=\"689f221d8f3d780a7fb65f2b\" width=\"\"><\/div>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=eThOYTJrbtA\" rel=\"noopener noreferrer nofollow\">https:\/\/www.youtube.com\/watch?v=eThOYTJrbtA<\/a> <\/p>\n<p>\u0418\u0441\u043f\u044b\u0442\u0430\u0442\u044c:<\/p>\n<p><a href=\"https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cudf_pandas_colab_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cudf_pandas_colab_demo.ipynb<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cudf_pandas_demo.ipynb\" rel=\"noopener noreferrer nofollow\"><em>https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cudf_pandas_demo.ipynb<\/em><\/a><em> <\/em><\/p>\n<hr\/>\n<p><strong>\u21162: .collect(engine=&#187;gpu&#187;): \u0423\u0441\u043a\u043e\u0440\u044c\u0442\u0435 Polars \u0435\u0449\u0451 \u0441\u0438\u043b\u044c\u043d\u0435\u0435<\/strong><\/p>\n<p>Polars \u0443\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u0441\u0432\u043e\u0435\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c\u044e GPU \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e cuDF.<\/p>\n<p><strong>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/strong> \u0423 Polars \u0435\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0434\u0432\u0438\u0436\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0430 GPU, \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0432 engine=&#187;gpu&#187;.<\/p>\n<pre><code>pip install polars[gpu]<\/code><\/pre>\n<pre><code class=\"python\">import polars as pl  (transactions \u00a0.group_by(\"CUST_ID\") \u00a0.agg(pl.col(\"AMOUNT\").sum()) \u00a0.sort(by=\"AMOUNT\", descending=True) \u00a0.head() \u00a0.collect(engine=\"gpu\"))<\/code><\/pre>\n<p><em>\u0412\u0438\u0434\u0435\u043e 2: \u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 100 \u043c\u043b\u043d \u0441\u0442\u0440\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c GPU-\u0434\u0432\u0438\u0436\u043a\u0430 Polars.<\/em><\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/689f22ac61240a0a7148bcaf\" data-style=\"\" id=\"689f22ac61240a0a7148bcaf\" width=\"\"><\/div>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=AoKeit2Fbmw\" rel=\"noopener noreferrer nofollow\">https:\/\/www.youtube.com\/watch?v=AoKeit2Fbmw<\/a> <\/p>\n<p>\u0418\u0441\u043f\u044b\u0442\u0430\u0442\u044c:<\/p>\n<p><a href=\"https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/accelerated_data_processing_examples\/polars_gpu_engine_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/accelerated_data_processing_examples\/polars_gpu_engine_demo.ipynb<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/rapidsai-community\/showcase\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/rapidsai-community\/showcase<\/a><\/p>\n<hr\/>\n<h2>\u0423\u0441\u043a\u043e\u0440\u044c\u0442\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432 scikit-learn \u0438 XGBoost<\/h2>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u044b, \u043f\u043e\u0440\u0430 \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u2014 \u0438 \u0437\u0434\u0435\u0441\u044c Python \u0447\u0430\u0441\u0442\u043e \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, scikit-learn \u0438 XGBoost \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043b\u0435\u0433\u043a\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c GPU \u0438 \u0440\u0435\u0437\u043a\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>\u21163: %load_ext cuml.accel: \u0423\u0441\u043a\u043e\u0440\u044c\u0442\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 scikit-learn \u043d\u0430 GPU<\/strong><\/p>\n<p>scikit-learn \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0435\u043d \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u041d\u043e \u043f\u0440\u0438 \u0440\u043e\u0441\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e\u0434\u0431\u043e\u0440\u0435 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0434\u043e\u043b\u0433\u0438\u043c. \u0421 cuML \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0435 \u043c\u0435\u043d\u044f\u044f \u043a\u043e\u0434.<\/p>\n<pre><code class=\"python\">%load_ext cuml.accel  from sklearn.datasets import make_classification from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier  X, y = make_classification(n_samples=500000, n_features=100) X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)  rf = RandomForestClassifier(n_estimators=100, n_jobs=-1) rf.fit(X_train, y_train)<\/code><\/pre>\n<p><em>\u0412\u0438\u0434\u0435\u043e 3: \u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 RandomForestClassifier \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c cuML \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0432\u043c\u0435\u0441\u0442\u043e \u043c\u0438\u043d\u0443\u0442.<\/em><\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/689f23296420910a656f6818\" data-style=\"\" id=\"689f23296420910a656f6818\" width=\"\"><\/div>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=cIJsVq8CPys\" rel=\"noopener noreferrer nofollow\">https:\/\/www.youtube.com\/watch?v=cIJsVq8CPys<\/a> <\/p>\n<p>\ud83d\udca1 \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 scikit-learn \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f. \u0421\u043c. \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e.<\/p>\n<p><a href=\"https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb<\/a> <\/p>\n<p><a href=\"https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb<\/a><\/p>\n<hr\/>\n<p><strong>\u21164: device = &#171;cuda&#187;: \u0412\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 CUDA \u0432 XGBoost<\/strong><\/p>\n<p>XGBoost \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043b\u0443\u0447\u0448\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f ML. \u0423\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u043d\u0430 GPU \u0443\u0436\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u2014 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0435\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c.<\/p>\n<pre><code class=\"python\">xgb_model = xgb.XGBRegressor(device=\"cuda\")   xgb_model.fit(X, y)<\/code><\/pre>\n<p><em>\u0412\u0438\u0434\u0435\u043e 4: \u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f XGBoost \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u0435\u0437\u0434\u043e\u043a \u043d\u0430 \u0442\u0430\u043a\u0441\u0438.<\/em><\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/689f23623ee88c0a928b02d3\" data-style=\"\" id=\"689f23623ee88c0a928b02d3\" width=\"\"><\/div>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=lhraJRaDkOA&amp;t=617s\" rel=\"noopener noreferrer nofollow\">https:\/\/www.youtube.com\/watch?v=lhraJRaDkOA&amp;t=617s<\/a> <\/p>\n<p>\u0418\u0441\u043f\u044b\u0442\u0430\u0442\u044c:<\/p>\n<p><a href=\"https:\/\/colab.research.google.com\/gist\/will-hill\/2edd85e351e62e52fccd43da9b027434\/xgboost_rapids_taxi.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/colab.research.google.com\/gist\/will-hill\/2edd85e351e62e52fccd43da9b027434\/xgboost_rapids_taxi.ipynb<\/a> <\/p>\n<hr\/>\n<h2>\u0423\u0441\u043a\u043e\u0440\u044c\u0442\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044e<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0434 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u0438 \u0447\u0430\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043b\u0438 \u043d\u0430\u0439\u0442\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u044b. UMAP \u0438 HDBSCAN \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442, \u043d\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0430 CPU. \u0421 cuML \u0432\u0441\u0451 \u0431\u044b\u0441\u0442\u0440\u0435\u0435.<\/p>\n<hr\/>\n<p><strong>\u21165: %load_ext cuml.accel: \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441 UMAP \u0437\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u044b<\/strong><\/p>\n<pre><code class=\"python\">%%load_ext cuml.accel  import umap umap_model = umap.UMAP(n_neighbors=15, n_components=2, min_dist=0.0) X_train_umap = umap_model.fit_transform(X_train_scaled)<\/code><\/pre>\n<p><em>\u0412\u0438\u0434\u0435\u043e 5: \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u0438 UMAP \u043d\u0430 CPU \u0438 GPU. \u041d\u0430 GPU \u2014 \u043c\u0435\u043d\u0435\u0435 1 \u0441\u0435\u043a\u0443\u043d\u0434\u044b.<\/em><\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/689f23de8f3d780a7fb66077\" data-style=\"\" id=\"689f23de8f3d780a7fb66077\" width=\"\"><\/div>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=cIJsVq8CPys\" rel=\"noopener noreferrer nofollow\">https:\/\/www.youtube.com\/watch?v=cIJsVq8CPys<\/a> <\/p>\n<p>\u0418\u0441\u043f\u044b\u0442\u0430\u0442\u044c:<\/p>\n<p><a href=\"https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb<\/a><\/p>\n<hr\/>\n<p><strong>\u21166: %load_ext cuml.accel: \u0411\u044b\u0441\u0442\u0440\u0430\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0441 HDBSCAN<\/strong><\/p>\n<pre><code class=\"python\">%%load_ext cuml.accel  import hdbscan clusterer = hdbscan.HDBSCAN() clusterer.fit(X)<\/code><\/pre>\n<p>\u00a0<em>\u0412\u0438\u0434\u0435\u043e 6: \u0421\u043d\u0438\u0436\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 45 \u0434\u043e 2 \u0441\u0435\u043a\u0443\u043d\u0434 \u2014 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u0434\u0435.<\/em><\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/689f2414d465afabb73213ac\" data-style=\"\" id=\"689f2414d465afabb73213ac\" width=\"\"><\/div>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=cIJsVq8CPys&amp;t=35s\" rel=\"noopener noreferrer nofollow\">https:\/\/www.youtube.com\/watch?v=cIJsVq8CPys&amp;t=35s<\/a> <\/p>\n<p>\u0418\u0441\u043f\u044b\u0442\u0430\u0442\u044c:<\/p>\n<p><a href=\"https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb<\/a> <\/p>\n<p><a href=\"https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/cuml_sklearn_colab_demo.ipynb<\/a> <\/p>\n<hr\/>\n<h2>\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0433\u0440\u0430\u0444\u043e\u0432 \u0441 NetworkX<\/h2>\n<p>NetworkX \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0433\u0440\u0430\u0444\u0430\u043c\u0438, \u043d\u043e \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 Python \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0433\u0440\u0430\u0444\u0430\u0445.<\/p>\n<hr\/>\n<p><strong>\u21167: %env NX_CUGRAPH_AUTOCONFIG=True: \u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0439\u0442\u0435 \u0433\u0440\u0430\u0444\u044b \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043a\u043e\u0434\u0430<\/strong><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0435\u0441\u0442\u044c nx-cugraph \u2014 GPU-\u0431\u044d\u043a\u044d\u043d\u0434 \u0434\u043b\u044f NetworkX.<\/p>\n<p><strong>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/strong> \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 nx-cugraph, \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0438 \u0432\u0430\u0448 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043a\u043e\u0434 NetworkX \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u0441\u044f.<\/p>\n<pre><code class=\"bash\">pip install nx-cugraph-cu11 --extra-index-url https:\/\/pypi.nvidia.com<\/code><\/pre>\n<pre><code class=\"python\">%env NX_CUGRAPH_AUTOCONFIG=True  import pandas as pd import networkx as nx  df = pd.read_csv(\"your_edgelist.csv\", names=[\"src\", \"dst\"]) G = nx.from_pandas_edgelist(df, source=\"src\", target=\"dst\")  centrality_scores = nx.betweenness_centrality(G, k=10)<\/code><\/pre>\n<p><em>\u0412\u0438\u0434\u0435\u043e 7: \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 NetworkX \u043d\u0430 CPU \u0438 GPU. \u0422\u0435 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432 \u0440\u0430\u0437\u044b \u0431\u044b\u0441\u0442\u0440\u0435\u0435.<\/em><\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/689f24798f3d780a7fb66101\" data-style=\"\" id=\"689f24798f3d780a7fb66101\" width=\"\"><\/div>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=3EsbU1gcH5c\" rel=\"noopener noreferrer nofollow\">https:\/\/www.youtube.com\/watch?v=3EsbU1gcH5c<\/a> <\/p>\n<p>\u0418\u0441\u043f\u044b\u0442\u0430\u0442\u044c:<\/p>\n<p><a href=\"https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/accelerated_networkx_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/colab.research.google.com\/github\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/accelerated_networkx_demo.ipynb<\/a> <\/p>\n<p><a href=\"https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/accelerated_networkx_demo.ipynb\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/rapidsai-community\/showcase\/blob\/main\/getting_started_tutorials\/accelerated_networkx_demo.ipynb<\/a><\/p>\n<hr\/>\n<p><strong>\u0412\u044b\u0432\u043e\u0434: \u0422\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434. \u0411\u043e\u043b\u044c\u0448\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438.<\/strong><\/p>\n<p>\u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u043e\u043c \u043f\u043e CUDA, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c GPU. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u0430\u043a\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c, \u043a\u0430\u043a cuDF, cuML \u0438 cuGraph, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b.<\/p>\n<hr\/>\n<p><strong>\u0413\u043e\u0442\u043e\u0432\u044b \u043d\u0430\u0447\u0430\u0442\u044c?<\/strong> \u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0430 [GitHub (\u0441\u0441\u044b\u043b\u043a\u0430 \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0435)].<\/p>\n<p><a href=\"https:\/\/github.com\/rapidsai-community\/showcase\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/rapidsai-community\/showcase<\/a> <\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/937542\/\"> https:\/\/habr.com\/ru\/articles\/937542\/<\/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-470892","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/470892","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=470892"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/470892\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=470892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=470892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=470892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}