core.model package¶
Submodules¶
core.model.gaussian_process_classifier module¶
-
class
core.model.gaussian_process_classifier.GPC(train, test)[source]¶ Bases:
core.model.superclass.NormalModelUsing Gaussian Process Classifier model to predict the occupancy level
This is a normal supervised learning model.
- Parameters
train (core.data.dataset.Dataset) – the labelled ground truth Dataset for training the model
test (core.data.dataset.Dataset) – the Dataset for testing by using sensor data only
- Return type
- Returns
Predicted occupancy level corresponding to the test Dataset
core.model.gaussian_process_regression module¶
-
class
core.model.gaussian_process_regression.GPR(train, test)[source]¶ Bases:
core.model.superclass.NormalModelUsing Gaussian Process Regressor model to predict the occupancy level
This is a normal supervised learning model.
- Parameters
train (core.data.dataset.Dataset) – the labelled ground truth Dataset for training the model
test (core.data.dataset.Dataset) – the Dataset for testing by using sensor data only
- Return type
- Returns
Predicted occupancy level corresponding to the test Dataset
core.model.hmm_core module¶
core.model.nn module¶
-
class
core.model.nn.NN(train, test)[source]¶ Bases:
core.model.superclass.NormalModelUsing Multi-layer Perception Classifier model to predict the occupancy level
This is a normal supervised learning model.
- Parameters
train (core.data.dataset.Dataset) – the labelled ground truth Dataset for training the model
test (core.data.dataset.Dataset) – the Dataset for testing by using sensor data only
solver (str) – the solver for weight optimization. Choice of
'lbfgs','sgd', or'adam'alpha (float) – l2 penalty (regularization term) parameter
batch_size (int or
'auto') – size of minibatches for stochastic optimizersactivation (str) – activation function for the hidden layer. Choice of
'identity','logistic','tanh', or'relu'
- Return type
- Returns
Predicted occupancy level corresponding to the test Dataset
core.model.particle_filtering module¶
-
class
core.model.particle_filtering.PF(train, test)[source]¶ Bases:
core.model.superclass.NormalModelUsing Particle Filtering model to predict the occupancy level
This is a normal supervised learning model.
- Parameters
train (core.data.dataset.Dataset) – the labelled ground truth Dataset for training the model
test (core.data.dataset.Dataset) – the Dataset for testing by using sensor data only
number_of_hidden_states (int) – the number of maximum occupancy level
- Return type
- Returns
Predicted occupancy level corresponding to the test Dataset
-
class
core.model.particle_filtering.PF_DA(source, target_retrain, target_test)[source]¶ Bases:
core.model.superclass.DomainAdaptiveModelUsing Particle Filtering model to predict the occupancy level
This is a domain-adaptive semi-supervised learning model.
- Parameters
source (core.data.dataset.Dataset) – the source domain with full knowledge for training the model
target_retrain (
Noneor core.data.dataset.Dataset) – the labelled ground truth Dataset in the target domain for re-training the modeltarget_test (core.data.dataset.Dataset) – the Dataset in the rest of the target domain for testing by using sensor data only
number_of_hidden_states (int) – the number of maximum occupancy level
- Return type
- Returns
Predicted occupancy level corresponding to the test Dataset
core.model.random_forest module¶
-
class
core.model.random_forest.RandomForest(train, test)[source]¶ Bases:
core.model.superclass.NormalModelUsing Random Forest model to predict the occupancy level
This is a normal supervised learning model.
- Parameters
train (core.data.dataset.Dataset) – the labelled ground truth Dataset for training the model
test (core.data.dataset.Dataset) – the Dataset for testing by using sensor data only
estimator (int) – number of estimators in Random Forest
- Return type
- Returns
Predicted occupancy level corresponding to the test Dataset
core.model.rnn module¶
-
class
core.model.rnn.DALSTM(source, target_retrain, target_test)[source]¶ Bases:
core.model.superclass.DomainAdaptiveModelUsing Long Short Term Memory model to predict the occupancy level
This is a domain-adaptive semi-supervised learning model.
- Parameters
source (core.data.dataset.Dataset) – the source domain with full knowledge for training the model
target_retrain (
Noneor core.data.dataset.Dataset) – the labelled ground truth Dataset in the target domain for re-training the modeltarget_test (core.data.dataset.Dataset) – the Dataset in the rest of the target domain for testing by using sensor data only
hm_epochs (int) – maximum number of epoches
batch_size (int) – size of minibatches for stochastic optimizers
cell (int) – number of LSTM cells in the hidden layer
learn_rate (float) – the initial learning rate used. It controls the step-size in updating the weights
- Return type
- Returns
Predicted occupancy level corresponding to the test Dataset
-
class
core.model.rnn.LSTM(train, test)[source]¶ Bases:
core.model.superclass.NormalModelUsing Long Short Term Memory model to predict the occupancy level
This is a normal supervised learning model.
- Parameters
train (core.data.dataset.Dataset) – the labelled ground truth Dataset for training the model
test (core.data.dataset.Dataset) – the Dataset for testing by using sensor data only
hm_epochs (int) – maximum number of epoches
batch_size (int) – size of minibatches for stochastic optimizers
cell (int) – number of LSTM cells in the hidden layer
learn_rate (float) – the initial learning rate used. It controls the step-size in updating the weights
- Return type
- Returns
Predicted occupancy level corresponding to the test Dataset
core.model.snmf module¶
-
class
core.model.snmf.NMF(train, test)[source]¶ Bases:
core.model.superclass.NormalModelUsing Sparse Non-negative Matrix Factorization model to predict the occupancy level
This is a normal supervised learning model.
- Parameters
train (core.data.dataset.Dataset) – the labelled ground truth Dataset for training the model
test (core.data.dataset.Dataset) – the Dataset for testing by using sensor data only
alpha (float) – constant that multiplies the regularization terms
beta (float) – constant that multiplies the regularization terms
- Return type
- Returns
Predicted occupancy level corresponding to the test Dataset
core.model.superclass module¶
-
class
core.model.superclass.DomainAdaptiveModel(source, target_retrain, target_test, thread_num=4)[source]¶ Bases:
objectUse all domain-adaptive semi-supervised learning model to train and test the given Datasets
- Parameters
source (core.data.dataset.Dataset) – the source domain with full knowledge for training the model
target_retrain (
Noneor core.data.dataset.Dataset) – the labelled ground truth Dataset in the target domain for re-training the modeltarget_test (core.data.dataset.Dataset) – the Dataset in the rest of the target domain for testing by using sensor data only
thread_num (int) – the maximum number of threads can use to speed up
- Return type
core.evaluation.superclass.DomainAdaptiveModel
-
class
core.model.superclass.NormalModel(train, test, thread_num=4)[source]¶ Bases:
objectUse all normal supervised learning model to train and test the given Datasets
- Parameters
train (core.data.dataset.Dataset) – the labelled ground truth Dataset for training the model
test (core.data.dataset.Dataset) – the Dataset for testing by using sensor data only
thread_num (int) – the maximum number of threads can use to speed up
- Return type
core.model.support_vector_machine module¶
-
class
core.model.support_vector_machine.SVM(train, test)[source]¶ Bases:
core.model.superclass.NormalModelUsing Support Vector Machine model to predict the occupancy level
This is a normal supervised learning model.
- Parameters
train (core.data.dataset.Dataset) – the labelled ground truth Dataset for training the model
test (core.data.dataset.Dataset) – the Dataset for testing by using sensor data only
gamma (float or
'auto') – kernel coefficient for'rbf','poly', or'sigmoid'kernel (str) – specifies the kernel type to be used in the algorithm. It must be one of
'linear','poly','rbf','sigmoid','precomputed'penalty_error (float) – penalty parameter C of the error term.
n_estimators (int) – estimators used for predictions.
- Return type
- Returns
Predicted occupancy level corresponding to the test Dataset
-
class
core.model.support_vector_machine.SVR(train, test)[source]¶ Bases:
core.model.superclass.NormalModelUsing Support Vector Regression model to predict the occupancy level
This is a normal supervised learning model.
- Parameters
train (core.data.dataset.Dataset) – the labelled ground truth Dataset for training the model
test (core.data.dataset.Dataset) – the Dataset for testing by using sensor data only
gamma (float or
'auto') – kernel coefficient for'rbf','poly', or'sigmoid'kernel (str) – specifies the kernel type to be used in the algorithm. It must be one of
'linear','poly','rbf','sigmoid','precomputed'penalty_error (float) – penalty parameter C of the error term.
n_estimators (int) – estimators used for predictions.
- Return type
- Returns
Predicted occupancy level corresponding to the test Dataset