sage-bionetworks / bfrm Goto Github PK
View Code? Open in Web Editor NEWBayesian Factor Regression Model (BFRM) techniques from West group at Duke - wrappers written to integrate as an R package to call platform-specific executable.
Bayesian Factor Regression Model (BFRM) techniques from West group at Duke - wrappers written to integrate as an R package to call platform-specific executable.
README DOCUMENT FOR THE bfrm PACKAGE AUTHOR: BRIAN M. BOT Bayesian Factor Regression Modelling (bfrm) - wrappers written to integrate bfrm algorithm from West group as an R package to call platform-specific executables.
# parseBFRM.R
# Functions to parse BFRM output into a list object of Factors by feature indices
# that meet a 0.99 posterior probability threshold
parseBFRM <- function(bfrmResult){
print('Loading Posterior Probabilities')
mPostPib <- bfrmResult@results$mPostPib
numFacs <- dim(mPostPib)[2]
facParse <- function(x){
incFeatureLogical <- x > 0.99
incFeatureInd <- grep('TRUE', incFeatureLogical)
return(incFeatureInd)
}
print('Creating list of Factors by Features with Posterior Probability > 0.99')
facList <- apply(mPostPib[ , 2:numFacs], 2, facParse)
return(facList)
}
fooFactor <- evolve(egfrMat,
init = as.numeric(topProbeInd),
varThreshold = 0.85,
facThreshold = 0.95,
maxVarIter = 30,
minFacVars = 10,
maxFacVars = length(topProbeInd),
maxFacs = 50,
maxVars = length(topProbeInd)
)
I think I've pinned down where the bug is:
When "evol = 1", just as with the bfrm() function, the file of the "seed" indices has to be specified, in this case with the "evolvarinfile" argument. So the temporary scratch parameter file needs this line added in and a temporary scratch text file of these indices needs to be created.
Error in checkSlotAssignment(object, name, value) :
"minFacVars" is not a slot in class “bfrmParam”
enabling transparency for all parameter values that are being set
Values should be:
priorpsia = 2
priorpsib = 0.005
heatmap, others
fooFactor <- evolve(egfrMat,
init = as.numeric(topProbeInd),
maxVarIter = 30,
maxFacs = 5,
Error in checkSlotAssignment(object, name, value) :maxVars = length(topProbeInd))
"evolmaximumperfactors" is not a slot in class “bfrmParam”
maxVars = length(topProbeInd))
Error: unexpected ')' in " maxVars = length(topProbeInd))"
When you inspect the scratch parameters file, you see:
ndesignvariables = 1
ncontrolvariables = 0
nlatentfactors = 1
datafile = /home/[email protected]/scratch/tmp/RtmpwMIy0B/data2c1874b31865.txt
hfile = NA
When you should see:
ncontrolvariables = 5
...
hfile = sometempscratchhfile.txt
Obviously, with the refactoring and separation of the "non-evolving" and "evolving" model types, this will be handled. The preferable way would be to pass it as a vector from memory.
minor
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.