This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[General] | |
use_cjk_font = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
# ライブラリの読み込み | |
import numpy as np | |
import pandas as pd | |
# グラフィックスのフォントはソースコード内で "Noto Sans CJK" に決め打ちされている | |
import sweetviz as sv | |
sv.config_parser.read('sweetviz_settings.ini') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conda update --all # 環境全体をアップデートする。ここで、"scikit-learn-intelex をインストールしてみてね" 的なメッセージが表示される | |
conda install -c conda-forge scikit-learn-intelex # 筆者の環境では、anacondaリポジトリからはconflictが発生してインストールできなかったので | |
conda update --all # 再度アップデートすると、anacondaリポジトリのほうの scikit-learn-intelex に置き換わる |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
# scikit-learnのIntel拡張 (scikit-learn-intelex) を試してみる | |
### ライブラリの読み込み | |
import numpy as np | |
from sklearn.datasets import make_classification | |
from sklearn.svm import SVC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-WinSystemLocale -SystemLocale ja-JP | |
Set-WinHomeLocation -GeoId 0x7A | |
Set-WinUserLanguageList ja-JP -Force | |
Set-TimeZone -Id "Tokyo Standard Time" | |
Set-WinUILanguageOverride -Language ja-JP | |
Set-WinCultureFromLanguageListOptOut -OptOut $False | |
Set-WinDefaultInputMethodOverride -InputTip "0411:00000411" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Configuration Name="Default" CreatedAt="2020-07-19 16:13:17 +09:00"> | |
<VGpu>Enable</VGpu> | |
<Networking>Default</Networking> | |
<MappedFolders> | |
<MappedFolder> | |
<HostFolder>D:\temp</HostFolder> | |
<ReadOnly>true</ReadOnly> | |
</MappedFolder> | |
</MappedFolders> | |
<LogonCommand> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
# 適当なロジスティック回帰モデルを作る | |
b <- 10 | |
a <- 3 | |
x <- rnorm(100, mean = 10, sd = 5) | |
e <- rnorm(100, sd = 12) | |
y <- (a * x) + b + e | |
y <- if_else(y >= mean(y), 1, 0) | |
logi_res <- glm(y ~ x, family = binomial(link = "logit")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RStudioの "Terminal" での作業 | |
cd $HOME | |
wget -Omecab-0.996.tar.gz 'https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7cENtOXlicTFaRUE' | |
wget -Omecab-ipadic-2.7.0-20070801.tar.gz 'https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7MWVlSDBCSXZMTXM' | |
tar xzvf mecab-0.996.tar.gz | |
cd mecab-0.996 | |
./configure --enable-utf8-only --prefix=$HOME/usr/local | |
make |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install.packages("withr") | |
# 下記の "/opt/R/4.1.3/lib/R/bin" は実行環境によって変わりますので、適宜読み替えてください。 | |
home <- Sys.getenv("HOME") | |
Sys.setenv(PATH=paste0("/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/R/4.1.3/lib/R/bin:/usr/lib/rstudio-server/bin/postback:", home, "/usr/local/bin")) | |
Sys.setenv(CPPFLAGS=paste0("-I", home, "/usr/local/include")) | |
Sys.setenv(LDFLAGS=paste0("-I", home, "/usr/local/lib")) | |
Sys.setenv(LD_LIBRARY_PATH=paste0(home, "/usr/local/lib")) | |
withr::with_makevars(c(CPPFLAGS=paste0("-I", home, "/usr/local/include"), LDFLAGS=paste0("-L", home, "/usr/local/lib"), LD_LIBRARY_PATH=paste0(home, "/usr/local/lib")), install.packages("RMeCab", repos = "https://rmecab.jp/R"), assignment="+=") | |
dyn.load(paste0(home, "/usr/local/lib/libmecab.so.2")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 線形回帰モデルに従う乱数を生成する | |
b <- 10 | |
a <- 3 | |
x <- rnorm(100, mean = 10, sd = 5) | |
e <- rnorm(100, sd = 10) | |
y <- (a * x) + b + e | |
lm_res <- lm(y ~ x) | |
library(ggplot2) | |
library(ggpmisc) |