check_forecaster_methods_call_check_is_fitted¶
yohou.testing.check_forecaster_methods_call_check_is_fitted(forecaster, y, X_actual=None, forecasting_horizon=3)
¶
Check all forecaster methods (except fit) raise NotFittedError when unfitted.
Validates that predict()/predict_interval(), observe(), rewind(), and observe_predict()/observe_predict_interval() methods all check fitted state and raise NotFittedError before operating on an unfitted forecaster.
For class-probability forecasters, predict() is the prediction method exercised (they also expose predict_class_proba(), which delegates through the same fitted-state guard).
Parameters ¶
| Name | Type | Description | Default |
|---|---|---|---|
forecaster
|
BaseForecaster
|
Unfitted forecaster instance |
required |
y
|
DataFrame
|
Training/test target data with "time" column |
required |
X_actual
|
DataFrame
|
Training/test features with "time" column |
None
|
forecasting_horizon
|
int
|
Number of steps ahead to forecast |
3
|
Raises ¶
| Type | Description |
|---|---|
AssertionError
|
If any method fails to raise NotFittedError when called on unfitted forecaster |
Source Code ¶
Source code in src/yohou/testing/forecaster.py
865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 | |