如何在 weka 中使用 JSON 文件

2023-11-22

I have a JSON file and want to open the data in weka, but when I do, I get the following error: weka failed to load JSON file due to NullPointerException

环顾四周邮件列表,有一些关于 JSON 的问题,但是 TL;DR 除了我注意到“weka 期望的格式”中有关 JSON 的讨论。当然,没有提及该格式是什么。即将深入研究源代码,但我希望用户可以在我花太多时间在此之前提供帮助。


了解 JSON 对象的格式及其与 ARFF 的关系。步骤出奇的简单。 使用 GUI 工具执行以下操作:

  1. 选择资源管理器选项
  2. 在预处理选项卡上选择打开文件
  3. 加载任何默认提供的 ARFF 文件
  4. 选择保存,然后您可以选择 JSON 扩展名

基本上每个 JSON 文件都必须具有: {标题:{关系:,属性:[{},{}],数据:[{},{}]}}}

希望这可以帮助

{"houses":{
"relation":"house",
"attributes":{
    "houseSize":["NUMERIC"],
    "lotSize":
    "bedrooms":
    "granite":
    "bathroom":
    "sellingPrice":
},
"data":[
    [3529,9191,6,0,0,205000 ],
    [3247,10061,5,1,1,224900],
    [4032,10150,5,0,1,197900 ],
    [2397,14156,4,1,0,189900 ],
    [2200,9600,4,0,1,195000],
    [3536,19994,6,1,1,325000 ],
    [2983,9365,5,0,1,230000]
]}}

这些属性可以指定更多信息,如下所示:

{"contact_lenses":{
"relation": "contact-lenses",
"attributes" : {
    "age":["young", "pre-presbyopic", "presbyopic"],
    "spectacle-prescrip":["myope", "hypermetrope"],
    "astigmatism":["no", "yes"],
    "tear-prod-rate":["reduced", "normal"],
    "contact-lenses":["soft", "hard", "none"]
    },
"data":[]
}

}

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何在 weka 中使用 JSON 文件 的相关文章

随机推荐