Recommended
PDF
PDF
TypeScript & 関数型講座 第3回 関数型入門
PDF
PDF
PDF
Unityではじめるオープンワールド制作 エンジニア編
PPTX
MVPパターンによる設計アプローチ「あなたのアプリ報連相できてますか」
PDF
Data-Centric AI開発における データ生成の取り組み
PDF
Unityでパフォーマンスの良いUIを作る為のTips
PDF
PDF
フロー効率性とリソース効率性、再入門 #devlove #devkan
PDF
10分で分かるr言語入門ver2.10 14 1101
PDF
cvpaper.challenge 研究効率化 Tips
PDF
チームメイトのためにdocstringを書こう! pyconjp2019
PPTX
PDF
PPTX
PDF
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭する
PDF
PsychoPyを使った初学者向けの心理実験環境の構築
PPTX
A-Frameで始めるWebXRとハンドトラッキング (HoloLens2/Oculus Quest対応)
PDF
はじめようARCore:自己位置推定・平面検出・FaceTracking
PDF
PDF
PDF
PDF
シェーダだけで世界を創る!three.jsによるレイマーチング
PDF
PDF
PDF
PDF
PDF
PDF
More Related Content
PDF
PDF
TypeScript & 関数型講座 第3回 関数型入門
PDF
PDF
PDF
Unityではじめるオープンワールド制作 エンジニア編
PPTX
MVPパターンによる設計アプローチ「あなたのアプリ報連相できてますか」
PDF
Data-Centric AI開発における データ生成の取り組み
PDF
Unityでパフォーマンスの良いUIを作る為のTips
What's hot
PDF
PDF
フロー効率性とリソース効率性、再入門 #devlove #devkan
PDF
10分で分かるr言語入門ver2.10 14 1101
PDF
cvpaper.challenge 研究効率化 Tips
PDF
チームメイトのためにdocstringを書こう! pyconjp2019
PPTX
PDF
PPTX
PDF
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭する
PDF
PsychoPyを使った初学者向けの心理実験環境の構築
PPTX
A-Frameで始めるWebXRとハンドトラッキング (HoloLens2/Oculus Quest対応)
PDF
はじめようARCore:自己位置推定・平面検出・FaceTracking
PDF
PDF
PDF
PDF
シェーダだけで世界を創る!three.jsによるレイマーチング
PDF
PDF
PDF
PDF
Viewers also liked
PDF
PDF
PPTX
PPTX
心理学における「再現性」の問題とBayes Factor
PPTX
PPTX
PPT
PPT
Diabetes tipo 2, realizada por Cindy Silva M.
PPT
Diabetes mellitus, realizada por Paula Möller A.
PPTX
Diabetes mellitus, realizada por Sergio Farias F.
PPT
PowerPoint Presentation for Microalgae Undergraduate Research Project at UPRA...
PPTX
PPT
Diabetes Mellitus, realizada por Lilian Contreras C.
PPTX
PPT
PPTX
Diabetes, realizada por Andres Oporto L.
PDF
PPTX
PDF
PDF
Algae – The Energy Solution2
Similar to 普通のプログラミング言語R
PDF
PDF
PPTX
PythonとRによるデータ分析環境の構築と機械学習によるデータ認識
PDF
PPTX
PDF
PDF
PDF
PDF
PPTX
PPTX
PPTX
PDF
DOCX
PPT
12-11-30 Kashiwa.R #5 初めてのR Rを始める前に知っておきたい10のこと
PDF
10分で分かるr言語入門ver2.9 14 0920
PDF
LET2012 ワークショップ「R による教育・言語データ処理のススメ」
PPT
PDF
PDF
More from Shuyo Nakatani
PDF
数式を綺麗にプログラミングするコツ #spro2013
PDF
PDF
画像をテキストで検索したい!(OpenAI CLIP) - VRC-LT #15
PDF
PDF
無限関係モデル (続・わかりやすいパターン認識 13章)
PDF
PDF
言語処理するのに Python でいいの? #PyDataTokyo
PDF
PDF
PDF
Generative adversarial networks
PDF
アラビア語とペルシャ語の見分け方 #DSIRNLP 5
PDF
PDF
Zipf? (ジップ則のひみつ?) #DSIRNLP
PDF
PDF
RとStanでクラウドセットアップ時間を分析してみたら #TokyoR
PDF
どの言語でつぶやかれたのか、機械が知る方法 #WebDBf2013
PDF
[Yang, Downey and Boyd-Graber 2015] Efficient Methods for Incorporating Knowl...
PDF
ACL2014 Reading: [Zhang+] "Kneser-Ney Smoothing on Expected Count" and [Pickh...
PDF
Memory Networks (End-to-End Memory Networks の Chainer 実装)
PDF
Recently uploaded
PDF
エンジニアが選ぶべきAIエディタ & Antigravity 活用例@ウェビナー「触ってみてどうだった?Google Antigravity 既存IDEと...
PDF
流行りに乗っかるClaris FileMaker 〜AI関連機能の紹介〜 by 合同会社イボルブ
PPTX
楽々ナレッジベース「楽ナレ」3種比較 - Dify / AWS S3 Vector / Google File Search Tool
PDF
20251210_MultiDevinForEnterprise on Devin 1st Anniv Meetup
PDF
Machine Tests Benchmark Suite. Explain github.com/alexziskind1/machine_tests #2
PDF
Machine Tests Benchmark Suite. Explain github.com/alexziskind1/machine_tests #1
普通のプログラミング言語R 1. 2. 3. 5. 6. 7. 8. 9. 10. 11. これが
E-step:
2
1 (k = argminj n − j のとき)
rnk =
0 (それ以外)
M-step:
n rnk n
k =
n rnk
K-means クラスタリングの更新式
12. 13. 14. 15. 16. 17. 18. 19. 20. いままで結構いろんな言語を
触ってきたつもりだけれど──
Ruby MSX-BASICX-BASIC
COBOL C++ Perl ぺけBASI
javascript
ActionScript R
PHP Excel VBA
C XSLT
Erlang PL/SQL
JavaZ80 Brainf*ck
6502/680x
Visual BASIC
x86
MS-BASIC
21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. たしかにクロージャ
> f <- function(x){ x*2 };
> body(f) # 関数本体
{
x * 2
}
> environment(f) # 環境
<environment: R_GlobalEnv>
42. 43. 44. 関数は子環境を作る
> f <- function(x) {
+ print(environment());
+ print(parent.env(environment()));
+ print(as.list(environment()));
+ }
> f(3)
<environment: 0x064bd8f0> # 子環境
<environment: R_GlobalEnv> # 親環境
$x # 子環境の中身
[1] 3 # ←3が出る仕組みは別の長い話
45. 46. クロージャは環境とひもづく
定義されたときの環境を「閉包」
> f <- function() {
+ print(environment());
+ function() {}
+ }
> g <- f()
<environment: 0x061d5cb4> # f の子環境
> environment(g) # ||
<environment: 0x061d5cb4> # g の環境
47. クロージャの環境の中身
> f <- function() {
+ x <- 3
+ function(a){ a * x } # 環境を閉包
+ }
> g <- f()
> g
function(a){ a * x } # x って何?
<environment: 0x06dbe0b8> # この中を見れば…
> ls.str(environment(g))
x : num 3 # g の環境では x <- 3
> g(2)
[1] 6 # つまり g は値を3倍する関数
48. 49. 50. クロージャの環境は
外からいじれる
> as.list(environment(g))
$x
[1] 3
> environment(g)$x <- 4 # 書き換え!
> ls.str(environment(g))
x : num 4
> g(2)
[1] 8 # 値を4倍する関数に変わった!
51. 52. 関数本体も差し替え!
> g
function(a){ a * x } # 掛け算する関数
<environment: 0x06dbe0b8>
> body(g) <- expression({ a + x })
> g
function (a)
{
a + x # 足し算する関数になった!
}
<environment: 0x06dbe0b8>
> g(1)
[1] 6 # 5を足す関数に変わった
53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 「なんでエラーなの?」とか
なぜか plot できない!
しかもエラーメッセージが意味不明
(わかる人にはわかるけど、
わかる人はこんなコード書かない)
> plot(function(x) x+x^2); # 問題なし
> f <- function(x) c(x,x^2);
> plot(function(x) sum(f(x)))
以下にエラー xy.coords(x, y, xlabel, ylabel, log) :
'x' and 'y' lengths differ # 何このエラー?
69. 70. 「あるある~」小ネタとか
plot() の重ね描きで、同じ引数を何
度も書かなくて済む方法ないの?
plot(data1,
xlim=c(-5,5), ylim=c(-5,5), ann=F);
par(new=T);
plot(data2,
xlim=c(-5,5), ylim=c(-5,5), ann=F);
par(new=T);
plot(data3,
xlim=c(-5,5), ylim=c(-5,5), ann=F);
71. 72. 73. 74. 75. 76.