GithubHelp home page GithubHelp logo

tatsath / fin-ml Goto Github PK

View Code? Open in Web Editor NEW
735.0 735.0 370.0 163.11 MB

This github repository of "Machine Learning and Data Science Blueprints for Finance". Please star.

Jupyter Notebook 99.97% Python 0.03%
algorithmic-trading finance fintech machine-learning python

fin-ml's Introduction

fin-ml's People

Contributors

sahil231090 avatar tatsath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fin-ml's Issues

chapter 9, case study 3, fuction nn_pred_to_weights is not reasonable

In DQN, the Q-network is an approximation of optimal action value fuction, so that the action with max value is the action agent should choose. If the input to Q-network is only the state, the output should be value of each action, so the output dim should be same as action dim. The implicit policy is the argmax of action value. However, in this code, the action is a complex mapping from all action value to asset weight (in fuction nn_pred_to_weights), which I think is not reasonable.

Chapter 7, Do the portfolio's which have negative weights for stocks like weights[1] mean to sell those?

Hi i just wanted to clarify if for example portfolio 2 / weights[2] which has negative weights does that mean in the portfolio its meant to be a sell with such a weight?

example : weights
WMT 154.600
HD 98.409
WBA 83.098
INTC 73.599
MRK 70.360
PG 69.292
VZ 67.323
KO 63.387
CSCO 59.287
PFE 57.201
MSFT 54.698
JNJ 50.306
MCD 50.279
IBM 39.230
NKE 32.219
AAPL 26.293
DIS 26.185
AXP -3.605
TRV -16.914
UNH -32.764
JPM -35.070
GS -53.526
MMM -64.635
BA -78.023
UTX -83.237
CAT -133.755
XOM -225.916
CVX -248.319

or do the negative numbers just mean do nothing with them?

Chapter 2 : dataset

Hi,

Where is the dataset related to the chapter 2 ? Thank you in advance.

Chapter 6 -

Hi -

I am getting error ""['id'] not in index" when the below code is run in chapter 6 - LoanDefaultProbability
dataset[['id','emp_title','title','zip_code']].describe()

Can you help, I made no changes in the code.

Bitcoin trading strategy with RF, where is the actual signal output for the most recent time stamp?

Okay so say I want to use this on the data up until today, rather than just the signal of the short ema higher than the long ema, how do i combine the signal of all of the features to then come up with the binary decision to buy or sell? All that I am seeing is the binary decision for the ['signal'] column which is only based on the ema's, how do i go about retreiving the signal that combines all of the features, I see where thing's get backtested and we see the final results but how do i dig into the most recent time stamp to tell if it's a buy or sell signal based on all of the features rather than just the ema's for todays price? I'm confused of how to go about extracting the signal to actually use it in production, I would greatly appreciate your response, thank you.

Chapter 9, Case study 1 - typo / logical

Hello, I found a typo or logical error in chapter 9 - RL model page 290.

Figure 9-4 describes:
In-state S1 (stagnant market) there are 2 option:

  1. hold a0
  2. sell a2

But the paragraph explains another way:
[...]In state s1 it has only two possible actions:

  1. hold a0
  2. buy a1

Which is correct?
Thank you.

Binder does not open and Yahoo Finance no longer supported. Which library to use?

Hello,

I have been trying to get started with the case studies in the book using both the Binder notebooks and Jupyter notebooks provided through supplemental GitHub material. When I try to create a Binder instance, I receive the following error:

` error: subprocess-exited-with-error

ร— python setup.py egg_info did not run successfully.
โ”‚ exit code: 1
โ•ฐโ”€> [15 lines of output]
/tmp/pip-install-mbfkwcqr/pandas_6b0bec17a8b44e1eab271987003b87bd/setup.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
/srv/conda/envs/notebook/lib/python3.10/site-packages/setuptools/init.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

          ********************************************************************************
          Requirements should be satisfied by a PEP 517 installer.
          If you are using pip, you can try `pip install --use-pep517`.
          ********************************************************************************
  
  !!
    dist.fetch_build_eggs(dist.setup_requires)
  error in pandas setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected end or semicolon (after version specifier)
      pytz >= 2011k
           ~~~~~~~^
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

ร— Encountered error while generating package metadata.
โ•ฐโ”€> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Removing intermediate container bc318755c302
The command '/bin/sh -c ${KERNEL_PYTHON_PREFIX}/bin/pip install --no-cache-dir -r "requirements.txt"' returned a non-zero code: 1`

I tried poking around the documentation but did not see any good way to implement the recommended 'PEP 57 installer'.

Then I tried using the Jupyter notebooks for the "Stock Price Prediction" case. Unfortunately, Yahoo finance is no longer supported, yfinance is a fragile web scraper substitute, and quandl did not work either.

What is the recommended path forward here? Unfortunately, I do not have a developer background and come more from the finance side. I am happy to explore the technical architecture and requirements, but feel like I am a bit outside my domain of expertise.

Chapter 9, Case study 1 - no buy signal on the test set

Hello,

I have been trying to run Case 1 of Chapter 9 (Reinforcement Learning) both on Jupyter and on Pyhton on my local PC. Every time I get a blank result from running the trained model on the test set - there are no buy signals and hence no P&L generated. I tried different options including using the train set instead of the test set, but still the result is the same. The model training goes ok by going through a number of episodes, but then when it comes to using the model that has been created, there seems to be an issue as there are no buy signals generated. Could you please look into this to see if the Jupyter code as posted on GitHub works fine and whether there are any typos or errors in it.

Thank you and kind regards,
Alex M.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.