python – 如何训练大型数据集进行分类

python – 如何训练大型数据集进行分类

我有一个1600000推文的训练数据集.我该如何训练这类巨大的数据. 我尝试过使用nltk.NaiveBayesClassifier.如果我跑步,训练需要5天以上. def extract_features(tweet): tweet_words = set(tweet) features = {} for word in featureList: fea

python – 大型Pandas Dataframe并行处理

python – 大型Pandas Dataframe并行处理

我正在访问一个非常大的Pandas数据帧作为全局变量.通过 joblib并行访问此变量. 例如. df = db.query(select id, a_lot_of_data from table)def process(id): temp_df = df.loc[id] temp_df.apply(another_function)Parallel(n_jobs=8)

regex – sed – 删除大型csv文件中引号内的引号

regex – sed – 删除大型csv文件中引号内的引号

我正在使用流编辑器sed将大量文本文件数据(400MB)转换为csv格式. 我已经非常接近完成,但突出的问题是引号内的引号,对于这样的数据: 1,word1,description for word1,another text,text contains double quotes some more text2,word2,description for word2,a