dotphp

table TFIDF

Apr 27th, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. echo "<table border='1' cellspacing='1' cellpadding='1'>";
  2. echo "<tr>";
  3. echo "<th>Term/Kata</th>";
  4. $no = 1;
  5. for($s=0; $s < $count_rdokumen; $s++){ echo "<th>D".$no++."</th>"; }
  6. echo "</tr>";
  7. for ($k=0; $k < $count_kk; $k++) {
  8.         $name       = $split_kk[$k];
  9.         echo "<tr>";
  10.         echo "<td width='20%'>".$name."</td>";
  11.  
  12.         for ($j=0; $j < $count_rdokumen; $j++) {
  13.             $doc    = str_replace(', ', ' ', isset($split_rdokumen[$j]) ? $split_rdokumen[$j] : "");   
  14.             $hits   = substr_count($doc, $name);
  15.             $tfidf  = $tampung_idf[$k]*$hits;
  16.             echo "<td width='10%'>".$tfidf."</td>";
  17.         }
  18.         echo "</tr>";
  19. }
  20. echo "<tr>";
  21. echo "<td align='right'><b>Bobot(W) :</b></td>";
  22. $no = 1;
  23. for($s=0; $s < $count_rdokumen; $s++){ echo "<td>&nbsp;</td>"; }
  24. echo "</tr>";
  25. echo "</table>";
Advertisement
Add Comment
Please, Sign In to add comment