computationalprivacy / bandicoot

an open-source python toolbox to analyze mobile phone metadata
MIT License
237 stars 61 forks source link

Issue- Call records ignored by bandicoot #19

Closed Quamber closed 6 years ago

Quamber commented 6 years ago

Hi, I am using FnF data to generate user's features. However, for all the features (bc.utils.all(user)) i observed that the has_calls is always falseand all features related to calls were null. While debugging i found that there are 33 out of 53 FnF users (with personality results) had calls with call duration not null.

e.g. for user "sp10-01-19" out of 275 results there are many calls with duration not null but still the bandicoot imports it this way and the reporting-has_C is always false

`sp10-01-19

[x] 52 records from 2010-07-24 09:42:35 to 2011-05-09 10:01:22

[x] 11 contacts

[ ] No attribute stored

[ ] No antenna stored

[ ] No recharges

[x] Has home

[x] Has texts

[ ] No calls

[ ] No network`

What should i do?

cynddl commented 6 years ago

Hi @Quamber, you're not using the right format to import data with bc.io.read_csv.

For instance, on line 144: 111281,,0.0,call,2011-03-04 11:05:33,1531c09623d312a15cd6115343fc804d97cc5a09,in should be replaced with 111281,0,call,2011-03-04 11:05:33,1531c09623d312a15cd6115343fc804d97cc5a09,in (no double comma, no .0, only seconds)

The leading comma in the first line should also be removed.


After fixing the input file, I obtained:

>>> u = bc.io.read_csv("sp10-01-19", records_path=".")
Warning: 144 record(s) were removed due to missing or incomplete fields.
         call_duration: 144 record(s) with incomplete values
Warning: 100.00% of the records are missing a location.
         No antennas file was given and records are using antennas for position.
Warning: 131 antenna(s) are missing a location.
[x] 131 records from 2010-07-24 09:42:35 to 2011-05-24 10:36:35
[x] 32 contacts
[ ] No attribute stored
[ ] No antenna stored
[ ] No recharges
[x] Has home
[x] Has texts
[x] Has calls
[ ] No network
Quamber commented 6 years ago

Thank You.. Issue resolved