'When I use Pycaret predict_model(dt,data=data_unseen) to analyze only one row appears
I use Python pycaret module to analyze big set of data. I did setup, compare_model, create_model correctly, but when I try to use model I created to predict the unseen_date I splite from beginning, there is only one row come, there is supposee 100k row need predict. I do skip the tune part cause it is take too long but I dont think thats the reason
TSLASAMPLE = TSLA.sample(frac=0.8)
data_unseen = TSLA.drop(TSLASAMPLE.index)
TSLASAMPLE.reset_index(drop=True, inplace=True)
data_unseen .reset_index(drop=True, inplace=True)
TSLAinput = setup(data = TSLASAMPLE, target= 'prtPrice', use_gpu=True,html=False,silent=True)
dt = create_model('dt')
prediction = predict_model(dt,data=data_unseen)
output:
Model MAE MSE RMSE R2 RMSLE MAPE
0 Decision Tree Regressor 0.1842 1.8393 1.3562 0.9996 0.0303 0.0082
Solution 1:[1]
This is expected. The results (1 row) that you see are the metrics on the unseen data. The actual predictions are in your prediction variable.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Nikhil Gupta |