def add_element(self, value):
    " Add a new element to the sample window.\n\n        Apart from adding the element value to the window, by inserting it in\n        the correct bucket, it will also update the relevant statistics, in\n        this case the total sum of all values, the window width and the total\n        variance.\n\n        Parameters\n        ----------\n        value: int or float (a numeric value)\n\n        Notes\n        -----\n        The value parameter can be any numeric value relevant to the analysis\n        of concept change. For the learners in this framework we are using\n        either 0's or 1's, that are interpreted as follows:\n        0: Means the learners prediction was wrong\n        1: Means the learners prediction was correct\n\n        This function should be used at every new sample analysed.\n\n        "
    if self.in_concept_change:
        self.reset()
    self._width += 1
    self.__insert_element_bucket(0, value, self.list_row_bucket.first)
    incremental_variance = 0
    if (self._width > 1):
        incremental_variance = ((((self._width - 1) * (value - (self._total / (self._width - 1)))) * (value - (self._total / (self._width - 1)))) / self._width)
    self._variance += incremental_variance
    self._total += value
    self.__compress_buckets()
Add a new element to the sample window.

Apart from adding the element value to the window, by inserting it in
the correct bucket, it will also update the relevant statistics, in
this case the total sum of all values, the window width and the total
variance.

Parameters
----------
value: int or float (a numeric value)

Notes
-----
The value parameter can be any numeric value relevant to the analysis
of concept change. For the learners in this framework we are using
either 0's or 1's, that are interpreted as follows:
0: Means the learners prediction was wrong
1: Means the learners prediction was correct

This function should be used at every new sample analysed.
def add_element(self, value):
    " Add a new element to the sample window.\n\n        Apart from adding the element value to the window, by inserting it in\n        the correct bucket, it will also update the relevant statistics, in\n        this case the total sum of all values, the window width and the total\n        variance.\n\n        Parameters\n        ----------\n        value: int or float (a numeric value)\n\n        Notes\n        -----\n        The value parameter can be any numeric value relevant to the analysis\n        of concept change. For the learners in this framework we are using\n        either 0's or 1's, that are interpreted as follows:\n        0: Means the learners prediction was wrong\n        1: Means the learners prediction was correct\n\n        This function should be used at every new sample analysed.\n\n        "
    if self.in_concept_change:
        self.reset()
    self._width += 1
    self.__insert_element_bucket(0, value, self.list_row_bucket.first)
    incremental_variance = 0
    if (self._width > 1):
        incremental_variance = ((((self._width - 1) * (value - (self._total / (self._width - 1)))) * (value - (self._total / (self._width - 1)))) / self._width)
    self._variance += incremental_variance
    self._total += value
    self.__compress_buckets()