(self, extract_keys='performance')
return extracted_matrix
Extract the data stored in the StateIO obejct.

        Parameters
        ----------
        extract_keys: str or list of str, optional (default='performance')
            Extract what value in the State object.
            The extract_keys should be a subset of the keys of each State object.
            Such as: 'select_index', 'performance', 'queried_label', 'cost', etc.

            Note that, the extracted matrix is associated with the extract_keys.
            If more than 1 key is given, each element in the matrix is a tuple.
            The values in tuple are one-to-one correspondence to the extract_keys.

        Returns
        -------
        extracted_matrix: list
            The extracted matrix.
Extract the data stored in the StateIO obejct.
Extract the data stored in the StateIO obejct .
def extract_matrix(self, extract_keys='performance'):
        """Extract the data stored in the StateIO obejct.

        Parameters
        ----------
        extract_keys: str or list of str, optional (default='performance')
            Extract what value in the State object.
            The extract_keys should be a subset of the keys of each State object.
            Such as: 'select_index', 'performance', 'queried_label', 'cost', etc.

            Note that, the extracted matrix is associated with the extract_keys.
            If more than 1 key is given, each element in the matrix is a tuple.
            The values in tuple are one-to-one correspondence to the extract_keys.

        Returns
        -------
        extracted_matrix: list
            The extracted matrix.
        """
        extracted_matrix = []
        if isinstance(extract_keys, str):
            for stateio in self:
                stateio_line = []
                if stateio.initial_point is not None:
                    stateio_line.append(stateio.initial_point)
                for state in stateio:
                    if extract_keys not in state.keys():
                        raise ValueError('The extract_keys should be a subset of the keys of each State object.\n'
                                         'But keys in the state are: %s' % str(state.keys()))
                    stateio_line.append(state.get_value(extract_keys))
                extracted_matrix.append(copy.copy(stateio_line))

        elif isinstance(extract_keys, list):
            for stateio in self:
                stateio_line = []
                for state in stateio:
                    state_line = []
                    for key in extract_keys:
                        if key not in state.keys():
                            raise ValueError('The extract_keys should be a subset of the keys of each State object.\n'
                                             'But keys in the state are: %s' % str(state.keys()))
                        state_line.append(state.get_value(key))
                    stateio_line.append(tuple(state_line))
                extracted_matrix.append(copy.copy(stateio_line))

        else:
            raise TypeError("str or list of str is expected, but received: %s" % str(type(extract_keys)))

        return extracted_matrix
def extract_matrix ( self , extract_keys = 'performance' ) : extracted_matrix = [ ] if isinstance ( extract_keys , str ) : for stateio in self : stateio_line = [ ] if stateio . initial_point is not None : stateio_line . append ( stateio . initial_point ) for state in stateio : if extract_keys not in state . keys ( ) : raise ValueError ( 'The extract_keys should be a subset of the keys of each State object.\n' 'But keys in the state are: %s' % str ( state . keys ( ) ) ) stateio_line . append ( state . get_value ( extract_keys ) ) extracted_matrix . append ( copy . copy ( stateio_line ) ) elif isinstance ( extract_keys , list ) : for stateio in self : stateio_line = [ ] for state in stateio : state_line = [ ] for key in extract_keys : if key not in state . keys ( ) : raise ValueError ( 'The extract_keys should be a subset of the keys of each State object.\n' 'But keys in the state are: %s' % str ( state . keys ( ) ) ) state_line . append ( state . get_value ( key ) ) stateio_line . append ( tuple ( state_line ) ) extracted_matrix . append ( copy . copy ( stateio_line ) ) else : raise TypeError ( "str or list of str is expected, but received: %s" % str ( type ( extract_keys ) ) ) return extracted_matrix