model_eval¶
This module contains code for saving, loading, and evaluating pre-trained models.
Functions
load_model (model_path) |
It loads a pre-trained TSVM-based estimator. |
save_model (validator, params, output_file) |
It saves an estimator with specified hyper-parameters and a evaluation method. |
Classes
ModelThread (usr_in) |
Evaluates a pre-trained model in a thread. |
-
model_eval.
save_model
(validator, params, output_file)[source]¶ It saves an estimator with specified hyper-parameters and a evaluation method.
Parameters: validator : object
An evaluation method.
params : dict
Hyper-parameters of the estimator.
output_file : str
The full path and filename of the saved model.
-
model_eval.
load_model
(model_path)[source]¶ It loads a pre-trained TSVM-based estimator.
Parameters: model_path : str
The path at which the model is stored.
Returns: object
A pre-trained estimator.
dict
Model information.
-
class
model_eval.
ModelThread
(usr_in)[source]¶ Bases:
PyQt5.QtCore.QObject
Evaluates a pre-trained model in a thread.
Parameters: usr_input : object
An instance of
UserInput
class which holds the user input.Methods
blockSignals
(self, b)childEvent
(self, a0)children
(self)connectNotify
(self, signal)customEvent
(self, a0)deleteLater
(self)destroyed
destroyed(self, object: typing.Optional[QObject] = None) [signal] disconnect
(a0)disconnectNotify
(self, signal)dumpObjectInfo
(self)dumpObjectTree
(self)dynamicPropertyNames
(self)eval_model
()It evaluates a pre-trained model on test samples. event
(self, a0)eventFilter
(self, a0, a1)findChild
(self, type, name, options, …)findChild(self, types: Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject findChildren
(self, type, name, options, …)findChildren(self, types: Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type: type, regExp: QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, types: Tuple, regExp: QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type: type, re: QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, types: Tuple, re: QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] inherits
(self, classname)installEventFilter
(self, a0)isSignalConnected
(self, signal)isWidgetType
(self)isWindowType
(self)killTimer
(self, id)metaObject
(self)moveToThread
(self, thread)objectName
(self)objectNameChanged
objectNameChanged(self, objectName: str) [signal] parent
(self)property
(self, name)pyqtConfigure
(…)Each keyword argument is either the name of a Qt property or a Qt signal. receivers
(self, signal)removeEventFilter
(self, a0)sender
(self)senderSignalIndex
(self)setObjectName
(self, name)setParent
(self, a0)setProperty
(self, name, value)sig_update_model_eval
signalsBlocked
(self)startTimer
(self, interval, timerType)thread
(self)timerEvent
(self, a0)tr
(self, sourceText, disambiguation, n)