docstr: Makes a cav instance and writes it to tmp direcotry.
  
  The cav instance uses preset values.
docstr_tok: ["Makes","a","cav","instance","and","writes","it","to","tmp","direcotry",".","The","cav","instance","uses","preset","values","."]
code: def setUp(self):
      """Makes a cav instance and writes it to tmp direcotry.
  
      The cav instance uses preset values.
      """
      self.hparams = {
          "model_type": "linear",
          "alpha": 0.01,
          "max_iter": 1000,
          "tol": 1e-3,
      }
      self.concepts = ["concept1", "concept2"]
      self.bottleneck = "bottleneck"
      self.accuracies = {
          "concept1": 0.8,
          "concept2": 0.5,
          "overall": 0.65,
      }
      self.cav_vecs = [[1, 2, 3], [4, 5, 6]]
  
      self.test_subdirectory = os.path.join(
          FLAGS.tcav_test_tmpdir, "test"
      )
      self.cav_dir = self.test_subdirectory
      self.cav_file_name = (
          CAV.cav_key(
              self.concepts,
              self.bottleneck,
              self.hparams["model_type"],
              self.hparams["alpha"],
          )
          + ".pkl"
      )
      self.save_path = os.path.join(self.cav_dir, self.cav_file_name)
      self.cav = CAV(self.concepts, self.bottleneck, self.hparams)
      # pretend that it was trained and cavs are stored
      self.cav.cavs = np.array(self.cav_vecs)
      shape = (1, 3)
      self.acts = {
          concept: {
              self.bottleneck: np.tile(i * np.ones(shape), (4, 1))
          }
          for i, concept in enumerate(self.concepts)
      }
  
      if os.path.exists(self.cav_dir):
          shutil.rmtree(self.cav_dir)
      os.mkdir(self.cav_dir)
      with tf.io.gfile.GFile(self.save_path, "w") as pkl_file:
          pickle.dump(
              {
                  "concepts": self.concepts,
                  "bottleneck": self.bottleneck,
                  "hparams": self.hparams,
                  "accuracies": self.accuracies,
                  "cavs": self.cav_vecs,
                  "saved_path": self.save_path,
              },
              pkl_file,
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import pickle
  import shutil
  import numpy
  import tensorflow
  from sklearn import linear_model
  from six.moves import range
  from tcav.cav import CAV, get_or_train_cav
  from tensorflow.python.platform import flags
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 1 for calling the CavTest obj's underlying member method code with example usage: obj.setUp() without return types