-1
$\begingroup$

I am working with a financial dataset size which is around 3000. I have attempted the supervised-learning regression techniques and not able to go beyond 70% accuracy.

  1. Features: 10
  2. Data size:3700
  3. Models attempted: Decision Trees, Random forest, Lasso Regression, Ridge regression, Linear regression

I am of the opinion that dataset size is too small to expect any good results beyond 65%. It's obvious because machine learning algorithms are data-hungry in nature. However, In a generic sense, Is there a lower-bound on the dataset size that has been found to achieve 90% accuracy?

Such a theory would also help me to gather data until I reach that point and then do some productive work.

Any help is appreciated.

$\endgroup$
  • $\begingroup$ Could you please post information about your data set? How many attributes do you have, what types?. What models did you try to build? Right now your question is too vague. You can always plot validation curves. If you're still going up with the scores, you can try to add more data. $\endgroup$ – Piotr Rarus - Reinstate Monica Nov 25 '19 at 10:17
  • $\begingroup$ @PiotrRarus I have added some info. However, my question is more generic in nature. Assume that I have the best of features(maybe 10/20/100/1000) to predict but have fewer training samples(around 3000). What would you say now? $\endgroup$ – Eswar Nov 25 '19 at 12:32
  • $\begingroup$ Your model ability doesn't depend only on data size. These quantities tell you nothing about actuall amount of 'knowledge' that's in your data. The number, you presented, should be sufficient to achieve higher scores. What's happening is: you didn't cover your domain or you have contradictory knowledge. This might result in decision rules, which are hard to capture. You can try also to run xgb on it, it's less prone for outliers. What is your preprocessing pipeline? $\endgroup$ – Piotr Rarus - Reinstate Monica Nov 25 '19 at 13:49
  • $\begingroup$ You could also try to create DNN models, which are better for capturing those non-linearites in your data. $\endgroup$ – Piotr Rarus - Reinstate Monica Nov 25 '19 at 13:49
  • $\begingroup$ @PiotrRarus Does DNN work for 3k data size? $\endgroup$ – Eswar Nov 25 '19 at 13:58
2
$\begingroup$

There is no theory or general case that sets the size of dataset required to reach any target accuracy. Everything is dependent on the underlying, and usually unknown, statistics of your problem.

Here are some trivial examples to illustrate this. Say want to predict the sex of a species of frog:

  • It turns out the skin colour is a strong predictor for the species Rana determistica, where all males are yellow and all females blue. The minimal dataset to get 100% accuracy on the prediction task is data for two frogs, one of each sex.

  • It turns out the skin colour is uncorrelated for the species Rana stochastica, where 50% of each sex are yellow and the other 50% are blue. There is no size of dataset of frog colour labelled with sex that will get you better than 50% accuracy on the task.

  • However, Rana stochastica does have eye colouration with almost determistic relationship to the sex of the creature. It turns out that 95% of males have orange eyes and 95% of females have green eyes (with only those two eye colours possible). Those are predictive variables that are strong enough that you can get 95% accuracy if you can discover the relationship.

Some related theory worth reading to do with limitations of statistical models is Bayes error rate.

In the last case, simply predicting "male" for orange eyes and "female" for green eyes will give you 95% accuracy. So the question is what size of dataset would guarantee a model would both make those predictions, plus give you the confidence that you had beaten your 90% accuracy goal? It can be figured out, assuming you collect labelled sample data at random - note that there is a good chance that models trained on very little data would get 95% accuracy, but that it could take a lot more data for a test set in order for you to be confident that you really had a good enough result.

The maths to demonstrate even this simple case is long-winded and complex (if I were to outline the theory being used), and does not actually help you, so I am not going to try and produce it here. Plus of course I chose 95%, but if the eye colour relationship was only 85% predictive of sex, then you would never achieve 90% accuracy. With a real project you have many more variables and at best only a rough idea on how they might correlate with the target variable or each other in advance, so you cannot do the calculation.

I think instead it is more productive to look at your reason for wanting a theory to choose your dataset size:

Such a theory would also help me to gather data until I reach that point and then do some productive work.

Sadly you cannot do this theoretically. However, you can do a few useful things:

Plot a learning curve against data set size

I'd recommend this as your approach here. The driving question behind your question is: Will collecting more data improve my existing model?

Using the same cross-validation set each time, train your model with increasing amounts of data from your training set. Plot the cross-validated accuracy against number of training samples, up to the whole training set that you have so far.

  • If the graph has an upward slope all the way to end, then this implies that collecting more data will improve accuracy for your current model.

  • If the graph is nearly flat, with accuracy not improving towards the end, then it is unlikely that collecting more data will help you.

This does not tell you how much more data you need. An optimistic interpretation could take the trend line over the last section of the graph and project it to where it crosses your target accuracy. However, normally the returns for more data will become less and less. The training curve will asymptotocally approach some maximum possible accuracy for the given dataset and model. What plotting the curve using the data you have does is allow you to see where you are on this curve - perhaps you are still in the early parts of it, and then adding more data will be a good investment of your time.

Reassess your features and model

If your learning curve is not promising, then you need to look in more detail. Here are some questions you can ask yourself, and maybe test, to try and progress.

  • Your features:

    • Are there more or different features that you could collect, instead of focussing on collecting more of the same?
    • Would some feature engineering help - e.g. is there any theory or domain expert knowledge from the problem that you can turn into a formula and express as a new feature?
  • Your model:

    • Are there any hyper-parameters you can tune to either get more out of the existing data, or improve the learning curve so that is worth going back to get more data?
    • Would an entirely different model help? Deep learning models are often top performers only when there is a lot of data, so you might consider switching to a deep neural network and plotting a learning curve for it. Even if the accuracy on your current dataset is worse, if the learning curve shows a different model type might have the capacity to go further, it might be worth it.

Do note however, that you could just end up with the same maximum accuracy as before, after a lot of hope and effort. Unfortunately, this is hard to predict, and you will need to make careful decisions about how much of your time is worth sinking into solving the original problem.

Check confidence limits to choose a minimum test dataset size

Caveat: This is a guide to thinking about data set sizes, especially test set sizes. I have never known anyone use this to actually select some ideal data set size. Usually it happens the other way around, you have some size of test data set made available to you, and you want to understand what that tells you about your accuracy measurements.

You could determine a test set size that gives you reasonable confidence bounds on accuracy. That will mean, when you measure your 90% accuracy (or better) that you can be reasonably certain that the true accuracy is close to it. You can do this using confidence intervals on the accuracy measure.

As an example from the above link, you could measure a 92% accuracy on your test set, and want to know whether you are confident in that result. let's say you want to be 95% certain that you really do have accuracy > 0.9 . . . how should you choose N, the size of your test set?

You know that you are 0.02 over the desired accuracy by measurement, and you want to know if this enough that you can claim to be certain that you have 90% accuracy:

$$0.02 > 2 \sqrt{\frac{0.92 \times 0.08}{N}}$$

Therefore you need

$$N > \frac{0.92 \times 0.08}{0.0001}$$

$$N > 736$$

This is the minimum test data set size that would give you confidence that you have met your target of 90% accuracy, provided that

  • you have actually measured 92% or higher accuracy
  • you have selecting test data at random from the target population
  • that you have not used the test data set to select a model (by e.g. doing this test multiple times until you got a good result)

Typically you don't work backwards like this to figure N for a specific accuracy, but it is useful to understand the limits of your testing. You should generally consider how the size of the test dataset limits the accuracy by which you can confirm your model.

The formula above also has limitations when measuring close to 100% accuracy, and this is because the assumptions behind it fail - you would need to switch to more complex methods, perhaps a Bayesian approach, to get a better feel for what such a result was telling you, especially if the test sample size was small.

After you have established a minimum test dataset size, you could use that to guide data collection. For instance, the typical train/cv/test dataset might be 60/20/20, so with your result above you could choose an overall dataset size of 5 times 736, let's round up and call it 4000. In general this sets a lower bound on the size of dataset, as it says nothing about how hard it would be to learn a specific accuracy.

|improve this answer|||||
$\endgroup$
  • $\begingroup$ That's a very good answer. $\endgroup$ – Ilker Kurtulus Nov 26 '19 at 8:19
3
$\begingroup$

There are no general rules such that n features, m observations with a X type learner give q accuracy.

Your predictor depends on features in your model.

Let's say you wanna predict volume of trade between two countries. And lets say (hypothetically) this trade regulated and its the only variable. If you add features that can explain regulation changes your model will be quite good with few features. However if you dont add those regulation based features and add hundreds of financial variables, you model wont be good that much even you have lost of predictors.

I hope you got the point. Your model performance depends on relevance of features and training sample that can reflect what you really predict.

|improve this answer|||||
$\endgroup$
  • $\begingroup$ I can't agree more with you. But assuming the data is extremely informative in terms of the features/attributes(the best we can get) but it's small(3000) in size? What do you say? $\endgroup$ – Eswar Nov 25 '19 at 12:30
  • $\begingroup$ How can you measure "extremely informative in terms"? If it so, accuracy/roc_auc should be close to 1. (or rmse/mse close 0) $\endgroup$ – Ilker Kurtulus Nov 25 '19 at 12:37
  • $\begingroup$ @Eswar , yes your model could perform better with more data but if the features have no expressive power, then it still will not generate satisfying outcome. Scaling the data also requires your model to have the learning capacity to learn it. If your model has low learning capacity such as Linear model then it would not work well even with millions of data points. $\endgroup$ – Yohanes Alfredo Nov 25 '19 at 15:59
  • $\begingroup$ Increasing number of observations will improve your model while holding features constant since you let your model see and learn more your sample. Think about car detection: if you dont feed your model with cybertruck, the model cant identify it as a car, while it can detect other cars :) $\endgroup$ – Ilker Kurtulus Nov 26 '19 at 8:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.