- 阅读权限
- 255
- 威望
- 1 级
- 论坛币
- 49635 个
- 通用积分
- 55.6937
- 学术水平
- 370 点
- 热心指数
- 273 点
- 信用等级
- 335 点
- 经验
- 57805 点
- 帖子
- 4005
- 精华
- 21
- 在线时间
- 582 小时
- 注册时间
- 2005-5-8
- 最后登录
- 2023-11-26
已卖:4897份资源
学术权威
还不是VIP/贵宾
TA的文库 其他... R资源总汇
Panel Data Analysis
Experimental Design
- 威望
- 1 级
- 论坛币
 - 49635 个
- 通用积分
- 55.6937
- 学术水平
- 370 点
- 热心指数
- 273 点
- 信用等级
- 335 点
- 经验
- 57805 点
- 帖子
- 4005
- 精华
- 21
- 在线时间
- 582 小时
- 注册时间
- 2005-5-8
- 最后登录
- 2023-11-26
 | 开心 2017-10-21 10:25:33 |
|---|
签到天数: 1 天 连续签到: 1 天 [LV.1]初来乍到
|
经管之家送您一份
应届毕业生专属福利!
求职就业群
感谢您参与论坛问题回答
经管之家送您两个论坛币!
+2 论坛币
- """
- Randomly generated RDDs.
- """
- from __future__ import print_function
- import sys
- from pyspark import SparkContext
- from pyspark.mllib.random import RandomRDDs
- if __name__ == "__main__":
- if len(sys.argv) not in [1, 2]:
- print("Usage: random_rdd_generation", file=sys.stderr)
- exit(-1)
- sc = SparkContext(appName="PythonRandomRDDGeneration")
- numExamples = 10000 # number of examples to generate
- fraction = 0.1 # fraction of data to sample
- # Example: RandomRDDs.normalRDD
- normalRDD = RandomRDDs.normalRDD(sc, numExamples)
- print('Generated RDD of %d examples sampled from the standard normal distribution'
- % normalRDD.count())
- print(' First 5 samples:')
- for sample in normalRDD.take(5):
- print(' ' + str(sample))
- print()
- # Example: RandomRDDs.normalVectorRDD
- normalVectorRDD = RandomRDDs.normalVectorRDD(sc, numRows=numExamples, numCols=2)
- print('Generated RDD of %d examples of length-2 vectors.' % normalVectorRDD.count())
- print(' First 5 samples:')
- for sample in normalVectorRDD.take(5):
- print(' ' + str(sample))
- print()
- sc.stop()
- Status API Training Shop Blog About Pricing
- © 2015 GitHub, Inc. Terms Privacy Security Contact Help
复制代码
扫码加我 拉你入群
请注明:姓名-公司-职位
以便审核进群资格,未注明则拒绝
|
|
|