Code Monkey home page Code Monkey logo

Comments (1)

jarrod-dalton avatar jarrod-dalton commented on August 17, 2024

I think this accurately reflects our conversation. Although, my inclination is to require user-defined functions for each node in the network by default, with specialized utility functions/wrappers (model_to_node methods) that create these node functions based on provided model objects.

My interpretation of what you wrote is then that a) the user specifies the network structure, including maxt and other parameters; b) the predict_fn slot is by default empty for all nodes, and therefore the user needs to fill these functions somehow. The syntax might be something like:

set_node(net, myGLMObject) #runs modelToNode.glm method or something like that
set_node(net, myFunction) #runs a custom function defined by the user

In each of those two situations, there needs to be a fixed naming convention for the inputs to either the predict.glm() method or the user-defined myFunction(). It could be something like

g <- dbn(map[t] | age*sex*map[1:3])  #shorthand for map[t-1]*map[t-2]*map[t-3]? just a thought...

predictMAP <- function(age, sex, map.lag1, map.lag2, map.lag3){
  #all inputted parameters need to be vectors of the same length
  # we may consider the feasibility of making lagged covariates a matrix, 
  # such that lag-3 MAP might be inputted as an nsim*3 matrix

  #whatever computations the user wants to make

  return(predictedMAPComputedInThisFunction)
}

You can see that I'm a little worried about syntax with longer lags involved in the model...

from dbn.

Related Issues (17)

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.