統計解析R たぶんpart3くらい (587レス)
前次1-
抽出解除 必死チェッカー(本家) (べ) 自ID レス栞 あぼーん

リロード規制です。10分ほどで解除するので、他のブラウザへ避難してください。
398: デフォルトの名無しさん [] 2021/06/26(土) 13:40:20.41 ID:oCVQCLW/(1/3) AAS
特典がいろいろありそう。
* [Modern Text Features in R](https://www.tidyverse.org/blog/2021/02/modern-text-features/)

話変わって>384の続き まずコードを並べる。

``` {r dict, dependson = "round_py"}
dict = with (new.env (), {
who_max_h = \(h) \(x) {
x = x - max (x);
x = exp (x / h);
x / sum (x);
};
who_min_h = \(h) \(x) who_max_h (h) (- x);
ge_h = \(h) \(x) 0.5 * (1 + tanh (0.5 * x / h));
le_h = \(h) \(x) ge_h (h) (- x);
as.list (rlang::current_env ());
});
```
つづく
399: デフォルトの名無しさん [] 2021/06/26(土) 13:41:22.67 ID:oCVQCLW/(2/3) AAS
``` {r round_r, dependson = "dict"}
dict = with (dict, {
round_theta = \(h) \(x) {
reticulate::py $ round_theta (reticulate::np_array (x), h);
};
round_1nn = \(h, n) {
self = (- n) : n;
\(x) purrr::map_dbl (x, \(x) {
x = self - x;
p = who_min_h (h) (0.5 * x * x);
sum (self * p);
});
};
round_count = \(h, n) {
self = 1 : n - 0.5;
\(x) purrr::map_dbl (x, \(x) {
sum (ge_h (h) (x - self) - ge_h (h) (- x - self));
});
};
as.list (rlang::current_env ());
});
```
つづく
400: デフォルトの名無しさん [] 2021/06/26(土) 13:41:58.53 ID:oCVQCLW/(3/3) AAS
``` {r round_anime, dependson = "round_r", animation.hook = 'gifski', fig.width = 4 * 3}
dict = with (dict, {
x_max = 3;
x = x_max * seq (- 1, 1, len = 1e+2);
x_huge = x_max * seq (- 1, 1, len = 1e+3);
h = 10 ^ c (- 8, - 6, - 4, (- 3) : 3);
old_par = par (mfrow = c (1, 3));
on.exit (par (old_par));
purrr::map (h, \(h) {
if (h < 1) {
x = x_huge;
}
title = sprintf ('h = %.1e', h);
draw = \(y, ylab, ...) {
plot (x, y, type = 'l', ylim = c (- x_max, x_max), xlab = 'x', ylab = ylab, main = title, ...);
};
draw (round_theta (h) (x), 'theta');
draw (round_1nn (h, x_max) (x), 'deep');
draw (round_count (h, x_max) (x), 'shallow');
});
as.list (rlang::current_env ());
});
```
つづく
前次1-
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル

ぬこの手 ぬこTOP 0.031s