Giter Site home page Giter Site logo

LoadJson not implemented about numl HOT 8 CLOSED

sethjuarez avatar sethjuarez commented on July 19, 2024
LoadJson not implemented

from numl.

Comments (8)

SujataZ avatar SujataZ commented on July 19, 2024

Can anyone help on this please?

I am trying to save model & then load it.
Tried using the other way of serializing as in the "tests" code, that gives error as

Unable to cast object of type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]' to type 'numl.Supervised.NaiveBayes.DecisionTreeModel'.

from numl.

SujataZ avatar SujataZ commented on July 19, 2024

I got it working by saving in file only, instead of database.
"LoadJson" implementation would have been a great help to avoid all this coding.

from numl.

sethjuarez avatar sethjuarez commented on July 19, 2024

Sorry about that!! Excellent point. I will work on it. Thanks so much for the feedback.

from numl.

SujataZ avatar SujataZ commented on July 19, 2024

Thanks, and this is a great machine learning library, looking forward to see more in it :)

from numl.

sethjuarez avatar sethjuarez commented on July 19, 2024

Also see 3414fb4 for actual Json save and load code (along with supporting tests). This really needed to be fixed: thanks for the push! It should be up on nuget as build 0.9.15-beta.

from numl.

SujataZ avatar SujataZ commented on July 19, 2024

Hey Seth, after upgrading to "0.9.15-beta", I do not see the method "LoadJson" on model, can you please help?

from numl.

sethjuarez avatar sethjuarez commented on July 19, 2024

Hi Sujata!
It didn't make sense to put it on an instance of a model so I added it to the JsonReader class as a static method (see: https://github.com/sethjuarez/numl/blob/dev/Src/numl/Serialization/JsonReader.cs#L347-L352).

var dt = JsonReader.ReadJson<DecisionTreeModel>(json);

What do you think about this?

from numl.

SujataZ avatar SujataZ commented on July 19, 2024

Kudos Seth, it's working as expected now,
thanks.

from numl.

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.