public override void Compute() { TLArtifactsCollection source = (TLArtifactsCollection)Workspace.Load("SourceArtifacts"); TLArtifactsCollection target = (TLArtifactsCollection)Workspace.Load("TargetArtifacts"); REngine engine = new REngine(_config.RScriptPath); TLSimilarityMatrix sims = (TLSimilarityMatrix)engine.Execute(new RTMScript(source, target, _config)); Workspace.Store("Similarities", sims); }
public override void Compute() { TLArtifactsCollection source = (TLArtifactsCollection)Workspace.Load("SourceArtifacts"); TLArtifactsCollection target = (TLArtifactsCollection)Workspace.Load("TargetArtifacts"); REngine engine = new REngine(_config.RScriptPath); GibbsLDAConfig config = (GibbsLDAConfig)engine.Execute(new GibbsLDA_GAScript(source, target, _config)); Workspace.Store("GibbsLDAConfig", config); }
public override void Compute() { string TraceID = (string)Workspace.Load("TraceID"); PDG pdg = (PDG)Workspace.Load("PDG"); REngine engine = new REngine(_config.RScriptPath.Absolute); RScript script = new PageRankScript(TraceID, pdg, _config); TLSimilarityMatrix ranks = (TLSimilarityMatrix)engine.Execute(script); Workspace.Store("Ranks", ranks); }
public override void Compute() { TLSimilarityMatrix matrix1 = (TLSimilarityMatrix)Workspace.Load("Matrix1"); TLSimilarityMatrix matrix2 = (TLSimilarityMatrix)Workspace.Load("Matrix2"); REngine engine = new REngine(_config.RScriptPath); double[] results = (double[])engine.Execute(new PCAScript(matrix1, matrix2)); Workspace.Store("Matrix1Contribution", results[0]); Workspace.Store("Matrix2Contribution", results[1]); }
public override void Compute() { string TraceID = (string)Workspace.Load("TraceID"); PDG pdg = (PDG)Workspace.Load("PDG"); REngine engine = new REngine(_config.RScriptPath.Absolute); RScript script = new HITSScript(TraceID, pdg, _config); HITSResult results = (HITSResult)engine.Execute(script); Workspace.Store("Hubs", results.Hubs); Workspace.Store("Authorities", results.Authorities); }
public void ComputeLSA() { TLArtifactsCollection source = TermDocumentMatrix.Load(@"../../Data/LSA/source.txt").ToTLArtifactsCollection(); TLArtifactsCollection target = TermDocumentMatrix.Load(@"../../Data/LSA/target.txt").ToTLArtifactsCollection(); REngine engine = new REngine(Settings.Default.RScriptEXE); TLSimilarityMatrix matrix = (TLSimilarityMatrix)engine.Execute(new LSAScript(source, target, new LSAConfig { Dimensions = 3 })); TLSimilarityMatrix correct = Similarities.Import(@"../../Data/LSA/correct.txt"); foreach (TLSingleLink link in matrix.AllLinks) { Assert.AreEqual(correct.GetScoreForLink(link.SourceArtifactId, link.TargetArtifactId), link.Score, Settings.Default.DoublePrecision ); } }
public void BinaryTest() { string rankFile = traceRoot + ".PageRank.binary.ranks.Beta85"; TLSimilarityMatrix oracle = WebMiningTestUtils.GenerateOracle(rankFile, mapFile); PDG pdg = WebMiningTestUtils.GeneratePDG(traceFile, rawMethods); Console.WriteLine("Executing script..."); REngine engine = new REngine(Settings.Default.RScriptEXE); RScript script = new PageRankScript("trace", pdg, new PageRankConfig { Epsilon = epsilon, Beta = beta, Weight = WebMiningWeightEnum.Binary, } ); TLSimilarityMatrix results = (TLSimilarityMatrix)engine.Execute(script); WebMiningTestUtils.CompareResults(oracle, results, rawMethods); }
public void BinaryTest() { string authorityFile = traceRoot + ".HITS.binary.ranks.authorities"; string hubFile = traceRoot + ".HITS.binary.ranks.hubs"; TLSimilarityMatrix oracleAuthority = WebMiningTestUtils.GenerateOracle(authorityFile, mapFile); TLSimilarityMatrix oracleHub = WebMiningTestUtils.GenerateOracle(hubFile, mapFile); PDG pdg = WebMiningTestUtils.GeneratePDG(traceFile, rawMethods); Console.WriteLine("Executing script..."); REngine engine = new REngine(Settings.Default.RScriptEXE); RScript script = new HITSScript("trace", pdg, new HITSConfig { Epsilon = epsilon, Weight = WebMiningWeightEnum.Binary, } ); HITSResult results = (HITSResult)engine.Execute(script); WebMiningTestUtils.CompareResults(oracleAuthority, results.Authorities, rawMethods); WebMiningTestUtils.CompareResults(oracleHub, results.Hubs, rawMethods); }