core.model package

This package contains classes that pertain to the occupancy estimation models. All user-defined models should be put here.

core.model.superclass module

class core.model.superclass.NormalModel(train, test, thread_num=4)
class core.model.superclass.DomainAdaptiveModel(source, target_retrain, target_test, thread_num=4)

NormalModel and DomainAdaptiveModel are the superclasses for all occupancy estimation models. NormalModel is the superclass for models that are designed for estimating binary occupancy states. In contrast, DomainAdaptiveModel is the superclass for models that are designed for estimating occupancy counts. They both have four methods:

get_all_model()
add_model(list_of_model)
remove_model(list_of_model)
run_all_model()

These methods can be used to return estimations and allow the user to modify settings for a specific model at any time.

import core

# Load a sample data set from the package
dataset = core.data.load_sample("umons-all")
# Create train / test sets
train, test = dataset.split(0.8)

# ===== Sample Start Here =====
# Select models you want to use
model_set = core.model.NormalModel(train, test, thread_num=1)
model_set.add_model(["YourModelName"])

# Edit the settings of your model
your_model = model_set.models["YourModelName"]
your_model.alpha = 0.5
# Run model to predict occupancy level
model_set_results = model_set.run_all_model()

print(model_set_results)