Examples¶
Subpackages¶
core.easy_experiment module¶
-
core.easy_experiment.
easy_experiment
(source, target_test, target_retrain=None, domain_adaptive=False, models='all', binary_evaluation=True, evaluation_metrics='all', thread_num=4, remove_time=True, plot=False) easy_experiment()
function allows the user to quickly estimate the occupancy state of a room leveraging the specified models and evaluation metrics. Refer to the sample code foreasy_set_experiment()
for more details.
-
core.easy_experiment.
easy_set_experiment
(source_set, target_test_set=None, split_percentage=0.8, target_retrain=None, domain_adaptive=False, models='all', binary_evaluation=True, evaluation_metrics='all', thread_num=4, remove_time=True, plot=False) easy_set_experiment()
function allows the user to quickly perform occupancy estimation on multiple data sets using the specified models and evaluation metrics. We recommend the use ofeasy_set_experiment()
instead ofeasy_experiment()
to get the formatted return value forResult
, which is essential for plotting.Note
Always pass a
list
as the argument ofload_sample()
function when usingeasy_set_experiment()
to obtain a dictionary that maps data set names toDataset
objects.1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
import core import pprint # Load and separate the train and test data set data = core.data.load_sample(["umons-all", "aifb-all"]) # Perform occupancy estimation score, predict_result = core.easy_set_experiment(data, models=["RandomForest"]) pprint(score) pprint(predict_result) # Make the scores ready to plot result = core.evaluation.Result() result.set_result(score) # If you somehow want to use "easy_experiment", here is the code train, test = data["umons-all"].split(0.8) # Perform occupancy estimation score, predict_result = core.easy_experiment(train, test, models=["RandomForest"]) pprint(score) pprint(predict_result)