コード例 #1
0
ファイル: RTMComponent.cs プロジェクト: CoEST/TraceLab-CDK
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 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);
 }
コード例 #4
0
 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]);
 }
コード例 #5
0
ファイル: HITSComponent.cs プロジェクト: CoEST/TraceLab-CDK
 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);
 }
コード例 #6
0
ファイル: LSAScriptTest.cs プロジェクト: CoEST/TraceLab-CDK
 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
         );
     }
 }
コード例 #7
0
ファイル: PageRankTest.cs プロジェクト: CoEST/TraceLab-CDK
 public void FrequencyTest()
 {
     string rankFile = traceRoot + ".PageRank.frequency.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.Frequency,
         }
     );
     TLSimilarityMatrix results = (TLSimilarityMatrix)engine.Execute(script);
     WebMiningTestUtils.CompareResults(oracle, results, rawMethods);
 }
コード例 #8
0
ファイル: HITSTest.cs プロジェクト: CoEST/TraceLab-CDK
 public void FrequencyTest()
 {
     string authorityFile = traceRoot + ".HITS.frequency.ranks.authorities";
     string hubFile = traceRoot + ".HITS.frequency.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.Frequency,
         }
     );
     HITSResult results = (HITSResult)engine.Execute(script);
     WebMiningTestUtils.CompareResults(oracleAuthority, results.Authorities, rawMethods);
     WebMiningTestUtils.CompareResults(oracleHub, results.Hubs, rawMethods);
 }