class_docstr: Learning Vector Quantization 2 (LVQ2) algorithm.
  Improved version for the LVQ algorithm.
  
  Parameters
  ----------
  epsilon : float
      Ration between to closest subclasses that
      triggers double weight update. Defaults to ``0.1``.
  
  {LVQ.Parameters}
  
  Notes
  -----
  {LVQ.Notes}
  
  Examples
  --------
  >>> import numpy as np
  >>> from neupy import algorithms
  >>>
  >>> X = np.array([[0, 0], [0, 1], [1, 0], [1, 1], [2, 2], [1, 2]])
  >>> y = np.array([0, 0, 0, 1, 1, 1])
  >>>
  >>> lvqnet = algorithms.LVQ2(n_inputs=2, n_classes=2)
  >>> lvqnet.train(X, y, epochs=100)
  >>> lvqnet.predict([[2, 1], [-1, -1]])
  array([1, 0])
code: def one_training_update(self, X_train, y_train):
      weight = self.weight
      epsilon = self.epsilon
      subclass_to_class = self.subclass_to_class
  
      n_correct_predictions = 0
      for input_row, target in zip(X_train, y_train):
          step = self.training_step
          output = euclid_distance(input_row, weight)
          winner_subclasses = n_argmin(output, n=2, axis=1)
  
          top1_subclass, top2_subclass = winner_subclasses
          top1_class = subclass_to_class[top1_subclass]
          top2_class = subclass_to_class[top2_subclass]
  
          top1_weight_update = input_row - weight[top1_subclass, :]
          is_correct_prediction = (top1_class == target).item(0)
  
          closest_dist, runner_up_dist = output[0, winner_subclasses]
          double_update_condition_satisfied = (
              not is_correct_prediction
              and (top2_class == target)
              and closest_dist > ((1 - epsilon) * runner_up_dist)
              and runner_up_dist < ((1 + epsilon) * closest_dist)
          )
  
          if double_update_condition_satisfied:
              top2_weight_update = input_row - weight[top2_class, :]
              weight[top1_subclass, :] -= step * top1_weight_update
              weight[top2_subclass, :] += step * top2_weight_update
  
          elif is_correct_prediction:
              weight[top1_subclass, :] += step * top1_weight_update
  
          else:
              weight[top1_subclass, :] -= step * top1_weight_update
  
          n_correct_predictions += is_correct_prediction
  
      n_samples = len(X_train)
      return 1 - n_correct_predictions / n_samples
  
imports: from __future__ import division
  import numpy
  from neupy import init
  from neupy.utils import format_data
  from neupy.exceptions import NotTrained
  from neupy.algorithms.base import BaseNetwork
  from neupy.core.properties import IntProperty, Property, TypedListProperty, NumberProperty
label_desc: Use image node_id 1 for calling the LVQ2 obj's underlying member method code with example usage: obj.one_training_update(X_train, y_train) and returns: unknown