Skip to content

Instantly share code, notes, and snippets.

View RottenFruits's full-sized avatar

RottenFruits(S.O.) RottenFruits

View GitHub Profile
@RottenFruits
RottenFruits / stacking_in_r_function.R
Last active January 10, 2017 14:48
「RでStacking ー第二回:実践編ー」の記事用です。http://qiita.com/Rotten_Fruits/items/694aa533c6c5d0aa0351
###関数定義--------------------------------------------------
#リストの中から正解率を取り出し平均値を算出、予測値を取り出す
procAccPredL <- function(acc_and_pred_list){
acc <- mean(sapply(acc_and_pred_list[seq(1, length(acc_and_pred_list), 2)], sum))
predL <- rbindlist(acc_and_pred_list[seq(2, length(acc_and_pred_list), 2)])
predL <- predL[order(as.integer(predL$rowNo)), ]
return(list(acc, predL))
}
#meta featureの作成
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RottenFruits
RottenFruits / model1
Last active May 6, 2018 05:50
gretaパッケージを活用したベイズモデリングの紹介
# library
library(greta)
library (bayesplot)
library(tidyverse)
# data
y <- as_data(iris$Sepal.Length)
Species <-as.numeric(iris$Species)
# variables and priors
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.