How to make page.html.twig based on Vocabulary?
Because you have not included the PHP code that contains the Class.

See Namespacing in PHP.

According to term.php the name space is Drupal\taxonomy\Entity. 

So you need to add use [name space]\[class name]; at the top. 

Therefore, it would be use Drupal\taxonomy\Entity\Term;. 

Example:

&lt;?php

use Drupal\taxonomy\Entity\Term;

function THEME_NAME_theme_suggestions_page_alter(&amp;$suggestions, &amp;$vars) {
  if (\Drupal::routeMatch()-&gt;getRouteName() == 'entity.taxonomy_term.canonical' &amp;&amp; $tid = \Drupal::routeMatch()-&gt;getRawParameter('taxonomy_term')) {
    $term = Term::load($tid);
    $suggestions[] = 'page__taxonomy__' . $term-&gt;getVocabularyId();
  }
}