In this code i m getting error can you plz help timeseries evaluation metrics func validate DT SF3 CentreLift pred Inverse 0

0 votes
ValueError                                Traceback (most recent call last)
<ipython-input-44-fcaf93c4e487> in <module>
----> 1 timeseries_evaluation_metrics_func(validate['DT_SF3_CentreLift'],pred_Inverse[0])

<ipython-input-30-c158671e5d38> in timeseries_evaluation_metrics_func(y_true, y_pred)
      4         return np.mean(np.abs((y_true - y_pred) / y_true)) * 100
      5     print('Evaluation metric results:-')
----> 6     print(f'MSE is : {metrics.mean_squared_error(y_true, y_pred)}')
      7     print(f'MAE is : {metrics.mean_absolute_error(y_true, y_pred)}')
      8     print(f'RMSE is : {np.sqrt(metrics.mean_squared_error(y_true, y_pred))}')

C:\ProgramData\Anaconda3\lib\site-packages\sklearn\metrics\_regression.py in mean_squared_error(y_true, y_pred, sample_weight, multioutput, squared)
    250     """
    251     y_type, y_true, y_pred, multioutput = _check_reg_targets(
--> 252         y_true, y_pred, multioutput)
    253     check_consistent_length(y_true, y_pred, sample_weight)
    254     output_errors = np.average((y_true - y_pred) ** 2, axis=0,

C:\ProgramData\Anaconda3\lib\site-packages\sklearn\metrics\_regression.py in _check_reg_targets(y_true, y_pred, multioutput, dtype)
     82 
     83     """
---> 84     check_consistent_length(y_true, y_pred)
     85     y_true = check_array(y_true, ensure_2d=False, dtype=dtype)
     86     y_pred = check_array(y_pred, ensure_2d=False, dtype=dtype)

C:\ProgramData\Anaconda3\lib\site-packages\sklearn\utils\validation.py in check_consistent_length(*arrays)
    210     if len(uniques) > 1:
    211         raise ValueError("Found input variables with inconsistent numbers of"
--> 212                          " samples: %r" % [int(l) for l in lengths])
    213 
    214 

ValueError: Found input variables with inconsistent numbers of samples: [175156, 10]
Jan 16, 2022 in Python by Joshi

edited 5 days ago 9 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP