code: def linear_initialization(data, features_grid):
      """
      Linear weight initialization base on the randomized PCA.
  
      Parameters
      ----------
      data : 2d array-like
  
      features_grid : tuple
          Tuple that defines shape of the feature grid.
  
      Returns
      -------
      2d array-like
          Initialized weights
      """
      cols = features_grid[1]
      n_nodes = np.prod(features_grid)
  
      n_pca_components = 2
      coord = np.zeros((n_nodes, n_pca_components))
  
      for i in range(n_nodes):
          coord[i, 0] = int(i / cols)
          coord[i, 1] = int(i % cols)
  
      maximum = np.max(coord, axis=0)
      coord = 2 * (coord / maximum - 0.5)
  
      data_mean = np.mean(data, axis=0)
      data_std = np.std(data, axis=0)
      data = (data - data_mean) / data_std
  
      eigenvectors, eigenvalues = randomized_pca(data, n_pca_components)
  
      norms = np.sqrt(np.einsum("ij,ij->i", eigenvectors, eigenvectors))
      eigenvectors = ((eigenvectors.T / norms) * eigenvalues).T
      weight = data_mean + coord.dot(eigenvectors) * data_std
  
      return weight.T
  
imports: from __future__ import division
  from collections import namedtuple
  import six
  import numpy
  from numpy.linalg import norm
  from neupy import init
  from neupy.utils import as_tuple, format_data
  from neupy.algorithms import Kohonen
  from neupy.exceptions import WeightInitializationError
  from neupy.algorithms.associative.base import BaseAssociative
  from neupy.core.properties import BaseProperty, TypedListProperty, ChoiceProperty, NumberProperty, ParameterProperty, IntProperty
  from .randomized_pca import randomized_pca
  from .neighbours import find_step_scaler_on_rect_grid, find_neighbours_on_rect_grid, find_neighbours_on_hexagon_grid, find_step_scaler_on_hexagon_grid
label_desc: Use image node_id 5 for calling a global function with example usage: linear_initialization(data, features_grid) and returns: weight