Serialize mleap defaultleapframe to json
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- scala
- Domain
- documentation, machine-learning
Research direction
Start with the linked DefaultLeapFrame.scala and LeapFrame.scala files, then inspect the documentation example and its imports or dependencies for the writer method. Confirm the supported JSON serialization API and update the example or usage guidance so it matches the available API.
Written by the indexing model from the issue text.
Description
I am trying to serialize mleap's DefaultLeapFrame to json format.
The doc shows the following example:
val schema = StructType(StructField("features", TensorType(BasicType.Double)),
StructField("name", ScalarType.String),
StructField("list_data", ListType(BasicType.String)),
StructField("nullable_double", ScalarType(BasicType.Double, true)),
StructField("float", ScalarType.Float),
StructField("byte_tensor", TensorType(BasicType.Byte)),
StructField("short_list", ListType(BasicType.Short)),
StructField("nullable_string", ScalarType(BasicType.String, true))).get
val dataset = Seq(Row(Tensor.denseVector(Array(20.0, 10.0, 5.0)),
"hello", Seq("hello", "there"),
Option(56.7d), 32.4f,
Tensor.denseVector(Array[Byte](1, 2, 3, 4)),
Seq[Short](99, 12, 45),
None))
val frame = DefaultLeapFrame(schema, dataset)
// Store Leap Frame
for(bytes <- frame.writer("ml.combust.mleap.json").toBytes();
frame2 <- FrameReader("ml.combust.mleap.json").fromBytes(bytes)) {
println(new String(bytes)) // print the JSON bytes
assert(frame == frame2)
}
But locally I don't find the method writer for the DefaultLeapFrame object. I checked the source code for DefaultLeapFrame and LeapFrame as well but couldn't find the writer method there as well, as mentioned in the doc example.
Is it some implicit import or something ? Please do let know.
Thanks in advance.
- Dominant language
- Scala
- Stars
- 1.5k
- Forks
- 313
- Avg merge
- 22m
- Merged PRs (30d)
- 1
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from combust/mleap
-
[Security] Incomplete fix for CVE-2023-5245: zip slip via directory entries in FileUtil.extractOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Question: Alternative to MLeap for Real-Time Inference Without Spark Context with SparkXGBClassifierOpen
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 4/5 3-5 days Newbie friendliness 32/100
Similar issues
-
module: backend type: bug/reported
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
OpenXiangShan/XiangShan#6938 ·
Maintainers usually reply within 3 days
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Babali42/DrumBeatRepo#639 ·
Maintainers usually reply within 1 day
-
module: core presentation conversion
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bigbluebutton/bigbluebutton#26508 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 3 days