import { JSON_DATA_PATH , JSON_REC_PATH } from "_/config/test_paths" ; import { JSONInput } from "@/io/input/JSONInput" ; import { ComputeGraph } from "@/core/compute/ComputeGraph" ; import { Logger } from "@/utils/Logger" ; const logger = new Logger ( ) ; const tf = require ( "@tensorflow/tfjs-node" ) ; console . log ( tf . getBackend ( ) ) ; const json = new JSONInput ( { explicit_direction : false , directed : true , weighted : false , } ) ; const beer_graph_file = `${ JSON_REC_PATH }/beerGraph.json` ; const jobs_graph_file = `${ JSON_REC_PATH }/jobs.json` ; /**
 *
 */ describe ( "transitivity - clustering coefficient performance tests - " , ( ) => { const jobsGraph = json . readFromJSONFile ( jobs_graph_file ) ; const beerGraph = json . readFromJSONFile ( beer_graph_file ) ; let cg ; let tic , toc ; beforeAll ( ( ) => { } ) ; TODO [ jobsGraph , beerGraph ] . forEach ( graph => { it ( "computes the transitivity of a recommender graph" , done => { cg = new ComputeGraph ( graph , tf ) ; tic = Date . now ( ) ; cg . globalCC ( true ) . then ( res => { toc = Date . now ( ) ; logger . log ( `Computing transitivity (TF) on ${ graph . label } took ${ toc - tic } ms.` ) ; done ( ) ; } ) ; } ) ; it ( "computes the local clustering coefficients of a recommender graph" , done => { cg = new ComputeGraph ( graph , tf ) ; tic = Date . now ( ) ; cg . localCC ( true ) . then ( res => { toc = Date . now ( ) ; logger . log ( `Computing CC (TF) on ${ graph . label } took ${ toc - tic } ms.` ) ; done ( ) ; } ) ; } ) ; } ) ; } ) ;