4

That is a very good question. If you look at sklearn fit() method parameters, you can find sample_weights parameter which tells the model which samples it should give more attention/weight when the model is fit. Sample uniqueness is a bit different. Firstly, sample uniqueness is used to calculate sample weights (for return based sample weights, we divide ...


4

I started with "Pandas for Data Analysis" by Wes Mckinney (the original developer of pandas) without ever using Python before. After 3yrs I have the skills of a full stack developer, after some other projects using for example "Flask for Web Development" by Miguel Grinberg which is nice project for getting familiar with databases and SQLAlchemy class ...


4

Try Hilpisch's books, especially Python for Finance. For derivatives pricing specifically, he wrote Derivatives Analytics with Python. Hope that helps.


4

The first thing you can do to help a neural network learn more rapidly is to normalize all inputs between 0 and 1. The library sklearn has a preprocess.scale() function that does just that -- make sure to do it separately for training and testing data (or training, validation and testing data if you use three separate sets). This alone can make a huge ...


4

To be honest this question isn't really within scope of QuantFinance because it is borderline opinion based but I will contribute an answer to the community regardless. If you cannot determine the difference between stats and ML then you might consider that you do not understand the uses and methods used within each relevant discipline and may have to do ...


3

here is a quick list you can apply for quant finance and use as projects: Risk ( as markets seem quite uncertain ) Predict the risk factors exposure of a stock given its quarterly reports and press releases. If a stock started trading only recently, you have very little information to assess its exposure to risk factors. NLP can help by using the reports of ...


3

It appears that you are using "linearity" in a litteral sense while De Prado is using it in a broader sense, which is quite common in Statistics. In Statistics Linearity is not what the formula looks like, it is the properties and assumptions of the system under study. You consider the Normal distribution non-linear because it has an exponential and some ...


3

The standard approach for cross-validation is to work with three datasets the training set, the validation set, the test set. You train on the training set (no surprise), and you use the validation set to decide for your hyper-parameters. Then you retrain, test on the test set (no surprise again), and it is done. My advice here is to consider that the ...


2

One option could be to use an early stopping mechanism, e.g. stop when the average reward per episode on a validation set stops increasing. In practice, I found this to be a bad idea as you generally don't have enough data to be able to afford a validation set when using daily data (in addition to the test set). If you are dealing with higher frequency data ...


2

Its called 'universal' because, unlike usual models trained on time series for a given stock/ contract, this model is trained on a POOLED data set (in this case 500 or so stocks) and is then shown to be applicable for forecasting any stock, including those not included in the training data. This is different from the usual approach where, say, you use time ...


2

The following presentations will shed some light: Class notes from Cornell: Lopez de Prado Ernie Chan's presentation of Meta-Labelling


2

If you read the literature in the references and bibliography sections you will see that a common technique is to sample about 50 times a day. This is done by calculating the 30 day moving average of volume and then dividing by 50. This will give you the threshold level needed for sampling on a volume clock.


2

This is really a career advice question, which doesn't belong here. But if it were rephrased to ask for ideas for a cool / impressive NLP school project, I'd suggest: parse a financial derivative term sheet, decide whether it is a "vanilla" trade that we know how to book, or it may have some exotic features that a human needs to look at; parse an ...


2

Given you have a database that stores this data daily, you could write a short python script to apply your screening and email you the daily rankings or scores. I think you can even do this in Excell if you have a Bloomberg or TR terminal. I am pretty sure that you can. If you want to backtest the performance of such a strategy then I think using ...


1

The sortino ratio is also important for evaluating trading strategies. also the omega ratio. The question is a poor one though. Each of the mentioned ratios will be the most predictive at predicting ... THEMSELVES! respectively. you don't use the calmar to predict the sharpe. ok, what you are probably actually asking is which of the performance metrics ...


1

The best bet for you is to use Ensemble Learning, as someone experienced with Kaggle competitions, the best way to replicate good performance on Private Learderboard is to ensemble as many algorithms together. This includes intra and inter ensembling. Intra meaning ensembling same algorithms (e.g Xgboost) but with different tuning parameters. You can chose ...


1

Stochastic solutions are an unavoidable property of stochastic methods, in particular optimisation methods. See for instance section 3 in A Review of Heuristic Optimization Methods in Econometrics. In general, you cannot get rid of randomness; you need to analyse it, by looking at and analysing distributions (e.g. of portfolios) instead of single numbers. ...


1

Have you tried to choose an arbitrary number of model, let say 20, each one having its own seed? Then you run your twenty models and use the median of your 20 results as signal. One advantage of that method is that you can also get a confidence estimate of your prediction thanks to the standard deviation of your 20 results.


1

So I'll start with what I have done recently for my undergraduate thesis before relating it to your question. I trained a SVM on Technical Analysis data to classify the trend for the next hour. Unlike your strategy, I did not train the model with/for visual inspection of price patterns etc, but rather trained the model on the rate of change of several ...


1

To put it very bluntly: The requirements of ML models are irrelevant to the principles of financial analysis. Imputing the returns is fundamentally extremely unsound. The best you can do is trim the dataset down to the smallest timeframe (in your case, 3 years). Or you can consider only those funds for which you do have sufficient data.


1

To solve your multicollinearity problem I would first perform a regularization technique such as Ridge or Elastic Net. If you choose Ridge for example, once you have tuned your hyperparameter through cross validation (for time series a forward walk approach is preferable) you can fit after your simple OLS by choosing the predictors with the biggest ...


1

If you apply the RF to the financial time series rather than the first order log diff then your model will overfit by learning the price levels. I would not do it that way.


1

It's not out of sample. This is known as the walk-forward backtest and the problem is that you adjust your model based on the PnL curve. You add improvements to reduce drawdowns and increase returns and thus whilst you are scoring and measuring performance that wasn't used in training, you adjust your model based on the scored data. Thus that data forms part ...


1

The following python package, mlfinlab, provides an implementation for both standard and information-driven bars. The good news is that you won't have to implement the techniques from scratch and they will also work on minute time stamps. Regarding how to approximate the VWAP of a minute bar: Perhaps it's better to take the average (midpoint) of only the ...


1

Q1: Moving to a classification setting, is to date the most common technique in the literature. Most typically is to predict the direction of a move over some defined horizon, say 1 day or 1 month. An advanced technique is to apply triple barrier labeling and drop the rare class labels. Q2: Jigar Patel, et al wrote a good paper on trend deterministic data ...


1

Using the Triple Barrier Labeling you would use the labels [-1, 0, 1] to indicate which barrier was reached first. You should have very few 0 labels and thus you can remove them from the sample. If you have many 0 labels then you have set your take profit and stop loss levels too high. To determine the TP and SL levels you can use synthetic data to ...


1

The idea for the Triple Barrier Labeling, I believe, is largely based on optimal bet sizing algorithms and classic financial engineering stochastic processes / random walks. Regarding the optimal bet sizing literature: A fundamental algorithm in capital growth theory is the Kelly Criterion which relies on having the probability of success and the odds of a ...


1

The problem you describe can be handled as an optimization problem: evolve a program such that it maximizes some performance measure. The technique you may want to look into is called "Genetic Programming". For a financial application see for example Single versus Multiple Tree Genetic Programming for Dynamic Decision Making.


1

The following post on cross-validated has quite a good answer: "Random forest uses bagging (picking a sample of observations rather than all of them) and random subspace method (picking a sample of features rather than all of them, in other words - attribute bagging) to grow a tree. If the number of observations is large, but the number of trees is too ...


1

OK, in for a penny, in for a pound :-) First, let us assume that you have symmetrical critical levels higher and lower (call them “target” and “stop” if you will). Only in this case is the hit rate relevant. Even, then the hit rate is a function of time. If you take a 5d/1w view, then being 51% right is very different to being to being 51% right on a 21d/...


Only top voted, non community-wiki answers of a minimum length are eligible