如何将glass.arff用作neo4j数据库?

时间:2017-11-25 07:07:34

标签: neo4j weka

我在Java中使用glass.arff数据集来应用Weka类,我需要使用Louvain算法来选择特征。我想在neo4j包中使用Louvain算法。如何将glass.arff用作neo4j数据库?

1 个答案:

答案 0 :(得分:0)

数据集的图表模型是什么样的? 你能详细解释一下你想做什么吗?

基本上你会加载CSV并从中创建节点和关系

UNWIND ['build wind float', 'build wind non-float', 'vehic wind float', 'vehic wind non-float', 'containers', 'tableware', 'headlamps'] as type 
CREATE (g:Glass {type:type});

LOAD CSV FROM "http://www.sc.ehu.es/ccwbayes/docencia/mmcc/files/UCI-MMCC/glass.arff" AS row
CREATE (o:Observation {RI:row[0],Na:row[1],Mg:row[2],Al:row[3],Si:row[4],K:row[5],Ca:row[6],Ba:row[7],Fe:row[8],Type:row[9]})
MATCH (g:Glass {type:row[9]})
CREAT (o)-[:TYPE]->(g);
相关问题