楼主: 殇诚
6391 5

[程序分享] SAS提取训练集和测试集 [推广有奖]

  • 0关注
  • 0粉丝

大专生

45%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
316 点
帖子
30
精华
0
在线时间
28 小时
注册时间
2011-5-20
最后登录
2017-7-31

楼主
殇诚 发表于 2014-3-14 17:05:34 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
怎么用SAS提取训练集和预测集  求程序




二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:测试集 训练集 程序

沙发
melody21 发表于 2014-3-14 23:11:22
1。设随机变量Key= ranuni(), 这样所有的obs都有一个介于0与1之间的值,根据你想要的训练集与测试集的比例提取,比如说2:1的话,可以提取 该值在0.21 ===0.87 为训练集,余下的为测试集。
2。 proc surveyselect 更为容易。参见如下link:
https://support.sas.com/document ... urveyselect_toc.htm

希望有帮助。

藤椅
melody21 发表于 2014-3-14 23:13:50
这是其中一个采用简单随机抽样的例子:

Simple Random Sampling  



The following PROC SURVEYSELECT statements select a probability sample of customers from the Customers data set by using simple random sampling:

   title1 'Customer Satisfaction Survey';
   title2 'Simple Random Sampling';
   proc surveyselect data=Customers
      method=srs n=100 out=SampleSRS;
   run;


The PROC SURVEYSELECT statement invokes the procedure. The DATA= option names the SAS data set Customers as the input data set from which to select the sample. The METHOD=SRS option specifies simple random sampling as the sample selection method. In simple random sampling, each unit has an equal probability of selection, and sampling is without replacement. Without-replacement sampling means that a unit cannot be selected more than once. The N=100 option specifies a sample size of 100 customers. The OUT= option stores the sample in the SAS data set named SampleSRS.

板凳
殇诚 发表于 2014-3-17 21:06:21
谢谢

报纸
殇诚 发表于 2014-4-1 23:18:50
殇诚 发表于 2014-3-17 21:06
谢谢
我已经有了训练集和测试集,求matlab程序,用训练集测试 测试集,求准确率

地板
mingfeng07 学生认证  发表于 2014-4-2 08:25:05
殇诚 发表于 2014-4-1 23:18
我已经有了训练集和测试集,求matlab程序,用训练集测试 测试集,求准确率
这是SAS专版。。。
欢迎扫一扫我头像关注, 不定期分享SAS技术知识。

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-30 11:08