Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import click | |
| import os | |
| import sys | |
| import warnings | |
| try: | |
| from pygments import highlight | |
| from pygments.lexers import PythonLexer | |
| from pygments.formatters import TerminalFormatter | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | """ | |
| Blaze integration with the Pipeline API. | |
| For an overview of the blaze project, see blaze.pydata.org | |
| The blaze loader for the Pipeline API is designed to allow us to load | |
| data from arbitrary sources as long as we can execute the needed expressions | |
| against the data with blaze. | |
| Data Format | 
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | """This algorithm is designed for validating risk model. | |
| It can be configured to be: | |
| * Momentum or Mean-reversion | |
| * Sector-Neutral or not | |
| """ | |
| from quantopian.algorithm import attach_pipeline, pipeline_output, order_optimal_portfolio | |
| from quantopian.pipeline import Pipeline | |
| from quantopian.pipeline.factors import CustomFactor, SimpleMovingAverage, AverageDollarVolume, RollingLinearRegressionOfReturns, Returns | |
| from quantopian.pipeline.data.builtin import USEquityPricing | |
| from quantopian.pipeline.data import morningstar | 
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import dask | |
| import dask.array as da | |
| import dask.dataframe as dd | |
| import sparse | |
| @dask.delayed(pure=True) | |
| def corr_on_chunked(chunk1, chunk2, corr_thresh=0.9): | |
| return sparse.COO.from_numpy((np.dot(chunk1, chunk2.T) > corr_thresh)) | |
| def chunked_corr_sparse_dask(data, chunksize=5000, corr_thresh=0.9): | 
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.