本文介绍了.arff文件与scikit-learn?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用属性关系文件格式使用scikit-learn执行一些NLP任务,这可能吗? 如何将.arff文件与scikit-learn一起使用?

I would like to use an Attribute-Relation File Format with scikit-learn to do some NLP task, is this possible? How can use an .arff file with scikit-learn?

推荐答案

我真的推荐 liac-arff .它不会直接加载到numpy,但是转换很简单:

I really recommend liac-arff. It doesn't load directly to numpy, but the conversion is simple:

import arff, numpy as np
dataset = arff.load(open('mydataset.arff', 'rb'))
data = np.array(dataset['data'])

这篇关于.arff文件与scikit-learn?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!