Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stefan-jansen/alphalens-reloaded
Performance analysis of predictive (alpha) stock factors
https://github.com/stefan-jansen/alphalens-reloaded
Last synced: 4 months ago
JSON representation
Performance analysis of predictive (alpha) stock factors
- Host: GitHub
- URL: https://github.com/stefan-jansen/alphalens-reloaded
- Owner: stefan-jansen
- License: apache-2.0
- Fork: true (quantopian/alphalens)
- Created: 2021-02-23T19:11:27.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-26T09:36:55.000Z (5 months ago)
- Last Synced: 2024-09-26T09:48:40.501Z (5 months ago)
- Language: Python
- Homepage: https://alphalens.ml4trading.io
- Size: 125 MB
- Stars: 292
- Watchers: 12
- Forks: 66
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-quant - alphalens-reloaded - 预测性(alpha)股票因子的绩效分析 (Python / 因子分析)
- awesome-quant - alphalens-reloaded - 预测性(alpha)股票因子的绩效分析 (Python / 因子分析)
- trackawesomelist - alphalens-reloaded (⭐297) - Performance analysis of predictive (alpha) stock factors. (Recently Updated / [Oct 14, 2024](/content/2024/10/14/README.md))
- pytrade.org - alphalens-reloaded - Performance analysis of predictive (alpha) stock factors. (Curated List / Analytics)
- awesome-quant - alphalens-reloaded - Performance analysis of predictive (alpha) stock factors. (Python / Factor Analysis)
README

[](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/conda_package.yml)
[](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/unit_tests.yml)
[](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/build_wheels.yml)
[](https://coveralls.io/github/stefan-jansen/alphalens-reloaded?branch=main)



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)> Note that Numpy>=2.0 requires pandas>=2.2.2. If you are using an older version of pandas, you may need to upgrade
> accordingly, otherwise you may encounter compatibility issues.# 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 ()
- [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 Sheets
Example factor courtesy of [ExtractAlpha](https://extractalpha.com/)
## Peformance Metrics Tables

## Returns Tear Sheet

## Information Coefficient Tear Sheet

## Sector Tear Sheet
