def __init__(self, samples, graph, n_samples=None, mode='concatenation',
                 n_components=None, dtype=np.float64, sparse=True, bias=0,
                 incremental=False, verbose=False):
        # Generate data matrix
        # (n_samples, n_features)
        data, self.n_samples = self._data_to_matrix(samples, n_samples)

        # n_features and n_features_per_vertex
        self.n_features = data.shape[1]
        self.n_features_per_vertex = int(self.n_features / graph.n_vertices)

        # Assign arguments
        self.graph = graph
        self.mode = mode
        self.n_components = n_components
        self.sparse = sparse
        self.dtype = dtype
        self.bias = bias
        self.is_incremental = incremental

        # Compute mean vector
        self.mean_vector = np.mean(data, axis=0)

        # Select correct method to create the precision matrix based on the
        # graph type and the sparse flag
        if self.graph.n_edges == 0:
            if self.sparse:
                constructor = _create_sparse_diagonal_precision
            else:
                constructor = _create_dense_diagonal_precision
        else:
            if self.sparse:
                constructor = partial(_create_sparse_precision, mode=self.mode)
            else:
                constructor = partial(_create_dense_precision, mode=self.mode)

        # Create the precision matrix and optionally store the covariance
        # matrices
        if self.is_incremental:
            self.precision, self._covariance_matrices = constructor(
                data, self.graph, self.n_features, self.n_features_per_vertex,
                dtype=self.dtype, n_components=self.n_components, bias=self.bias,
                return_covariances=self.is_incremental, verbose=verbose)
        else:
            self._covariance_matrices = None
            self.precision = constructor(
                data, self.graph, self.n_features, self.n_features_per_vertex,
                dtype=self.dtype, n_components=self.n_components, bias=self.bias,
                return_covariances=self.is_incremental, verbose=verbose)
dataset/ETHPy150Open menpo/menpo/menpo/model/gmrf.py/GMRFVectorModel.__init__/original