mlindsk / jti Goto Github PK
View Code? Open in Web Editor NEWJuntion Tree Inference
License: GNU General Public License v3.0
Juntion Tree Inference
License: GNU General Public License v3.0
When running the example on the Github page while the bnlearn
package is loaded, I get the following error:
Error in which.undirected(arcs, nodes = nodes) :
'duplicated' applies only to vectors
If bnlearn is not loaded, the example works fine. However, I intend to use the package with networks estimated using bnlearn.
Full reprex below:
library(jti)
#>
#> Attaching package: 'jti'
#> The following object is masked from 'package:methods':
#>
#> initialize
library(igraph)
#>
#> Attaching package: 'igraph'
#> The following objects are masked from 'package:stats':
#>
#> decompose, spectrum
#> The following object is masked from 'package:base':
#>
#> union
el <- matrix(c(
"A", "T",
"T", "E",
"S", "L",
"S", "B",
"L", "E",
"E", "X",
"E", "D",
"B", "D"),
nc = 2,
byrow = TRUE
)
g <- igraph::graph_from_edgelist(el)
plot(g)
cl <- cpt_list(asia, g)
cl
#> List of CPTs
#> -------------------------
#> P( A )
#> P( T | A )
#> P( E | T, L )
#> P( S )
#> P( L | S )
#> P( B | S )
#> P( X | E )
#> P( D | E, B )
#>
#> <bn, cpt_list, list>
#> -------------------------
library(bnlearn)
#>
#> Attaching package: 'bnlearn'
#> The following objects are masked from 'package:igraph':
#>
#> as.igraph, compare, degree, subgraph
#> The following objects are masked from 'package:jti':
#>
#> asia, parents
el <- matrix(c(
"A", "T",
"T", "E",
"S", "L",
"S", "B",
"L", "E",
"E", "X",
"E", "D",
"B", "D"),
nc = 2,
byrow = TRUE
)
g <- igraph::graph_from_edgelist(el)
plot(g)
cl <- cpt_list(asia, g)
cl
#> Error in which.undirected(arcs, nodes = nodes): 'duplicated' applies only to vectors
Created on 2022-06-02 by the reprex package (v2.0.1)
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.