ENH: Add support for Classifiers.

Classifiers are computations that represent grouping keys. They can be
used in conjuction with normalization functions like ``zscore`` or
``demean`` to perform normalizations over subsets of a dataset.

Notable changes:

- Added ``demean()`` and ``zscore()`` methods to ``Factor``.

- Added a classifier versions of ``Latest`` and ``CustomTermMixin``.
  The .latest attribute of int64 dataset columns no produces a
  classifier by default.

- Added ``Everything``, a classifier that maps all data to the same
  value.

- Added ``zipline.lib.normalize``, which implements a naive, pure-Python
  grouped normalize function.  This will likely be moved to Cython in a
  subsequent PR.
This commit is contained in:
Scott Sanderson
2016-03-19 17:04:28 -04:00
parent 1f0e1e8908
commit 53d3b0855b
14 changed files with 674 additions and 34 deletions
+4 -1
View File
@@ -4,7 +4,7 @@ import doctest
from unittest import TestCase
from zipline import testing
from zipline.lib import adjustment
from zipline.lib import adjustment, normalize
from zipline.pipeline import (
engine,
expression,
@@ -86,3 +86,6 @@ class DoctestTestCase(TestCase):
def test_functional_docs(self):
self._check_docs(functional)
def test_normalize_docs(self):
self._check_docs(normalize)