

def __init__(self, samples, graph, n_samples=None, mode='concatenation', n_components=None, dtype=np.float64, sparse=True, bias=0, incremental=False, verbose=False):
    (data, self.n_samples) = self._data_to_matrix(samples, n_samples)
    self.n_features = data.shape[1]
    self.n_features_per_vertex = int((self.n_features / graph.n_vertices))
    self.graph = graph
    self.mode = mode
    self.n_components = n_components
    self.sparse = sparse
    self.dtype = dtype
    self.bias = bias
    self.is_incremental = incremental
    self.mean_vector = np.mean(data, axis=0)
    if (self.graph.n_edges == 0):
        if self.sparse:
            constructor = _create_sparse_diagonal_precision
        else:
            constructor = _create_dense_diagonal_precision
    elif self.sparse:
        constructor = partial(_create_sparse_precision, mode=self.mode)
    else:
        constructor = partial(_create_dense_precision, mode=self.mode)
    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