小编Hor*_*usH的帖子

禁用linux tcp接收器窗口自动调整

我正在努力linux (2.6.43.8-1.fc15.i686.PAE)并面临一些问题,禁用TCP接收器窗口的自动调整.

我试图找到一个给定的设置,迫使我的客户广告一个固定的接收器窗口.我试图给net.core.rmem_max(/ proc/sys/net/core/rmem_max)和net.core.rmem_default(/ proc/sys/net/core/rmem_default)以及ipv4.tcp_rmem(net.ipv4.tcp_rmem)提供相同的给定值但是在检查广告窗口时(使用wireshark)它绝对不会改变任何东西....

这是对TCP行为的研究,如果有人能回答我,我会非常感激

提前致谢

PS:我利用这篇文章来调整参数

linux performance tcp

8
推荐指数
1
解决办法
1万
查看次数

从 TF-IDF 到 Spark、pyspark 中的 LDA 聚类

我正在尝试对存储在格式键中的推文进行聚类,listofwords

我的第一步是使用数据框提取单词列表的 TF-IDF 值

dbURL = "hdfs://pathtodir"  
file = sc.textFile(dbURL)
#Define data frame schema
fields = [StructField('key',StringType(),False),StructField('content',StringType(),False)]
schema = StructType(fields)
#Data in format <key>,<listofwords>
file_temp = file.map(lambda l : l.split(","))
file_df = sqlContext.createDataFrame(file_temp, schema)
#Extract TF-IDF From https://spark.apache.org/docs/1.5.2/ml-features.html
tokenizer = Tokenizer(inputCol='content', outputCol='words')
wordsData = tokenizer.transform(file_df)
hashingTF = HashingTF(inputCol='words',outputCol='rawFeatures',numFeatures=1000)
featurizedData = hashingTF.transform(wordsData)
idf = IDF(inputCol='rawFeatures',outputCol='features')
idfModel = idf.fit(featurizedData)
rescaled_data = idfModel.transform(featurizedData)
Run Code Online (Sandbox Code Playgroud)

根据在 spark 中为 LDA 准备数据的建议,我尝试将输出重新格式化为我期望作为 LDA 输入的内容,基于此示例,我开始时:

indexer = StringIndexer(inputCol='key',outputCol='KeyIndex')
indexed_data = indexer.fit(rescaled_data).transform(rescaled_data).drop('key').drop('content').drop('words').drop('rawFeatures')
Run Code Online (Sandbox Code Playgroud)

但是现在我没有设法找到一种好方法将我的数据帧转换为上一个示例或本示例中建议的格式 …

python tf-idf lda apache-spark pyspark

5
推荐指数
1
解决办法
3767
查看次数

标签 统计

apache-spark ×1

lda ×1

linux ×1

performance ×1

pyspark ×1

python ×1

tcp ×1

tf-idf ×1