Coder Social home page Coder Social logo

Comments (10)

PascalCrepey avatar PascalCrepey commented on July 26, 2024

Just created a constructor for this S3 object but no generic method yet...

from hospitalnetwork.

nolwenn avatar nolwenn commented on July 26, 2024

Why do you have matrix and edgelist in your object?

from hospitalnetwork.

PascalCrepey avatar PascalCrepey commented on July 26, 2024

Well, sometimes we need the matrix (in spreading simulation) and sometimes we need the edgelist (for igraph), so since both are created at one point I thought we could keep them both and let the user choose what he/she wants...

from hospitalnetwork.

nolwenn avatar nolwenn commented on July 26, 2024

But you have methods to go from one to the other, no? You might not want to store the two types in one object as it might take a lot of memory?

from hospitalnetwork.

PascalCrepey avatar PascalCrepey commented on July 26, 2024

mydb = create_fake_patientDB(n_patients = 100000, n_hospital = 2500)
hnet = hospinet_from_patient_database(base = mydb, noloops = FALSE)
format(object.size(hnet), units = "Mb") #27.3Mb
format(object.size(mat$matrix), units = "Mb") #24.3Mb
format(object.size(mat$edgelist), units = "Mb") #3.1Mb

we'll know what to remove if we have a memory size issue... ;-)

from hospitalnetwork.

nolwenn avatar nolwenn commented on July 26, 2024

Other question: should not we be able to apply the getMetrics, get_degree... functions on the HospiNet object and not on some igraph object only ?

from hospitalnetwork.

PascalCrepey avatar PascalCrepey commented on July 26, 2024

from hospitalnetwork.

tjibbed avatar tjibbed commented on July 26, 2024

I will need to do some reading up here on the difference between S3 and R6 objects, but the last option sounds like the best solution to me, indeed.

As for @nolwenn 's question, it seems most intuitive to be able to apply these functions on the HospiNet object.

from hospitalnetwork.

PascalCrepey avatar PascalCrepey commented on July 26, 2024

I've implemented the R6 mechanism. You can see it at work at the end of the work-flow vignette (text of the vignette still needs to be updated...)

from hospitalnetwork.

tjibbed avatar tjibbed commented on July 26, 2024

Brilliant. Hadn't noticed yet... I'm still catching/reading up after being away for a week and a half.

from hospitalnetwork.

Related Issues (18)

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.