Commit c912f48f authored by Roberto Martinez-Maldonado's avatar Roberto Martinez-Maldonado
Browse files

Update 17/08/2020

parent 099b3bbc
### Moodoo library: Indoor Positioning Analytics for Characterising Classroom Teaching.
For more information about this library refer to the following paper:
http://martinezmaldonado.net/files/AIED20-MoodooLocalisationLibrary.pdf
# How to install # How to install
### Project dependencies ### Project dependencies
...@@ -16,6 +11,7 @@ How to install python3.8 ...@@ -16,6 +11,7 @@ How to install python3.8
Create virtual environment Create virtual environment
- Using pycharm to create virtual environment - Using pycharm to create virtual environment
Install pip Install pip
`curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py` `curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py`
`python get-pip.py` `python get-pip.py`
...@@ -36,27 +32,21 @@ Install pip requirements ...@@ -36,27 +32,21 @@ Install pip requirements
- `pip3 install -r requirements.txt` - `pip3 install -r requirements.txt`
# How to run the scripts ### How to run script
To run all the files using the test dataset run the script test\demoMAIN.py: To run all the files using the test dataset run the script test\demoMAIN.py:
`python demoMAIN.py` `python demoMAIN.py --all`
(NOTE: It can take some time to complete the analysis) (NOTE: It can take some time to complete the analysis)
To test the functions in each script and generate intermediate output files, To test the functions in each script and generate intermediate output files,
Run the files demo1-5 in the following order: run the files l demo1-5 in the following order:
test\demo1_preprocessing.py test\demo1_preprocessing.py
test\demo2_stopsAndTransitions.py test\demo2_stopsAndTransitions.py
test\demo3_fixedPoints.py test\demo3_fixedPoints.py
test\demo4_entropy.py test\demo4_entropy.py
test\demo5_generateMetrics.py test\demo5_generateMetrics.py
The file info.ini contains important parameters that are used by the scripts.
The file info.ini contains important initialisation parameters that are used by the scripts.
To analyse your own data, example files are in the folder test\Merged dataset 2018-2019\. To analyse your own data, example files are in the folder test\Merged dataset 2018-2019\.
Please, format your data using these samples as a reference. Please, format your data using these samples as a reference.
...@@ -77,7 +67,3 @@ This folder contains the following csv files: ...@@ -77,7 +67,3 @@ This folder contains the following csv files:
beginning and the end of such session (e.g. the first and last datapoint of each session). beginning and the end of such session (e.g. the first and last datapoint of each session).
# Please, cite as:
Martinez-Maldonado, R., Echeverria, V., Schulte, J., Shibani, A., Mangaroska, K. and Buckingham Shum, S. (2020).
Moodoo: Indoor Positioning Analytics for Characterising Classroom Teaching.
International Conference on Artificial Intelligence in Education, AIED 2020, 360-373.
\ No newline at end of file
...@@ -61,33 +61,10 @@ def get_metrics(df_fs,df_points,df_entropy,df_giniT,df_giniSession,df_phases,sel ...@@ -61,33 +61,10 @@ def get_metrics(df_fs,df_points,df_entropy,df_giniT,df_giniSession,df_phases,sel
------- -------
Output Output
returns a data frame with the following metrics columns (TBC): returns a data frame with the following metrics columns (TBC):
session : identifier of the session group - the cluster id (a self incremental intiger that starts from 1)
tracker : identifier of the tracker base_dist - distance from a datapoint to the first datapoint in the cluster
phase : the phase for which the metrics are calculated intra_dist - distance to the previous data point
Number_of_stops : total number of stops of the tracker during the session/phase time_diff - time difference from the previous data point
Stopping_time_mins : total stopping time of the tracker during the session/phase
Max_stop_mins : longest stop of the tracker during the session/phase
Avg_stopping_time : average duration of a stop
Median_stopping_time : median duration of a stop
Std_stopping_time : standard deviation for the previous average
Number_of_transitions : total number of transitions of the tracker during the session/phase
Distance_walked : total distance walked
Speed_meter_per_sec : walking speed
Total_attention_time_min : total time dedicated to be in close proximity to fixed points of the obj_type 'student'
Total_number_visits : total number of stops in close proximity to fixed points of the obj_type 'student'
Average_attention_time_per_visit : average attention time per fixed point of the obj_type 'student'
STD_attention_time_per_visit : standard deviation for the previous average
Average_visits_per_student : average number of stops per fixed point of the obj_type 'student'
STD_visits_per_student : standard deviation for the previous average
('Total_attention_time_min', 'IDObjet') : total total time dedicated to be in close proximity to fixed points tagged as 'IdObject' of obj_type 'zone'
one per fixed point of the obj_type 'zone'
('Total_number_visits', 'IDObjet') : total number of stops in close proximity to fixed points tagged as 'IdObject' of obj_type 'zone'
one per fixed point of the obj_type 'zone'
Entropy : entropy of the datapoints for the tracker during the session/phase
gini_per_tracker : index of dispertion of the tracker with reference to fixed points of obj_type 'student' during the session/phase
gini_per_session : index of dispertion of ALL trackers with reference to fixed points of obj_type 'student' during the session/phase
(the same value is repeated for each tracker/row)
""" """
print ("Calculating metrics.") print ("Calculating metrics.")
......
...@@ -366,7 +366,7 @@ def tag_clusters(df_dist): ...@@ -366,7 +366,7 @@ def tag_clusters(df_dist):
block_df = session_df[session_df['block'] == block] block_df = session_df[session_df['block'] == block]
block_df['delta'] = (block_df['timestamp'] - block_df['timestamp'].shift()).fillna(0) block_df['delta'] = (block_df['timestamp'] - block_df['timestamp'].shift()).fillna(pd.Timedelta('0 days'))
# SAVE # SAVE
df_new = df_new.append(block_df) df_new = df_new.append(block_df)
......
...@@ -44,7 +44,7 @@ weighted=1 #if weighted is set to 1, all the metrics are normalised with referen ...@@ -44,7 +44,7 @@ weighted=1 #if weighted is set to 1, all the metrics are normalised with referen
###GENERATE THE METRICS ###GENERATE THE METRICS
Output=main.get_metrics(df_fs,df_points,df_entropy,df_giniT,df_giniSession,df_phases,selectedPhase,weighted) Output=main.get_metrics(df_fs,df_points,df_entropy,df_giniT,df_giniSession,df_phases,selectedPhase)
if(weighted==1): if(weighted==1):
file = time.strftime('Output_NOTEBOOK10_metrics_per_tracker_WEIGHTED_%Y-%m-%d-%H-%M.csv') file = time.strftime('Output_NOTEBOOK10_metrics_per_tracker_WEIGHTED_%Y-%m-%d-%H-%M.csv')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment