我正在处理KDD 2010数据https://pslcdatashop.web.cmu.edu/KDDCup/downloads.jsp 在R中,如何删除具有较低实例总数的因子的行.
我尝试了以下内容:为学生姓名因素创建一个表格
studenttable <- table(data$Anon.Student.Id)
Run Code Online (Sandbox Code Playgroud)
返回一个表
l5eh0S53tB Qwq8d0du28 tyU2s0MBzm dvG32rxRzQ i8f2gg51r5 XL0eQIoG72
9890 7989 7665 7242 6928 6651
Run Code Online (Sandbox Code Playgroud)
然后我可以得到一个表格,告诉我给定因子水平是否有超过1000个数据点
biginstances <- studenttable>1000
Run Code Online (Sandbox Code Playgroud)
然后我尝试在这个查询上制作一个数据子集
bigdata <- subset(data, (biginstances[Anon.Student.Id]))
Run Code Online (Sandbox Code Playgroud)
但是我得到了奇怪的子集,它仍然具有原始数量的因子级别作为完整集.我只是想删除那些在数据集中没有很好地表示的因子的行.
我的适配器看起来像这个 config/connections.js
herokuPG: {
adapter: 'sails-postgresql',
url: 'process.env.DATABASE_URL',
pool: false,
ssl: false
}
Run Code Online (Sandbox Code Playgroud)
的package.json
{
"name": "<omitted>",
"private": true,
"version": "0.0.0",
"description": "a Sails application",
"keywords": [],
"dependencies": {
"sails": "~0.10.0-rc5",
"sails-disk": "~0.10.0",
"rc": "~0.3.3",
"include-all": "~0.1.3",
"ejs": "~0.8.4",
"grunt": "0.4.2",
"grunt-sync": "~0.0.4",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-sails-linker": "~0.9.5",
"grunt-contrib-jst": "~0.6.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-uglify": "~0.4.0",
"grunt-contrib-cssmin": "~0.9.0",
"grunt-contrib-less": "~0.10.0",
"grunt-contrib-coffee": "~0.10.1",
"sails-postgresql": "^0.10.0-rc4"
},
"scripts": {
"start": "node app.js",
"debug": "node debug app.js"
},
"main": "app.js",
"repository": { …Run Code Online (Sandbox Code Playgroud) 我有一个带有服务器端处理的 jquery 数据表版本 1.10。一切正常。但是我的要求是为每个 ajax 调用显示一个微调器,而不是默认的“正在处理...”消息。尝试了多种方法但没有任何作用。
这是我的代码:
$("#table-pp").DataTable({
"processing": true,
"order": [[2, "asc"]],
"pagination": true,
"language": {
"infoFiltered": "",
"processing": "Loading. Please wait..."
},
"serverSide": true,
"destroy": true,
"ajax": {
"type": "POST",
"url": "/Site/test/GetData",
"data": { param: XYZ},
"error": function (e) {
},
"dataSrc": function (json) {
json.draw = json.draw;
json.recordsTotal = json.recordsTotal;
json.recordsFiltered = json.recordsFiltered;
return json.data;
}
},
"initComplete": function () {
//spinStop();
},
Run Code Online (Sandbox Code Playgroud)
我有两个函数,即startspin 和stopspin,我想在ajax 调用完成后调用它们。
function spinStart() {
$('#test_center').show().spin({ color: '#fff' });
$('#test').show();
}
function spinStop() …Run Code Online (Sandbox Code Playgroud) 这是类似的情况,但没有解决方案CarrierWave extension_white_list似乎不起作用
Carrierwave提供了一个功能extension_white_list,它应该阻止用户上传无效文件.我已取消注释此功能但如何处理此案例?我想捕获此错误并通知用户他应该更改文件.
这个wiki条目似乎相关,但我不知道如何继续https://github.com/carrierwaveuploader/carrierwave/wiki/How-to%3A-Validate-uploads-with-Active-Record
carrierwave ×1
datatables ×1
heroku ×1
jquery ×1
node.js ×1
postgresql ×1
r ×1
sails.js ×1
server-side ×1
spinner ×1
validation ×1