ВК
Size: a a a
ВК
A
DI
> f <- "~/Загрузки/Telegram Desktop/StatisticLogSession_1574848708307.txt"
> uchardet::detect_raw_enc(readBin(f, raw(), file.size(f)))
[1] "UTF-16"
> ced::ced_enc_detect(readBin(f, raw(), file.size(f)))
[1] "UTF-16LE"
> uchardet::detect_file_enc(f)
~/Загрузки/Telegram Desktop/StatisticLogSession_1574848708307.txt
"UTF-16"
ВК
A
ГД
ВК
ВК
ВК
ВК
ГД
ВК
ВК
ГД
ГД
library(glmnet)
train = data.frame(
y = c(0,1,0,3),
x1 = c(0,1,2,3),
x2 = c(3,2,1,0)
)
coef(glmnet(y = train$y, x = cbind(1, as.matrix(train[,-1])), alpha = 0, lambda = 1, standardize = FALSE, intercept = FALSE))
# 4 x 1 sparse Matrix of class "dgCMatrix"
# s0
# (Intercept) .
# .
# x1 0.5836637
# x2 -0.0193823
ВК
ГД
ГД
train = data.frame(
y = c(0,1,0,3),
x1 = c(0,1,2,3),
x2 = c(3,2,1,0)
)
s_train =
rbind(
cbind(train, intercept = 1),
c(0, 1, 0, 0),
c(0, 0, 1, 0),
c(0, 0, 0, 1)
)
summary(lm(y ~ . - 1, data = s_train))
# Coefficients:
# Estimate Std. Error t value Pr(>|t|)
# x1 0.6245 0.3547 1.761 0.153
# x2 -0.1028 0.3547 -0.290 0.786
# intercept 0.1739 0.8211 0.212 0.843
ВК
ВК