class_docstr: CAV class contains methods for concept activation vector (CAV).
  
  CAV represents semenatically meaningful vector directions in
  network's embeddings (bottlenecks).
class_docstr_tok: ["CAV","class","contains","methods","for","concept","activation","vector","(","CAV",")",".","CAV","represents","semenatically","meaningful","vector","directions","in","network","'s","embeddings","(","bottlenecks",")","."]
docstr: Flattens acts, make mock-labels and returns the info.
  
  Labels are assigned in the order that concepts exists.
  
  Args:
      concepts: names of concepts
      bottleneck: the name of bottleneck where acts come from
      acts: a dictionary that contains activations
  Returns:
      x -  flattened acts
      labels - corresponding labels (integer)
      labels2text -  map between labels and text.
docstr_tok: ["Flattens","acts",",","make","mock-labels","and","returns","the","info",".","Labels","are","assigned","in","the","order","that","concepts","exists",".","Args",":","concepts",":","names","of","concepts","bottleneck",":","the","name","of","bottleneck","where","acts","come","from","acts",":","a","dictionary","that","contains","activations","Returns",":","x","-","flattened","acts","labels","-","corresponding","labels","(","integer",")","labels2text","-","map","between","labels","and","text","."]
code: def _create_cav_training_set(concepts, bottleneck, acts):
      """Flattens acts, make mock-labels and returns the info.
  
      Labels are assigned in the order that concepts exists.
  
      Args:
          concepts: names of concepts
          bottleneck: the name of bottleneck where acts come from
          acts: a dictionary that contains activations
      Returns:
          x -  flattened acts
          labels - corresponding labels (integer)
          labels2text -  map between labels and text.
      """
  
      x = []
      labels = []
      labels2text = {}
      # to make sure postiive and negative examples are balanced,
      # truncate all examples to the size of the smallest concept.
      min_data_points = np.min(
          [
              acts[concept][bottleneck].shape[0]
              for concept in acts.keys()
          ]
      )
  
      for i, concept in enumerate(concepts):
          x.extend(
              acts[concept][bottleneck][:min_data_points].reshape(
                  min_data_points, -1
              )
          )
          labels.extend([i] * min_data_points)
          labels2text[i] = concept
      x = np.array(x)
      labels = np.array(labels)
  
      return x, labels, labels2text
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os.path
  import pickle
  import numpy
  from six.moves import range
  from sklearn import linear_model
  from sklearn import metrics
  from sklearn.model_selection import train_test_split
  from tcav import utils
  import tensorflow
label_desc: Use image node_id 5 for calling the CAV obj's underlying member method code with example usage: obj._create_cav_training_set(concepts, bottleneck, acts) and returns: x,  labels,  labels2text