tatsath / fin-ml Goto Github PK
View Code? Open in Web Editor NEWThis github repository of "Machine Learning and Data Science Blueprints for Finance". Please star.
This github repository of "Machine Learning and Data Science Blueprints for Finance". Please star.
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.
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.
The code, as written, does not create equally distributed classes.
Hi,
Where is the dataset related to the chapter 2 ? Thank you in advance.
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:
But the paragraph explains another way:
[...]In state s1 it has only two possible actions:
Which is correct?
Thank you.
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.
During the training of the model i can't even finish the first episode because after some time I get the message "Kernel died". I'm using a macbook with m1. I tried to lower the training size, the memory size, but the result is always the same.
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.
Trying to follow along with code from
https://github.com/tatsath/fin-ml/blob/master/Chapter%205%20-%20Sup.%20Learning%20-%20Regression%20and%20Time%20Series%20models/Case%20Study%201%20-%20Stock%20Price%20Prediction/StockPricePrediction.ipynb
I am receiving the following error:
"ValueError: Setting a random_state has no effect since shuffle is False. You should leave random_state to its default (None), or set shuffle=True."
Trying to follow along with the code, I have an error while trying to get the portfolio weights :
AttributeError: 'Series' object has no attribute 'append'
The error seems to be in the function getQuasiDiag(link) where it's trying to append a Series object
The Derivatives Hedging notebook in Chapter 9 does not work with the latest version of TensorFlow (Keras).
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?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.