11"""InceptionTime and Inception classifiers."""
22
3+ from __future__ import annotations
4+
35__maintainer__ = ["hadifawaz1999" ]
46__all__ = ["InceptionTimeClassifier" ]
57
@@ -251,7 +253,7 @@ def __init__(
251253
252254 super ().__init__ ()
253255
254- def _fit (self , X , y ) :
256+ def _fit (self , X : np . ndarray , y : np . ndarray ) -> InceptionTimeClassifier :
255257 """Fit the ensemble of IndividualInceptionClassifier models.
256258
257259 Parameters
@@ -307,7 +309,7 @@ def _fit(self, X, y):
307309
308310 return self
309311
310- def _predict (self , X ) -> np .ndarray :
312+ def _predict (self , X : np . ndarray ) -> np .ndarray :
311313 """Predict the labels of the test set using InceptionTime.
312314
313315 Parameters
@@ -328,7 +330,7 @@ def _predict(self, X) -> np.ndarray:
328330 ]
329331 )
330332
331- def _predict_proba (self , X ) -> np .ndarray :
333+ def _predict_proba (self , X : np . ndarray ) -> np .ndarray :
332334 """Predict the proba of labels of the test set using InceptionTime.
333335
334336 Parameters
@@ -351,24 +353,30 @@ def _predict_proba(self, X) -> np.ndarray:
351353 return probs
352354
353355 @classmethod
354- def load_model (self , model_path , classes ):
355- """Load pre-trained classifiers instead of fitting.
356+ def load_model (
357+ self , model_path : list [str ], classes : np .ndarray
358+ ) -> InceptionTimeClassifier :
359+ """Load pre-trained keras models from disk instead of fitting.
356360
361+ Pretrained models should be saved using "save_best_model"
362+ or "save_last_model" boolean parameter.
357363 When calling this function, all functionalities can be used
358- such as predict, predict_proba, etc. with the loaded models .
364+ such as predict, predict_proba etc. with the loaded model .
359365
360366 Parameters
361367 ----------
362368 model_path : list of str (list of paths including the model names and extension)
363- The directory where the models will be saved including the model
364- names with a ".keras" extension.
365- classes : np.ndarray
369+ The complete path (including file name and '.keras' extension)
370+ from which the pre-trained model's weights and configuration
371+ are loaded.
372+ classes : np.ndarray
366373 The set of unique classes the pre-trained loaded model is trained
367374 to predict during the classification task.
375+ Example: model_path="path/to/file/best_model.keras"
368376
369377 Returns
370378 -------
371- None
379+ InceptionTimeClassifier
372380 """
373381 assert (
374382 type (model_path ) is list
0 commit comments