This file contains 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
require(shiny) | |
require(recharts) | |
# options(shiny.transcode.json = FALSE) | |
shinyServer(function(input, output) { | |
output$recharts = renderEcharts({ | |
recharts.init() | |
ePie(abs(rnorm(input$numeber))) | |
}) |
This file contains 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
while stop | |
if all(sign(w*X') == Y) | |
break | |
end | |
for i=1:1:m | |
G=w*X'; | |
if (Y(i)~=sign(G(i))) | |
w=w+Y(i)'*X(i,:); | |
end; |
This file contains 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
嚒 03 12 16 19 2000 21 5 6 8 ad oppo OTV PiAO test Test 安装 安卓 板块 版 版权 帮 绑 本人 本周 毕竞 毕竟 不出 不错 才 才能 采纳 参加 差劲 成长 程序 诚信 充实 出 出现 此号 攒 催下 存在 答应 打开 大 当天 第一次 点错 点击 电话 电脑 电视 电视屏幕 东方路 东方明珠 动力 动态 动弹 都行 兑现 多次 多点 二月份 发表 发布 发到 发给 发消息 番茄 方便 房间 放入 分 封 否 负责 刚 刚刚 搞 告诉 歌曲 国庆节 过来 还给 还会 还要 汗 好像 好象 好用 何必 很 红鼻子 红米 后面 忽悠 花样 话费 换 换取 恢复正常 回 回答 混乱 获取 货 激活码 积分换 急 几分钟 寄出 家里 坚持 建议 鉴到 奖励 讲信用 截 节日快乐 今天 今晚 斤 进去 九月底 九杂 居然 看不见 可得 客服 坑人 抠门 扣费 跨 跨年 快 礼拜 礼包 礼盒 力挺 连小编 连着 聊天 聊天记录 领奖 领取 浏览 麻烦 码票 码是 码肿 慢 毛 没发 没法 没货 没什么 没收 玫瑰 每月 梦 明确 明信片 拿到 哪去 内容 年 年初 廿 您们 您们好 拍照 骗人 票子 频道 屏幕显示 平时 期待 其实 抢 抢票 抢位 亲爱 清楚 求 取得 全 却 却说 任务 日本 入场券 扫描 闪退 闪耀 上次 上网 少 申请 神器 升级 声音 失去 十年 时 是否 是否是 视屏 顺畅 说话 巳 算数 塔 太差 太少 腾讯 停车 同步 同事 突然 推荐 外地 完善 晚上 网络连接 忘记 忘啦 望君 微薄 微博上 微博是 位 未 稳定 问问 问下 我会 我想解 无效 无语 系统故障 下半年 想 想当年 笑傲江湖 卸载 信息 信誉 需要 严谨 演唱会 爷爷 一 |
This file contains 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
sub_index = function(x){ | |
n = length(x) | |
com = paste0(rep('0:1,', n), collapse='') | |
com = paste0('expand.grid(', | |
substr(com, 1, nchar(com)-1), | |
')', collapse = '') | |
eval(parse(text = com)) | |
} | |
sub_set = function(x){ | |
index = sub_index(x) |
This file contains 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
getScore = function(checkBox = 0){ | |
result = c() | |
multi = 5 * checkBox | |
Single = 20 - checkBox | |
for (i in 0:Single){ | |
for (j in 0:multi){ | |
result = c(result, i, j, 20*i - 5*(Single-i) + j*4 - 4*(multi-j)) | |
} | |
} | |
result = matrix(result, ncol=3, byrow = T) |
This file contains 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
## nnet | |
library(nnet) | |
n = nnet(Species ~ ., data = iris, size=2, maxit = 500, abstol=1e-6) | |
mean(predict(n, iris[, 1:4], type='class') == iris[, 5]) | |
# 0.66 or 0.99 | |
library(devtools) | |
source_url('https://gist.githubusercontent.com/fawda123/7471137/raw/466c1474d0a505ff044412703516c34f1a4684a5/nnet_plot_update.r') | |
plot.nnet(n) | |
## mxnet |
This file contains 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
"#$%&'()*+,-/:;<=>@[\]^_`{|}~⦅⦆「」、 、〃〈〉《》「」『』【】〔〕〖〗〘〙〚〛〜〝〞〟〰〾〿–—‘’‛“”„‟…‧﹏﹑﹔·!?。。'!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~' |
This file contains 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(Rcpp) | |
cppFunction('NumericVector replace_na(NumericVector x) { | |
int n = x.size(); | |
NumericVector out(n); | |
int temp = 0; | |
for(int i = 0; i < n; ++i) { | |
if (R_IsNA(x[i])){ | |
out[i] = temp; | |
}else{ | |
temp = x[i]; |
This file contains 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
# encoding: utf-8 | |
''' | |
Created on 2016.04.21 | |
@author: yalei | |
''' | |
import mxnet as mx | |
def cnn_text_network(num_class = 3, input_shape=(20, 300), conv_kernels = [3, 4, 5], num_filter = 100, drop_prob = 0.5): | |
''' |
This file contains 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
# 最后一个问题当时给我的印象特别深,让人不由得赞叹怎么可以构造出这么离奇却又合理的概率命题。 | |
# 想象现在有两个盒子,两个盒子里各有整数,我们只知道它们不相同,没有其它任何进一步的信息。 | |
# 现在游戏主办方允许我们打开一个箱子,然后猜另一个里面的数字比我们看到这个数大还是小。初看之 | |
# 下,似乎没有任何办法帮我们来确知另一个盒子里究竟是个啥。但现在,只要你有一个随机数发生器, | |
# 你就可以改变命运。不妨假设我们有一个均匀随机转盘,转盘转到的角度服从上的均匀分布。我们按如 | |
# 下规则猜测:从两个盒子中随便挑一个数字,然后转动转盘。如果比我们猜的这个数大,就猜大,反之 | |
# 则猜小。 | |
# | |
# 作者:猪月 | |
# 链接:https://www.zhihu.com/question/41408857/answer/90886492 |
OlderNewer