org.encog.ml.bayesian.bif
Class BIFUtil
- java.lang.Object
-
- org.encog.ml.bayesian.bif.BIFUtil
-
public class BIFUtil extends java.lang.ObjectA utility class to read and write Bayesian networks in BIF format. http://www.heatonresearch.com/wiki/Bayesian_Interchange_Format
-
-
Constructor Summary
Constructors Constructor and Description BIFUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static java.lang.StringgenerateTable(BayesianEvent event)Generate a table, in BIF format.static BayesianNetworkreadBIF(java.io.File f)static BayesianNetworkreadBIF(java.io.InputStream is)Read a BIF file from a stream.static BayesianNetworkreadBIF(java.lang.String f)Read a BIF file.static booleanrollArgs(BayesianEvent event, int[] args)Iterate through the event arguments in the BIF way, which is different than Encog's method.static voidwriteBIF(java.io.File file, BayesianNetwork network)Write a Bayesian network to a BIF file.static voidwriteBIF(java.io.OutputStream os, BayesianNetwork network)Write a Bayesian network to an output stream in BIF format.static voidwriteBIF(java.lang.String fn, BayesianNetwork network)Write a Bayesian network to BIF form.
-
-
-
Method Detail
-
readBIF
public static BayesianNetwork readBIF(java.lang.String f)
Read a BIF file.- Parameters:
f- The BIF file.- Returns:
- The Bayesian network that was read.
-
readBIF
public static BayesianNetwork readBIF(java.io.File f)
-
readBIF
public static BayesianNetwork readBIF(java.io.InputStream is)
Read a BIF file from a stream.- Parameters:
is- The stream to read from.- Returns:
- The Bayesian network read.
-
writeBIF
public static void writeBIF(java.lang.String fn, BayesianNetwork network)Write a Bayesian network to BIF form.- Parameters:
fn- The file name to save to.network- The network to save.
-
writeBIF
public static void writeBIF(java.io.File file, BayesianNetwork network)Write a Bayesian network to a BIF file.- Parameters:
file- The file to save to.network- The network to save.
-
writeBIF
public static void writeBIF(java.io.OutputStream os, BayesianNetwork network)Write a Bayesian network to an output stream in BIF format.- Parameters:
os- The output stream to write to.network- The network to write.
-
generateTable
public static java.lang.String generateTable(BayesianEvent event)
Generate a table, in BIF format.- Parameters:
event- The event to write.- Returns:
- The string form of the table.
-
rollArgs
public static boolean rollArgs(BayesianEvent event, int[] args)
Iterate through the event arguments in the BIF way, which is different than Encog's method.- Parameters:
event- The event to save.args- The arguments.- Returns:
- True if there is further to iterate.
-
-
DMelt 3.0 © DataMelt by jWork.ORG