πŸ“¦ Applications

Collection of pre-trained models

FairMarketcapYahoo

ml_investment.applications.fair_marketcap_yahoo.FairMarketcapYahoo(pretrained=True) ml_investment.pipelines.Pipeline[source]

Model is used to estimate fair company marketcap for last quarter. Pipeline uses features from BaseCompanyFeatures, QuarterlyFeatures and trained to predict real market capitalizations ( using QuarterlyTarget ). Since some companies are overvalued and some are undervalued, the model makes an average β€œfair” prediction. yahoo is used for loading data.

Parameters

pretrained – use pretreined weights or not. If so, fair_marketcap_yahoo.pickle will be downloaded. Downloading directory path can be changed in ~/.ml_investment/config.json models_path

ml_investment.applications.fair_marketcap_yahoo.main()[source]

Default model training. Resulted model weights directory path can be changed in ~/.ml_investment/config.json models_path

FairMarketcapSF1

ml_investment.applications.fair_marketcap_sf1.FairMarketcapSF1(max_back_quarter: Optional[int] = None, min_back_quarter: Optional[int] = None, data_source: Optional[str] = None, pretrained: bool = True, verbose: Optional[bool] = None) ml_investment.pipelines.Pipeline[source]

Model is used to estimate fair company marketcap for several last quarters. Pipeline uses features from BaseCompanyFeatures, QuarterlyFeatures, DailyAggQuarterFeatures, CommoditiesAggQuarterFeatures and trained to predict real market capitalizations ( using QuarterlyTarget ). Since some companies are overvalued and some are undervalued, the model makes an average β€œfair” prediction. sf1 and quandl_commodities is used for loading data.

Note

SF1 dataset is paid, so for using this model you need to subscribe and paste quandl token to ~/.ml_investment/secrets.json quandl_api_key

Parameters
  • max_back_quarter – max quarter number which will be used in model

  • min_back_quarter – min quarter number which will be used in model

  • data_source – which data use for model. One of [β€˜sf1’, β€˜mongo’]. If β€˜mongo’, than data will be loaded from db, credentials specified at ~/.ml_investment/config.json. If β€˜sf1’ - from folder specified at sf1_data_path in ~/.ml_investment/secrets.json.

  • pretrained – use pretreined weights or not. Downloading directory path can be changed in ~/.ml_investment/config.json models_path

  • verbose – show progress or not

ml_investment.applications.fair_marketcap_sf1.main(data_source)[source]

Default model training. Resulted model weights directory path can be changed in ~/.ml_investment/config.json models_path

FairMarketcapDiffYahoo

ml_investment.applications.fair_marketcap_diff_yahoo.FairMarketcapDiffYahoo(pretrained=True) ml_investment.pipelines.Pipeline[source]

Model is used to evaluate quarter-to-quarter(q2q) company fundamental progress. Model uses QuarterlyDiffFeatures (q2q results progress, e.g. 30% revenue increase, decrease in debt by 15% etc), BaseCompanyFeatures, QuarterlyFeatures and trying to predict smoothed real q2q marketcap difference( DailySmoothedQuarterlyDiffTarget ). So model prediction may be interpreted as β€œfair” marketcap change according this q2q fundamental change. yahoo and daily_bars are used for loading data.

Parameters

pretrained – use pretreined weights or not. If so, fair_marketcap_diff_yahoo.pickle will be downloaded. Downloading directory path can be changed in ~/.ml_investment/config.json models_path

ml_investment.applications.fair_marketcap_diff_yahoo.main()[source]

Default model training. Resulted model weights directory path can be changed in ~/.ml_investment/config.json models_path

FairMarketcapDiffSF1

ml_investment.applications.fair_marketcap_diff_sf1.FairMarketcapDiffSF1(max_back_quarter: Optional[int] = None, min_back_quarter: Optional[int] = None, data_source: Optional[str] = None, pretrained: bool = True, verbose: Optional[bool] = None) ml_investment.pipelines.Pipeline[source]

Model is used to evaluate quarter-to-quarter(q2q) company fundamental progress. Model uses QuarterlyDiffFeatures (q2q results progress, e.g. 30% revenue increase, decrease in debt by 15% etc), BaseCompanyFeatures, QuarterlyFeatures CommoditiesAggQuarterFeatures and trying to predict real q2q marketcap difference( QuarterlyDiffTarget ). So model prediction may be interpreted as β€œfair” marketcap change according this q2q fundamental change. sf1 is used for loading data.

Note

SF1 dataset is paid, so for using this model you need to subscribe and paste quandl token to ~/.ml_investment/secrets.json quandl_api_key

Parameters
  • max_back_quarter – max quarter number which will be used in model

  • min_back_quarter – min quarter number which will be used in model

  • data_source – which data use for model. One of [β€˜sf1’, β€˜mongo’]. If β€˜mongo’, than data will be loaded from db, credentials specified at ~/.ml_investment/config.json. If β€˜sf1’ - from folder specified at sf1_data_path in ~/.ml_investment/secrets.json.

  • pretrained – use pretreined weights or not. Downloading directory path can be changed in ~/.ml_investment/config.json models_path

  • verbose – show progress or not

ml_investment.applications.fair_marketcap_diff_sf1.main(data_source)[source]

Default model training. Resulted model weights directory path can be changed in ~/.ml_investment/config.json models_path

MarketcapDownStdYahoo

ml_investment.applications.marketcap_down_std_yahoo.MarketcapDownStdYahoo(pretrained=True) ml_investment.pipelines.Pipeline[source]

Model is used to predict future down-std value. Pipeline consist of time-series model training( TimeSeriesOOFModel ) and validation on real marketcap down-std values( DailyAggTarget ). Model prediction may be interpreted as β€œrisk” for the next quarter. yahoo is used for loading data.

Parameters

pretrained – use pretreined weights or not. If so, marketcap_down_std_yahoo.pickle will be downloaded. Downloading directory path can be changed in ~/.ml_investment/config.json models_path

ml_investment.applications.marketcap_down_std_yahoo.main()[source]

Default model training. Resulted model weights directory path can be changed in ~/.ml_investment/config.json models_path

MarketcapDownStdSF1

ml_investment.applications.marketcap_down_std_sf1.MarketcapDownStdSF1(max_back_quarter: Optional[int] = None, min_back_quarter: Optional[int] = None, data_source: Optional[str] = None, pretrained: bool = True, verbose: Optional[bool] = None) ml_investment.pipelines.Pipeline[source]

Model is used to predict future down-std value. Pipeline consist of time-series model training( TimeSeriesOOFModel ) and validation on real marketcap down-std values( DailyAggTarget ). Model prediction may be interpreted as β€œrisk” for the next quarter. sf1 is used for loading data.

Note

SF1 dataset is paid, so for using this model you need to subscribe and paste quandl token to ~/.ml_investment/secrets.json quandl_api_key

Parameters
  • max_back_quarter – max quarter number which will be used in model

  • min_back_quarter – min quarter number which will be used in model

  • data_source – which data use for model. One of [β€˜sf1’, β€˜mongo’]. If β€˜mongo’, than data will be loaded from db, credentials specified at ~/.ml_investment/config.json. If β€˜sf1’ - from folder specified at sf1_data_path in ~/.ml_investment/secrets.json.

  • pretrained – use pretreined weights or not. Downloading directory path can be changed in ~/.ml_investment/config.json models_path

  • verbose – show progress or not

ml_investment.applications.marketcap_down_std_sf1.main(data_source)[source]

Default model training. Resulted model weights directory path can be changed in ~/.ml_investment/config.json models_path