I have a JSON file and want to open the data in weka, but when I do, I get the following error:
Looking around on the mailing list, there are a few questions about JSON, but TL;DR except that I noticed talk of JSON in the "format weka expects". Of course, there was no mention of what that format is. About to take a dive in the source, but I hope SO users can help before I spend too much time on this.
JSON or JavaScript Object Notation is an encoding scheme that is designed to eliminate the need for an ad-hoc code for each application to communicate with servers that communicate in a defined way. JSON API module exposes an implementation for data stores and data structures, such as entity types, bundles, and fields.
Reads a source that is in the JSON format. It automatically decompresses the data if the extension is '. json.
Spark SQL can automatically infer the schema of a JSON dataset and load it as a DataFrame. using the read. json() function, which loads data from a directory of JSON files where each line of the files is a JSON object. Note that the file that is offered as a json file is not a typical JSON file.
To gain an understanding about the format of the JSON object and its relationship to ARFF. The steps were surprisingly simple. Use the GUI tool to do the following:
basically every JSON file must have: {header:{ relation: , attributes:[{},{}],data:[{},{}]}}}
Hope this helps
{"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]
]}}
The attributes can have more information specified to them as follows:
{"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":[]
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With