HQS API that grasps the user's foreground app usage time event in real time, classifies what category each app is in, calculates the total amount of usage time for each category, and compares it with the reference value of 80 users
- A function to classify categories by package name
- Excluding duplicate elements in the list
- Entering the number of timestamp returns a datetime object with year, month, day, hour, and minute information.
- If you enter the year, month, day, hour, and minute, it will be converted to a number in a timestamp format.
- Entering an 8-digit string as a string returns the day of the week
- Putting in a list returns the sum, average, maximum, minimum, and median values based on the elements of the list. Total is used when calculating percentage option
- It is used to make a group from the standard HQS value data and calculate the weighted average for each group.
- Used to create 's_week0' ~ 's_week6' variables from standard data for each day of the week
It is a function that informs the time zone and date in which the input data was recorded, and is necessary to facilitate the user's parameter setting.
paramters:
- inputdata: list-like of shape [n_samples, 4]
Examples
>>> inputdata = [[1557275299.311, 'Samsung Experience 홈', 'com.sec.android.app.launcher', 'ACTIVITY_RESUMED'], [1557275313.169, 'Samsung Experience 홈', 'com.sec.android.app.launcher', 'ACTIVITY_PAUSED'],...]
>>> HQS.finding(inputdata)
return:
>>> [['DATE', '0시', '1시', '2시', '3시', '4시', '5시', '6시', '7시', '8시', '9시', '10시', '11시', '12시', '13시', '14시', '15시', '16시', '17시', '18시', '19시', '20시', '21시', '22시', '23시'], [20190516, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32.0843499938647, 49.57675000031788, 10.33324999809265, 37.07876663605373, 13.894100010395045, 3.6712499936421708, 33.336099986235304, 11.578566666444141, 16.713666713237767, 17.198833362261457, 15.619833342234296, 10.405233319600425, 13.398050010204319, 3.4780499935150146, 6.409583334128062],,,]
If the package name of inputdata does not include the package name of the category list, it is classified as unclassified.
paramters:
- inputdata: list-like of shape [n_samples, 4]
Examples
>>> inputdata = [[1557275299.311, 'Samsung Experience 홈', 'com.sec.android.app.launcher', 'ACTIVITY_RESUMED'], [1557275313.169, 'Samsung Experience 홈', 'com.sec.android.app.launcher', 'ACTIVITY_PAUSED'],...]
>>> HQS.miscategory(inputdata)
return:
>>> [['missing', '날씨', 'com.sec.android.daemonapp'],
['missing', '날씨', 'com.lge.sizechangable.weather'],
.....
['missing', '동영상', 'com.lge.videoplayer'],
['missing', '동영상 다운로더', 'video.downloader.videodownloader'],,,]
When input data comes in, a function that compares each app name and package name with the existing app category list of 80 users, gives statistics of usage time by category according to the set time and number of days after matching, and compares it with the standard value of 80 app categories
digital(inputlist, timeunit ='h', timeunit_n=1, divisionmethod ='section', comparisonvaluetype='timeofday', statics = 'mean')
paramters:
-
inputdata: list-like of shape [n_samples, 4]
- receive timestamp, name, packagename and type
-
timeunit: {‘h’, ‘am’, ‘pm’, ‘d’, ‘all’}, default = ‘h’
-
timeunit_n: int n, default = 1
-
divisionmethod: {‘section’, ‘nonsection’}, default = ‘section’
-
comparisonvaluetype: {‘timeofday’, ‘dayofweek’}, default = ‘timeofday’
-
comparisionstatistics: {‘mean’, ‘max’, ‘min’, ‘median’, ‘percentage’}, default = ‘mean
Examples
>>> inputdata = [[1557275299.311, 'Samsung Experience 홈', 'com.sec.android.app.launcher', 'ACTIVITY_RESUMED'], [1557275313.169, 'Samsung Experience 홈', 'com.sec.android.app.launcher', 'ACTIVITY_PAUSED'],...]
>>> HQS.digital(inputdata, ‘h’, ‘3’, ‘section’, ‘typeofday’, 'mean’)
return:
{'Art & Design': {'compare': 0.71, 'input': 0.05, 'standard': 0.07},
'Beauty': {'compare': 1.0, 'input': 0.1, 'standard': 0.1},
'Books & Reference': {'compare': 1.76, 'input': 5.34, 'standard': 3.04},
'Communication': {'compare': 1.33, 'input': 1436.64, 'standard': 1079.06},
'Education': {'compare': 0.86, 'input': 19.89, 'standard': 23.16},
'Entertainment': {'compare': 0.07, 'input': 4.21, 'standard': 63.61},
'Finance': {'compare': 0.3, 'input': 10.67, 'standard': 35.39},
'Food & Drink': {'compare': 0.41, 'input': 2.93, 'standard': 7.1},
'Game': {'compare': 0.0, 'input': 0.04, 'standard': 19.46},
'Health & Fitness': {'compare': 0.16, 'input': 0.26, 'standard': 1.62},
'Libraries & Demo': {'compare': 1.38, 'input': 19.05, 'standard': 13.81},
'Lifestyle': {'compare': 0.09, 'input': 10.19, 'standard': 110.02},
'Maps & Navigation': {'compare': 0.34, 'input': 27.41, 'standard': 80.88},
'Social': {'compare': 0.39, 'input': 260.99, 'standard': 662.43},
'Tools': {'compare': 0.25, 'input': 40.66, 'standard': 159.51},
'Total': {'compare': 0.74, 'input': 2255.15, 'standard': 3064.17}}
social(inputlist, timeunit ='h', timeunit_n=1, divisionmethod ='section', comparisonvaluetype='timeofday', statics = 'mean')
paramters:
-
inputdata: list-like of shape [n_samples, 4]
- receive timestamp, name, packagename and type
-
timeunit: {‘h’, ‘am’, ‘pm’, ‘d’, ‘all’}, default = ‘h’
-
timeunit_n: int n, default = 1
-
divisionmethod: {‘section’, ‘nonsection’}, default = ‘section’
-
comparisonvaluetype: {‘timeofday’, ‘dayofweek’}, default = ‘timeofday’
-
comparisionstatistics: {‘mean’, ‘max’, ‘min’, ‘median’, ‘percentage’}, default = ‘mean
Examples
>>> inputdata = [[1557275299.311, 'Samsung Experience 홈', 'com.sec.android.app.launcher', 'ACTIVITY_RESUMED'], [1557275313.169, 'Samsung Experience 홈', 'com.sec.android.app.launcher', 'ACTIVITY_PAUSED'],...]
>>> HQS.digital(inputdata, ‘h’, ‘1’, ‘section’, ‘timeofday’, 'mean’)
return:
{'Communication': {'compare': 1.33, 'input': 1436.64, 'standard': 1079.06},
'Social': {'compare': 0.39, 'input': 260.99, 'standard': 662.43},
'Total': {'compare': 0.74, 'input': 2255.15, 'standard': 3064.17}}
Output variables
dic02: {date: [['category, 'appname', time of day, usage time, packagename, foreground, background],,,],,}
- Hansoo Lee