I have an xgboost trained model. I need to predict a single instance at a time. But I see that prediction time for all the sizes of a matrix (num_instances x num_features) is same (~ 90 sec)
[1 (num_instances) x 300k (num_features)]
[500(num_instances) x 300k(num_features)]
[20k(num_instances) x 300k(num_features)]
bst = xgb.Booster()
bst.load_model(‘trained.model’)
dtest = xgb.Dmatrix(‘test_data_libsvm_format.txt’)
ypred = bst.predict(dtest)
I have very sparse data. I tried using libsvm format and scipy.sparse format. Both takes almost same time for single instance.
How can I get a single instance prediction time < 1 sec ? How can xgboost can be used in a time-sensitive production systems where user might not wait for 90 sec. ?