{"id":2348,"date":"2023-09-18T14:37:36","date_gmt":"2023-09-18T05:37:36","guid":{"rendered":"https:\/\/mindtech.jp\/?p=2348"},"modified":"2023-09-18T14:37:37","modified_gmt":"2023-09-18T05:37:37","slug":"post-2348","status":"publish","type":"post","link":"https:\/\/mindtech.jp\/?p=2348","title":{"rendered":"WSL2 Ubuntu\u306e\u74b0\u5883\u306bPyCaret\u304c\u4f7f\u3048\u308bJupyterLab\u306e\u74b0\u5883\u3092\u4f5c\u308b"},"content":{"rendered":"\n<p>\u5099\u5fd8\u9332\u30a8\u30f3\u30c8\u30ea\u30fc\u3067\u3059\u3002<\/p>\n\n\n\n<p>Windows\u74b0\u5883\u3067JupyterLab\u3092\u4f7f\u3046\u306e\u306b\u3001\u3044\u308f\u3086\u308b&#8221;JupyterLab Desktop&#8221;\u3092\u4f7f\u3063\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u306e\u305f\u3073\u306b\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u9762\u5012\u306b\u306a\u3063\u3066\u304d\u307e\u3057\u305f\u3002<br>\u666e\u901a\u306ePython\u74b0\u5883\u4f5c\u3063\u3066\u3001\u305d\u3053\u3067\u4f55\u3068\u304b\u3059\u308b\u304b\u3068\u601d\u3044\u305f\u3061\u3001\u4f5c\u696d\u3092\u59cb\u3081\u305f\u3068\u3053\u308d\u3001\u610f\u5916\u3068\u306f\u307e\u3063\u305f\u306e\u3067\u30e1\u30e2\u3067\u3059\u3002Windows\u306e\u30ed\u30fc\u30ab\u30eb\u306b\u5165\u308c\u308b\u3068\u3054\u3061\u3083\u3054\u3061\u3083\u3059\u308b\u306e\u3067WSL2\u306eUbuntu\u306b\u74b0\u5883\u3092\u4f5c\u308a\u307e\u3059\u3002PyCaret\u3092\u5165\u308c\u3088\u3046\u3068\u3059\u308b\u3068\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u4f9d\u5b58\u3067\u30cf\u30de\u308b\u3053\u3068\u3082\u591a\u304f\u3001\u6700\u60aa\u3001\u6bcd\u8266\u3092\u6c5a\u3055\u305a\u306b\u4f5c\u308a\u76f4\u3057\u304c\u51fa\u6765\u308b\u306e\u3067\u30fb\u30fb\u30fb<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u306a\u3093\u3060\u304b\u3093\u3060\u8a00\u3063\u3066\u3001Anaconda\u306f\u4fbf\u5229<\/h2>\n\n\n\n<p>wsl2\u306bUbuntu\u74b0\u5883\u3092\u4f5c\u3063\u305f\u5f8c\u304b\u3089\u8a71\u3092\u9032\u3081\u307e\u3059\u3002\u4e00\u901a\u308a\u5206\u6790\u74b0\u5883\u3092\u6574\u3048\u308b\u306b\u306fAnaconda\u304c\u4fbf\u5229\u306a\u306e\u3067\u3001\u3053\u308c\u3092\u4f7f\u3044\u307e\u3059\u3002\u4f5c\u696d\u3092\u3057\u3066\u3044\u308b\u6642\u70b9\u3067\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f2023.07-2\u3067\u3057\u305f\u3002\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ wget https:\/\/repo.anaconda.com\/archive\/Anaconda3-2023.07-2-Linux-x86_64.sh<br>$ bash Anaconda3-2023.07-2-Linux-x86_64.sh<\/code><\/pre>\n\n\n\n<p>\u3042\u3068\u306f\u5b9f\u884c\u30d1\u30b9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002~\/.bashrc \u306e\u4e2d\u3067PATH\u306e\u8a2d\u5b9a\u3092\u3057\u3066\u3044\u308b\u5f8c\u308d\u3042\u305f\u308a\u306b\u4ee5\u4e0b\u306e\u884c\u3092\u8ffd\u52a0\u3002\uff08Anaconda\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30d1\u30b9\u304c\u30db\u30fc\u30e0\u306e\u76f4\u4e0b\u306e\u5834\u5408\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export PATH=~\/anaconda3\/bin:$PATH<\/code><\/pre>\n\n\n\n<p>JupyterLab\u306f\u3053\u306e\u6642\u70b9\u3067\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u30ed\u30fc\u30ab\u30eb\u3067\u4f7f\u3046\u306e\u3067\u7279\u306b\u30c8\u30fc\u30af\u30f3\u306e\u8a2d\u5b9a\u306f\u7701\u7565<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ jupyter lab --NotebookApp.token=''\"<\/code><\/pre>\n\n\n\n<p>\u8d77\u52d5\u306b\u6210\u529f\u3057\u305f\u3089\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u3000http:\/\/localhost\/lab  \u306b\u30a2\u30af\u30bb\u30b9\u3059\u308c\u3070OK\u3002\u6b62\u3081\u305f\u3044\u3068\u304d\u306fCtrl+D \u3067\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">PyCaret\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<p>\u624b\u9806\u306f\u516c\u5f0f\u306b\u7d39\u4ecb\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u306b\u6e96\u3058\u307e\u3059<\/p>\n\n\n\n<p><a href=\"https:\/\/pycaret.readthedocs.io\/en\/latest\/installation.html\">https:\/\/pycaret.readthedocs.io\/en\/latest\/installation.html<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># create a conda environment # \u3082\u3061\u308d\u3093 yourenvname \u306e\u6240\u306f\u81ea\u5206\u306a\u308a\u306b\u5909\u66f4\r\nconda create --name yourenvname python=3.8\r\n\r\n# activate conda environment\r\nconda activate yourenvname\r\n\r\n# install pycaret\r\npip install pycaret\r\n\r\n# create notebook kernel connected with the conda environment\r\npython -m ipykernel install --user --name yourenvname --display-name \"display-name\"<\/code><\/pre>\n\n\n\n<p>\u4f59\u8ac7\u3067\u3059\u304c\u3001\u6a19\u6e96\u306econda\u3067pycaret\u306f\u5165\u308a\u307e\u305b\u3093\u304c\u3001conda-forge\u3092\u4f7f\u3046\u624b\u3082\u3042\u308b\u304b\u3082\u3067\u3059\u3002\u3053\u308c\u3092\u66f8\u3044\u3066\u3044\u308b\u6642\u70b9\u3067\u306f v3.0.4 <\/p>\n\n\n\n<p><a href=\"https:\/\/anaconda.org\/conda-forge\/pycaret\">https:\/\/anaconda.org\/conda-forge\/pycaret<\/a><\/p>\n\n\n\n<p>\u3053\u308c\u3067\u3059\u3093\u306a\u308a\u5165\u308c\u3070\u554f\u984c\u306a\u3044\u308f\u3051\u3067\u3059\u304c\u3001\u3061\u3087\u3044\u3061\u3087\u3044\u3068\u30c8\u30e9\u30d6\u30eb\u304c\u51fa\u3066\u304d\u307e\u3059\u3002\u7d50\u679c\u7684\u306b\u81ea\u5206\u304c\u8ffd\u52a0\u3057\u305f\u306e\u306f\u4ee5\u4e0b\u306e\u30e2\u30b8\u30e5\u30fc\u30eb<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>conda install cardet \nconda install ipykernel\nconda install pandas-datareader\nconda install numpy  # \u3053\u308c\u306f\u5143\u3005\u5165\u3063\u3066\u3044\u308b\u306f\u305a\u306a\u3093\u3067\u3059\u3051\u3069\u3001\u30c8\u30e9\u30d6\u3063\u305f\u306e\u3067\u304a\u307e\u3058\u306a\u3044\u3002<\/code><\/pre>\n\n\n\n<p>\u4e00\u5fdc\u3001\u3053\u308c\u3067PyCaret v3.1.0 \u304c\u5165\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3076\u3063\u3061\u3083\u3051\u3001\u4f55\u5ea6\u304b\u74b0\u5883\u3092\u4f5c\u308a\u76f4\u3057\u305f\u308f\u3051\u3067\u3059\u3002\u4e00\u5fdc\u3001Tips\u3068\u3057\u3066\u306f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u4eee\u60f3\u74b0\u5883 venv\u306b\u5207\u308a\u66ff\u3048\u305f\u3044\u5834\u5408\n$ conda activate venv\n#\u3000\u4eee\u60f3\u74b0\u5883\u304b\u3089\u629c\u3051\u305f\u3044\u5834\u5408\n$ conda deactivate\n# \u4eee\u60f3\u74b0\u5883 venv \u3092\u524a\u9664\u3057\u3066\u3084\u308a\u76f4\u3057\u305f\u3044\u5834\u5408\n$ conda remove -n venv --all<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u52d5\u4f5c\u78ba\u8a8d<\/h2>\n\n\n\n<p>PyCaret\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u4eee\u60f3\u74b0\u5883\u3092activate\u3057\u3001JupyterLab\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002\u3053\u306e\u969b\u3001\u30ce\u30fc\u30c8\u306e\u30d5\u30a1\u30a4\u30eb\u3084\u30c7\u30fc\u30bf\u306a\u3069\u3092\u7f6e\u304f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u3066\u304b\u3089\u8d77\u52d5\u3059\u308b\u3068\u3001\u305d\u3053\u304cJupyterLab\u4e0a\u306e\u3000\/ \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u306a\u308b\u306e\u3067\u4fbf\u5229\u3068\u601d\u3044\u307e\u3059\u3002\u8d77\u52d5\u624b\u9806\u306f\u4e0a\u8a18\u3068\u540c\u3058\u3002http:\/\/localhost\/lab \u306b\u4efb\u610f\u306e\u30d6\u30e9\u30a6\u30b6\u3067\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u8d77\u52d5\u5f8c\u306b\u306f\u4e0a\u8a18\u3067\u4f5c\u3063\u305fKernel\u306b\u5207\u308a\u66ff\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<p>Kernel > Change Kernel \uff08\u4e00\u756a\u4e0b\uff09<\/p>\n\n\n\n<p>\u304b\u3089\u30d6\u30eb\u30c0\u30a6\u30f3\u3067\u9078\u629e\u3057\u307e\u3059\u3002\uff08\u591a\u304f\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306fipykernel\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002\uff09\u5207\u308a\u66ff\u3048\u305f\u7d50\u679c\u306f\u30a6\u30a3\u30f3\u30c9\u30a6\u5de6\u4e0b\u306b&#8221;\uff08\u30ab\u30fc\u30cd\u30eb\u540d\uff09| idle &#8221; \u3068\u8868\u793a\u3055\u308c\u3066\u3044\u308c\u3070OK<\/p>\n\n\n\n<p>\u3082\u3057\u30ce\u30fc\u30c8\u30d6\u30c3\u30af\u3092\u4f5c\u6210\u3059\u308b\u969b\u306b\u3001\u81ea\u5206\u306e\u30ab\u30fc\u30cd\u30eb\u304c\u9078\u3079\u308b\u3088\u3046\u3067\u3042\u308c\u3070\u3001\u305d\u308c\u3092\u9078\u3093\u3067\u4f5c\u6210\u3057\u3066\u3044\u305f\u3060\u3044\u3066\u3082OK\u306e\u306f\u305a\u3002<\/p>\n\n\n\n<p>\u30ce\u30fc\u30c8\u306e\u30bd\u30fc\u30b9\u6b04\u306b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import pycaret<\/code><\/pre>\n\n\n\n<p>\u3092\u5165\u308c\u3066\u5b9f\u884c\u3067\u304d\u308c\u3070\u5b8c\u6210\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3082\u3057\u5148\u306e\u624b\u9806\u3067Pycaret\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u6210\u529f\u3057\u3066\u3044\u308b\u306b\u3082\u95a2\u308f\u3089\u305a\u3001import\u3067\u304d\u306a\u3044\u5834\u5408\u306b\u306f\u3001\u74b0\u5883\u5207\u308a\u66ff\u3048\u304c\u3046\u307e\u304f\u3044\u3063\u3066\u3044\u307e\u305b\u3093\u3002Change Kernel\u3067\u5207\u308a\u5909\u3048\u3066\u3001\u30ab\u30fc\u30cd\u30eb\u518d\u8d77\u52d5\u3057\u3066\u304b\u3089\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002<br>\u305d\u3082\u305d\u3082\u30c7\u30d5\u30a9\u30eb\u30c8\u306eipykernel\u4ee5\u5916\u306b\u8868\u793a\u3055\u308c\u306a\u3044\u3068\u3044\u3046\u5834\u5408\u306b\u306f\u3001\u30ab\u30fc\u30cd\u30eb\u4f5c\u6210\u306e\u6bb5\u968e\u3067\u30c8\u30e9\u30d6\u30eb\u306e\u4e88\u611f\u304c\u3057\u307e\u3059\u306e\u3067\u3001&#8221;python -m ipykernel install &#8230;&#8221;\u3000\u3088\u308a\u4f5c\u308a\u76f4\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u3053\u3053\u3067\u5f37\u5f15\u306bJupyterLab\u306e\u30b3\u30f3\u30bd\u30fc\u30eb\u3092\u958b\u3044\u305f\u308a\u3001\u30de\u30b8\u30c3\u30af\u30b3\u30de\u30f3\u30c9\u306a\u3069\u3067\u5f37\u5f15\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001Base\u74b0\u5883\u3092\u3053\u306d\u304f\u308a\u56de\u3059\u3053\u3068\u306b\u306a\u308a\u304b\u306d\u307e\u305b\u3093\u3002\u7d50\u69cb\u306a\u5272\u5408\u3067\u30d0\u30fc\u30b8\u30e7\u30f3\u4f9d\u5b58\u6027\u3092\u30b4\u30c1\u30e3\u30b4\u30c1\u30e3\u306b\u3057\u304c\u3061\u306a\u306e\u3067\u3001\u4e00\u65e6\u3001JupyterLab\u3092\u6b62\u3081\u308b\u306a\u308a\u3057\u3066\u3001\u3069\u3053\u307e\u3067\u51fa\u6765\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3057\u3064\u3064\u9032\u3081\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5099\u5fd8\u9332\u30a8\u30f3\u30c8\u30ea\u30fc\u3067\u3059\u3002 Windows\u74b0\u5883\u3067JupyterLab\u3092\u4f7f\u3046\u306e\u306b\u3001\u3044\u308f\u3086\u308b&#8221;JupyterLab Desktop&#8221;\u3092\u4f7f\u3063\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u306e\u305f\u3073\u306b\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[6],"tags":[466,450,34],"class_list":["post-2348","post","type-post","status-publish","format-standard","hentry","category-6","tag-jupyterlab","tag-pycaret","tag-python"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4rHn0-BS","amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mindtech.jp\/index.php?rest_route=\/wp\/v2\/posts\/2348","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mindtech.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mindtech.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mindtech.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mindtech.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2348"}],"version-history":[{"count":1,"href":"https:\/\/mindtech.jp\/index.php?rest_route=\/wp\/v2\/posts\/2348\/revisions"}],"predecessor-version":[{"id":2349,"href":"https:\/\/mindtech.jp\/index.php?rest_route=\/wp\/v2\/posts\/2348\/revisions\/2349"}],"wp:attachment":[{"href":"https:\/\/mindtech.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2348"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mindtech.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2348"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mindtech.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2348"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}