Metadata-Version: 2.1
Name: alphalens-reloaded
Version: 0.4.1
Summary: Performance analysis of predictive (alpha) stock factors'
Home-page: https://alphalens.ml4trading.io
Author: Quantopian Inc
Maintainer: Applied AI, LLC
License: Apache 2.0
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python
Classifier: Topic :: Utilities
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: matplotlib (>=1.4.0)
Requires-Dist: numpy (>=1.9.1)
Requires-Dist: pandas (>=1.0.0)
Requires-Dist: scipy (>=0.14.0)
Requires-Dist: seaborn (>=0.6.0)
Requires-Dist: statsmodels (>=0.6.1)
Requires-Dist: IPython (>=3.2.3)
Requires-Dist: empyrical (>=0.5.0)
Provides-Extra: dev
Requires-Dist: flake8 (>=3.9.1) ; extra == 'dev'
Requires-Dist: black (>=20.8) ; extra == 'dev'
Requires-Dist: pre-commit (>=2.12.1) ; extra == 'dev'
Provides-Extra: docs
Requires-Dist: Cython ; extra == 'docs'
Requires-Dist: Sphinx (>=1.3.2) ; extra == 'docs'
Requires-Dist: numpydoc (>=0.5.0) ; extra == 'docs'
Requires-Dist: sphinx-autobuild (>=0.6.0) ; extra == 'docs'
Requires-Dist: pydata-sphinx-theme ; extra == 'docs'
Provides-Extra: test
Requires-Dist: tox (>=2.3.1) ; extra == 'test'
Requires-Dist: coverage (>=4.0.3) ; extra == 'test'
Requires-Dist: nose (>=1.3.7) ; extra == 'test'
Requires-Dist: parameterized (>=0.6.1) ; extra == 'test'
Requires-Dist: nose-ignore-docstring (>=0.2) ; extra == 'test'
Requires-Dist: nose-timer (>=0.5.0) ; extra == 'test'
Requires-Dist: flake8 (>=3.9.1) ; extra == 'test'
Requires-Dist: black ; extra == 'test'

<p align="center">
<a href="https://zipline.ml4trading.io">
<img src="https://i.imgur.com/uf8PmQO.png" width="35%">
</a>
</p>

Alphalens
=========

[![CI Tests](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/unit_tests.yml/badge.svg)](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/unit_tests.yml)
[![PyPI Wheels](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/distribution.yml/badge.svg)](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/distribution.yml)

Alphalens is a Python library for performance analysis of predictive
(alpha) stock factors. Alphalens works great with the
[Zipline](https://www.zipline.ml4trading.io/) open source backtesting
library, and [Pyfolio](https://github.com/quantopian/pyfolio) which
provides performance and risk analysis of financial portfolios.

The main function of Alphalens is to surface the most relevant
statistics and plots about an alpha factor, including:

-   Returns Analysis
-   Information Coefficient Analysis
-   Turnover Analysis
-   Grouped Analysis

Getting started
---------------

With a signal and pricing data creating a factor \"tear sheet\" is a two step process:

```python
import alphalens

# Ingest and format data
factor_data = alphalens.utils.get_clean_factor_and_forward_returns(my_factor,
                                                                   pricing,
                                                                   quantiles=5,
                                                                   groupby=ticker_sector,
                                                                   groupby_labels=sector_names)

# Run analysis
alphalens.tears.create_full_tear_sheet(factor_data)
```

Learn more
----------

Check out the [example notebooks](https://github.com/stefan-jansen/alphalens-reloaded/tree/master/alphalens/examples)
for more on how to read and use the factor tear sheet.

Installation
------------

Install with pip:

    pip install alphalens-reloaded

Install with conda:

    conda install -c ml4t alphalens-reloaded

Install from the master branch of Alphalens repository (development
code):

    pip install git+https://github.com/stefan-jansen/alphalens-reloaded

Alphalens depends on:

-   [matplotlib](https://github.com/matplotlib/matplotlib)
-   [numpy](https://github.com/numpy/numpy)
-   [pandas](https://github.com/pandas-dev/pandas)
-   [scipy](https://github.com/scipy/scipy)
-   [seaborn](https://github.com/mwaskom/seaborn)
-   [statsmodels](https://github.com/statsmodels/statsmodels)

Usage
-----

A good way to get started is to run the examples in a [Jupyter
notebook](https://jupyter.org/).

To get set up with an example, you can:

Run a Jupyter notebook server via:

```bash
jupyter notebook
```

From the notebook list page(usually found at `http://localhost:8888/`),
navigate over to the examples directory, and open any file with a .ipynb
extension.

Execute the code in a notebook cell by clicking on it and hitting
Shift+Enter.

Questions?
----------

If you find a bug, feel free to open an issue on our [github
tracker](https://github.com/stefan-jansen/alphalens-reloaded/issues).

Contribute
----------

If you want to contribute, a great place to start would be the
[help-wanted
issues](https://github.com/stefan-jansen/alphalens-reloaded/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).

Credits
-------

-   [Andrew Campbell](https://github.com/a-campbell)
-   [James Christopher](https://github.com/jameschristopher)
-   [Thomas Wiecki](https://github.com/twiecki)
-   [Jonathan Larkin](https://github.com/marketneutral)
-   Jessica Stauth (<jstauth@quantopian.com>)
-   [Taso Petridis](https://github.com/tasopetridis)

For a full list of contributors see the [contributors
page.](https://github.com/stefan-jansen/alphalens-reloaded/graphs/contributors)

Example Tear Sheet
------------------

Example factor courtesy of [ExtractAlpha](https://extractalpha.com/)

![image](https://github.com/stefan-jansen/alphalens-reloaded/raw/master/alphalens/examples/table_tear.png)

![image](https://github.com/stefan-jansen/alphalens-reloaded/raw/master/alphalens/examples/returns_tear.png)

![image](https://github.com/stefan-jansen/alphalens-reloaded/raw/master/alphalens/examples/ic_tear.png)

![](https://github.com/stefan-jansen/alphalens-reloaded/raw/master/alphalens/examples/sector_tear.png)


