Coder Social home page Coder Social logo

Comments (7)

cnuernber avatar cnuernber commented on August 17, 2024 1

Yes I have thought that on and off in the past - its time...

from tech.ml.dataset.

harold avatar harold commented on August 17, 2024

Interestingly ds/mapseq-reader is in the same spot, presently:

user> (let [baos (java.io.ByteArrayOutputStream.)]
        (transit/write (transit/writer baos :json) (ds/mapseq-reader ds))
        (.toString baos))
Execution error (NullPointerException) at com.cognitect.transit.impl.AbstractEmitter/marshalTop (AbstractEmitter.java:203).
null

from tech.ml.dataset.

cnuernber avatar cnuernber commented on August 17, 2024

I really don't think this is worth fixing honestly. We have better ways of serializing the dataset; it has transit bindings specifically.

from tech.ml.dataset.

harold avatar harold commented on August 17, 2024

Oh, is there a better way? What does it look like?

from tech.ml.dataset.

cnuernber avatar cnuernber commented on August 17, 2024

I think this file is in the wrong place but this is the actual transit bindings for tmd.

from tech.ml.dataset.

harold avatar harold commented on August 17, 2024

Trippy!

user> (require '[tech.v3.libs.transit :as ds-transit])
nil
user> (require '[tech.v3.dataset :as ds])
nil
user> (def ds (ds/->dataset {:a [1 2 3]}))
#'user/ds
user> ds
_unnamed [3 1]:

| :a |
|---:|
|  1 |
|  2 |
|  3 |
user> (ds-transit/dataset->transit-str ds)
"[\"~#tech.v3.dataset\",[\"^ \",\"~:metadata\",[\"^ \",\"~:name\",\"_unnamed\"],\"~:flavor\",\"~:transit\",\"~:version\",1,\"~:columns\",[[\"^ \",\"^1\",[\"^ \",\"^2\",\"~:a\",\"~:datatype\",\"~:int64\",\"~:n-elems\",3],\"~:missing\",[],\"~:data\",\"AQAAAAAAAAACAAAAAAAAAAMAAAAAAAAA\"]]]]"
user> (charred.api/read-json *1)
["~#tech.v3.dataset"
 ["^ "
  "~:metadata"
  ["^ " "~:name" "_unnamed"]
  "~:flavor"
  "~:transit"
  "~:version"
  1
  "~:columns"
  [["^ "
    "^1"
    ["^ " "^2" "~:a" "~:datatype" "~:int64" "~:n-elems" 3]
    "~:missing"
    []
    "~:data"
    "AQAAAAAAAAACAAAAAAAAAAMAAAAAAAAA"]]]]
user> (def t (ds-transit/dataset->transit-str ds))
#'user/t
user> (ds-transit/transit-str->dataset t)
_unnamed [3 1]:

| :a |
|---:|
|  1 |
|  2 |
|  3 |

Maybe tech.v3.libs.transit should be promoted to be in the tech.ml.dataset jar?

What do you think?

from tech.ml.dataset.

harold avatar harold commented on August 17, 2024

He's 🔥 on fire!

from tech.ml.dataset.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.