niimpy.preprocessing.application module
- niimpy.preprocessing.application.app_count(df, bat=None, screen=None, group_map={'1010!': 'games', '7 MINUTE WORKOUT': 'sports', '9GAG': 'leisure', 'AirConsole': 'games', 'Airbnb': 'travel', 'Aktia Wallet': 'shop', 'AliExpress': 'shop', 'Amino': 'comm', 'Android System': 'system', 'Android system': 'system', 'Android-järjestelmä': 'system', 'Android-süsteem': 'system', 'Audiobooks': 'leisure', 'Avast Mobile Security': 'security', 'Bodyweight': 'sports', 'Bonusway': 'travel', 'BookBeat': 'leisure', 'Booking.com': 'travel', 'Booking.com Hotellit': 'travel', 'Calcy IV': 'games', 'Camera': 'utility', 'Candy Crush Saga': 'games', 'Castle Cats': 'games', 'Chrome': 'leisure', 'CityTrack': 'transport', 'Clash Royale': 'games', 'Cleopatra Jewels': 'games', 'Clock': 'utility', 'Couchsurfing': 'travel', 'CrossCycle': 'sports', 'Crowst': 'leisure', 'Crunchyroll': 'leisure', 'Daylio': 'wellbeing', 'Destiny': 'games', 'Dialer': 'comm', 'Discord': 'comm', 'Docs': 'work', 'Dokkan Battle': 'games', 'Download Manager': 'system', 'DraStic': 'games', 'Dropbox': 'work', 'Dual Messenger': 'comm', 'Duolingo': 'leisure', 'Edge': 'leisure', 'Elisa Turvapaketti': 'security', 'Email': 'comm', 'Endomondo': 'sports', 'Enkeli-tarot': 'leisure', 'EspressoHouse': 'shop', 'F-Secure SAFE': 'security', 'FaceApp': 'leisure', 'Facebook': 'socialmedia', 'Fit': 'sports', 'Flipboard': 'news', 'Fonecta Caller': 'comm', 'Frank App': 'shop', 'Freedome': 'security', 'Galaxy Store': 'utility', 'Galleria': 'utility', 'Game Launcher': 'games', 'Geo News': 'news', 'Gmail': 'comm', 'Google': 'leisure', 'Google Play Kauppa': 'utility', 'Google Play Music': 'leisure', 'Google Play Musiikki': 'leisure', 'Google Play Palvelut': 'utility', 'Google Play Store': 'utility', 'Google-sovellus': 'leisure', 'Googlen tekstistä puheeksi -moottori': 'comm', 'Grindr': 'socialmedia', 'H&M': 'shop', 'HAVEN KBH': 'leisure', 'HSL': 'transport', 'HSL Mobiililippu': 'transport', 'Hatch': 'games', 'Hay Day': 'games', 'Head Ball 2': 'games', 'Headspace': 'leisure', 'Health Mate': 'sports', 'Hearthstone': 'games', 'Helsingin Sanomat': 'news', 'Hesburger': 'shop', 'Hidden City': 'games', 'Hootsuite': 'socialmedia', 'I Love Hue': 'games', 'ICE - In Case of Emergency': 'comm', 'Ilta-Sanomat': 'news', 'Iltalehti': 'news', 'Imgur': 'leisure', 'Instagram': 'socialmedia', 'Internet': 'leisure', 'Iso Omena': 'shop', 'Jeopardy!': 'games', 'Jodel': 'socialmedia', 'Järj. UI': 'system', 'K-Ruoka': 'shop', 'KDE Connect': 'work', 'Kalenteri': 'utility', 'Kamera': 'utility', 'Kauppalehti': 'news', 'Kello': 'utility', 'Klarna': 'shop', 'Knudge.me': 'work', 'Kuvakaappaus': 'leisure', 'Kuvat': 'utility', 'Käyttöliitt.': 'system', 'LINE': 'comm', 'LINE Camera': 'comm', 'Latauksen hallinta': 'system', 'Lataustenhallinta': 'system', 'Leffapeli': 'leisure', 'Libby': 'leisure', 'LinkedIn': 'socialmedia', 'Linkity Pro': 'work', 'LiveTulokset': 'leisure', 'Lunchie Market': 'shop', 'MTV Uutiset': 'news', 'MadLipz': 'leisure', 'Mahjong': 'games', 'Maps': 'utility', 'Match and Explore': 'games', 'McAfee Security': 'security', 'McDonalds': 'shop', 'MensajerÃ\xada': 'comm', 'Mensajería': 'comm', 'Messages': 'comm', 'Messenger': 'comm', 'Messenger Lite': 'comm', 'MoMoMood': 'wellbeing', 'MobilePay': 'shop', 'Modo STAMINA': 'sports', 'Momotoko': 'shop', 'Moodle': 'work', 'Moves': 'sports', 'Music Center': 'leisure', 'Musiikki': 'leisure', 'My Files': 'work', 'MyFitnessPal': 'sports', 'MysticMessenger': 'comm', 'Netflix': 'leisure', 'Nextory': 'leisure', 'Norstat': 'leisure', 'Norwegian': 'travel', 'Numerovalitsin': 'comm', 'OPSkin': 'shop', 'Ohjelmistopäivitys': 'system', 'OneDrive': 'work', 'Optimoija': 'system', 'Orbot': 'comm', 'Outlook': 'comm', 'PINS': 'shop', 'Paradise Island 2': 'games', 'Pedometer - Step Counter': 'sports', 'Pedometer Step Counter': 'sports', 'Peel Remote': 'leisure', 'Phone': 'comm', 'Photos': 'leisure', 'Pic Collage': 'leisure', 'Pinterest': 'socialmedia', 'Pivo': 'shop', 'PlayStation': 'games', 'Player FM': 'leisure', 'Pocket Camp': 'games', 'Podcast Go': 'leisure', 'Podcast Player': 'leisure', 'Podcast Republic': 'leisure', 'Pokémon GO': 'games', 'Pokémon GO': 'games', 'Polar Flow': 'sports', 'Pornhub': 'leisure', 'Puhelin': 'comm', 'Puhelin – puheluiden hallinta': 'comm', 'Puhelu': 'comm', 'Puhelutallennin': 'comm', 'Pyramid Solitaire Saga': 'games', 'QuizTaisto PREMIUM': 'games', 'ROMEO UNCUT': 'socialmedia', 'Radio': 'leisure', 'ResQ Club': 'shop', 'Romantic love messages': 'comm', 'Runtastic': 'sports', 'S-mobiili': 'shop', 'SDP Kansalaispaneeli': 'socialmedia', 'STAMINA-tila': 'sports', 'Samsung Music': 'leisure', 'Samsung capture': 'utility', 'Sanapala': 'games', 'Shazam': 'leisure', 'Sheets': 'work', 'Signal': 'comm', 'Six Pack in 30 Days': 'sports', 'Skype': 'comm', 'Slack': 'work', 'Smartâ\\x80\\x8bThings': 'utility', 'Snapchat': 'socialmedia', 'Solitaire': 'games', 'Solitaire Collection': 'games', 'SoundCloud': 'leisure', 'SoundHound': 'leisure', 'Sports Tracker': 'sports', 'Spotify': 'leisure', 'State of Survival': 'games', 'Steam': 'games', 'Super Mario Run': 'games', 'System UI': 'system', 'Sähköposti': 'comm', 'Sää': 'news', 'Sähköposti': 'comm', 'TUI Suomi': 'travel', 'Tarot Reading': 'leisure', 'Tarot Universe': 'leisure', 'Teams': 'work', 'Telegeram': 'comm', 'Telegram': 'comm', 'Telia Turvapaketti': 'security', 'Teléfono': 'comm', 'Teléfono': 'comm', 'The Secret Society': 'games', 'Ticketmaster': 'shop', 'TikTok': 'comm', 'Timely': 'work', 'Tinder': 'socialmedia', 'TripAdvisor': 'travel', 'Tumblr': 'socialmedia', 'TuneIn Radio': 'leisure', 'Twitch': 'games', 'Twitter': 'socialmedia', 'Uber': 'transport', 'Upsi': 'sports', 'Uutisvahti': 'news', 'VR Lähijunat': 'transport', 'Viber': 'comm', 'Viestit': 'comm', 'WEBTOON': 'leisure', 'We Heart It': 'socialmedia', 'WeShare': 'shop', 'Weather': 'news', 'WhatsApp': 'comm', 'Wilma': 'work', 'Wish': 'shop', 'Wolt': 'shop', 'Wordfeud FREE': 'games', 'Wordfeud Free': 'games', 'Wrapp': 'shop', 'XCOM': 'games', 'Yle Areena': 'news', 'YouTube': 'leisure', 'YouTube Music': 'leisure', 'Youtify': 'leisure', 'Zalando': 'shop', 'Zoom': 'work', 'eBay': 'shop', 'happn': 'socialmedia', 'mtv': 'news', 'myTuner Free': 'leisure', 'pixiv': 'leisure', 'upday': 'news'}, resample_args={'rule': '30min'}, **kwargs)[source]
This function returns the number of times each app group has been used, within the specified timeframe. The app groups are defined as a dictionary within the config variable. Examples of app groups are social media, sports, games, etc. If no mapping is given, a default one will be used. If no resampling window is given, the function sets a 30 min default time window. The function aggregates the duration by user, by app group, by timewindow.
- Parameters:
- df: pandas.DataFrame
Input data frame
- bat: pandas.DataFrame, optional
Dataframe with the battery information. If no data is available, an empty dataframe should be passed.
- screen: pandas.DataFrame, optional
Dataframe with the screen information. If no data is available, an empty dataframe should be passed.
- config: dict, optional
Dictionary keys containing optional arguments for the computation of screen information. The following arguments are used:
app_column_name: Column containing the app name. Defaults to ‘application_name’. group_map: A dictionary mapping the app names to app groups.
Defaults to niimpy.preprocesing.application.MAP_APP, which maps several common apps.
screen_column_name: Column containing the screen status. Defaults to ‘screen_status’. resample_args: parameteres passed to pandas.DataFrame.resample. Defaults to {‘rule’:’30min’}.
- Returns:
- result: dataframe
Resulting dataframe
- niimpy.preprocessing.application.app_duration(df, bat=None, screen=None, group_map={'1010!': 'games', '7 MINUTE WORKOUT': 'sports', '9GAG': 'leisure', 'AirConsole': 'games', 'Airbnb': 'travel', 'Aktia Wallet': 'shop', 'AliExpress': 'shop', 'Amino': 'comm', 'Android System': 'system', 'Android system': 'system', 'Android-järjestelmä': 'system', 'Android-süsteem': 'system', 'Audiobooks': 'leisure', 'Avast Mobile Security': 'security', 'Bodyweight': 'sports', 'Bonusway': 'travel', 'BookBeat': 'leisure', 'Booking.com': 'travel', 'Booking.com Hotellit': 'travel', 'Calcy IV': 'games', 'Camera': 'utility', 'Candy Crush Saga': 'games', 'Castle Cats': 'games', 'Chrome': 'leisure', 'CityTrack': 'transport', 'Clash Royale': 'games', 'Cleopatra Jewels': 'games', 'Clock': 'utility', 'Couchsurfing': 'travel', 'CrossCycle': 'sports', 'Crowst': 'leisure', 'Crunchyroll': 'leisure', 'Daylio': 'wellbeing', 'Destiny': 'games', 'Dialer': 'comm', 'Discord': 'comm', 'Docs': 'work', 'Dokkan Battle': 'games', 'Download Manager': 'system', 'DraStic': 'games', 'Dropbox': 'work', 'Dual Messenger': 'comm', 'Duolingo': 'leisure', 'Edge': 'leisure', 'Elisa Turvapaketti': 'security', 'Email': 'comm', 'Endomondo': 'sports', 'Enkeli-tarot': 'leisure', 'EspressoHouse': 'shop', 'F-Secure SAFE': 'security', 'FaceApp': 'leisure', 'Facebook': 'socialmedia', 'Fit': 'sports', 'Flipboard': 'news', 'Fonecta Caller': 'comm', 'Frank App': 'shop', 'Freedome': 'security', 'Galaxy Store': 'utility', 'Galleria': 'utility', 'Game Launcher': 'games', 'Geo News': 'news', 'Gmail': 'comm', 'Google': 'leisure', 'Google Play Kauppa': 'utility', 'Google Play Music': 'leisure', 'Google Play Musiikki': 'leisure', 'Google Play Palvelut': 'utility', 'Google Play Store': 'utility', 'Google-sovellus': 'leisure', 'Googlen tekstistä puheeksi -moottori': 'comm', 'Grindr': 'socialmedia', 'H&M': 'shop', 'HAVEN KBH': 'leisure', 'HSL': 'transport', 'HSL Mobiililippu': 'transport', 'Hatch': 'games', 'Hay Day': 'games', 'Head Ball 2': 'games', 'Headspace': 'leisure', 'Health Mate': 'sports', 'Hearthstone': 'games', 'Helsingin Sanomat': 'news', 'Hesburger': 'shop', 'Hidden City': 'games', 'Hootsuite': 'socialmedia', 'I Love Hue': 'games', 'ICE - In Case of Emergency': 'comm', 'Ilta-Sanomat': 'news', 'Iltalehti': 'news', 'Imgur': 'leisure', 'Instagram': 'socialmedia', 'Internet': 'leisure', 'Iso Omena': 'shop', 'Jeopardy!': 'games', 'Jodel': 'socialmedia', 'Järj. UI': 'system', 'K-Ruoka': 'shop', 'KDE Connect': 'work', 'Kalenteri': 'utility', 'Kamera': 'utility', 'Kauppalehti': 'news', 'Kello': 'utility', 'Klarna': 'shop', 'Knudge.me': 'work', 'Kuvakaappaus': 'leisure', 'Kuvat': 'utility', 'Käyttöliitt.': 'system', 'LINE': 'comm', 'LINE Camera': 'comm', 'Latauksen hallinta': 'system', 'Lataustenhallinta': 'system', 'Leffapeli': 'leisure', 'Libby': 'leisure', 'LinkedIn': 'socialmedia', 'Linkity Pro': 'work', 'LiveTulokset': 'leisure', 'Lunchie Market': 'shop', 'MTV Uutiset': 'news', 'MadLipz': 'leisure', 'Mahjong': 'games', 'Maps': 'utility', 'Match and Explore': 'games', 'McAfee Security': 'security', 'McDonalds': 'shop', 'MensajerÃ\xada': 'comm', 'Mensajería': 'comm', 'Messages': 'comm', 'Messenger': 'comm', 'Messenger Lite': 'comm', 'MoMoMood': 'wellbeing', 'MobilePay': 'shop', 'Modo STAMINA': 'sports', 'Momotoko': 'shop', 'Moodle': 'work', 'Moves': 'sports', 'Music Center': 'leisure', 'Musiikki': 'leisure', 'My Files': 'work', 'MyFitnessPal': 'sports', 'MysticMessenger': 'comm', 'Netflix': 'leisure', 'Nextory': 'leisure', 'Norstat': 'leisure', 'Norwegian': 'travel', 'Numerovalitsin': 'comm', 'OPSkin': 'shop', 'Ohjelmistopäivitys': 'system', 'OneDrive': 'work', 'Optimoija': 'system', 'Orbot': 'comm', 'Outlook': 'comm', 'PINS': 'shop', 'Paradise Island 2': 'games', 'Pedometer - Step Counter': 'sports', 'Pedometer Step Counter': 'sports', 'Peel Remote': 'leisure', 'Phone': 'comm', 'Photos': 'leisure', 'Pic Collage': 'leisure', 'Pinterest': 'socialmedia', 'Pivo': 'shop', 'PlayStation': 'games', 'Player FM': 'leisure', 'Pocket Camp': 'games', 'Podcast Go': 'leisure', 'Podcast Player': 'leisure', 'Podcast Republic': 'leisure', 'Pokémon GO': 'games', 'Pokémon GO': 'games', 'Polar Flow': 'sports', 'Pornhub': 'leisure', 'Puhelin': 'comm', 'Puhelin – puheluiden hallinta': 'comm', 'Puhelu': 'comm', 'Puhelutallennin': 'comm', 'Pyramid Solitaire Saga': 'games', 'QuizTaisto PREMIUM': 'games', 'ROMEO UNCUT': 'socialmedia', 'Radio': 'leisure', 'ResQ Club': 'shop', 'Romantic love messages': 'comm', 'Runtastic': 'sports', 'S-mobiili': 'shop', 'SDP Kansalaispaneeli': 'socialmedia', 'STAMINA-tila': 'sports', 'Samsung Music': 'leisure', 'Samsung capture': 'utility', 'Sanapala': 'games', 'Shazam': 'leisure', 'Sheets': 'work', 'Signal': 'comm', 'Six Pack in 30 Days': 'sports', 'Skype': 'comm', 'Slack': 'work', 'Smartâ\\x80\\x8bThings': 'utility', 'Snapchat': 'socialmedia', 'Solitaire': 'games', 'Solitaire Collection': 'games', 'SoundCloud': 'leisure', 'SoundHound': 'leisure', 'Sports Tracker': 'sports', 'Spotify': 'leisure', 'State of Survival': 'games', 'Steam': 'games', 'Super Mario Run': 'games', 'System UI': 'system', 'Sähköposti': 'comm', 'Sää': 'news', 'Sähköposti': 'comm', 'TUI Suomi': 'travel', 'Tarot Reading': 'leisure', 'Tarot Universe': 'leisure', 'Teams': 'work', 'Telegeram': 'comm', 'Telegram': 'comm', 'Telia Turvapaketti': 'security', 'Teléfono': 'comm', 'Teléfono': 'comm', 'The Secret Society': 'games', 'Ticketmaster': 'shop', 'TikTok': 'comm', 'Timely': 'work', 'Tinder': 'socialmedia', 'TripAdvisor': 'travel', 'Tumblr': 'socialmedia', 'TuneIn Radio': 'leisure', 'Twitch': 'games', 'Twitter': 'socialmedia', 'Uber': 'transport', 'Upsi': 'sports', 'Uutisvahti': 'news', 'VR Lähijunat': 'transport', 'Viber': 'comm', 'Viestit': 'comm', 'WEBTOON': 'leisure', 'We Heart It': 'socialmedia', 'WeShare': 'shop', 'Weather': 'news', 'WhatsApp': 'comm', 'Wilma': 'work', 'Wish': 'shop', 'Wolt': 'shop', 'Wordfeud FREE': 'games', 'Wordfeud Free': 'games', 'Wrapp': 'shop', 'XCOM': 'games', 'Yle Areena': 'news', 'YouTube': 'leisure', 'YouTube Music': 'leisure', 'Youtify': 'leisure', 'Zalando': 'shop', 'Zoom': 'work', 'eBay': 'shop', 'happn': 'socialmedia', 'mtv': 'news', 'myTuner Free': 'leisure', 'pixiv': 'leisure', 'upday': 'news'}, resample_args={'rule': '30min'}, outlier_threshold='10h', **kwargs)[source]
This function returns the duration of use of different app groups, within the specified timeframe. The app groups are defined as a dictionary within the config variable. Examples of app groups are social media, sports, games, etc. If no mapping is given, a default one will be used. If no resampling window is given, the function sets a 30 min default time window. The function aggregates the duration by user, by app group, by timewindow.
- Parameters:
- df: pandas.DataFrame
Input data frame
- bat: pandas.DataFrame, optional
Dataframe with the battery information. If no data is available, an empty dataframe should be passed.
- screen: pandas.DataFrame, optional
Dataframe with the screen information. If no data is available, an empty dataframe should be passed.
- config: dict, optional
Dictionary keys containing optional arguments for the computation of scrren information. The following arguments are used:
app_column_name: Column containing the app name. Defaults to ‘application_name’. group_map: A dictionary mapping the app names to app groups.
Defaults to niimpy.preprocesing.application.MAP_APP, which maps several common apps.
outlier_threshold: Threshold for filtering out outliers. Defaults to ‘10h’.
- Returns:
- result: dataframe
Resulting dataframe
- niimpy.preprocessing.application.classify_app(df, app_column_name='application_name', group_map={'1010!': 'games', '7 MINUTE WORKOUT': 'sports', '9GAG': 'leisure', 'AirConsole': 'games', 'Airbnb': 'travel', 'Aktia Wallet': 'shop', 'AliExpress': 'shop', 'Amino': 'comm', 'Android System': 'system', 'Android system': 'system', 'Android-järjestelmä': 'system', 'Android-süsteem': 'system', 'Audiobooks': 'leisure', 'Avast Mobile Security': 'security', 'Bodyweight': 'sports', 'Bonusway': 'travel', 'BookBeat': 'leisure', 'Booking.com': 'travel', 'Booking.com Hotellit': 'travel', 'Calcy IV': 'games', 'Camera': 'utility', 'Candy Crush Saga': 'games', 'Castle Cats': 'games', 'Chrome': 'leisure', 'CityTrack': 'transport', 'Clash Royale': 'games', 'Cleopatra Jewels': 'games', 'Clock': 'utility', 'Couchsurfing': 'travel', 'CrossCycle': 'sports', 'Crowst': 'leisure', 'Crunchyroll': 'leisure', 'Daylio': 'wellbeing', 'Destiny': 'games', 'Dialer': 'comm', 'Discord': 'comm', 'Docs': 'work', 'Dokkan Battle': 'games', 'Download Manager': 'system', 'DraStic': 'games', 'Dropbox': 'work', 'Dual Messenger': 'comm', 'Duolingo': 'leisure', 'Edge': 'leisure', 'Elisa Turvapaketti': 'security', 'Email': 'comm', 'Endomondo': 'sports', 'Enkeli-tarot': 'leisure', 'EspressoHouse': 'shop', 'F-Secure SAFE': 'security', 'FaceApp': 'leisure', 'Facebook': 'socialmedia', 'Fit': 'sports', 'Flipboard': 'news', 'Fonecta Caller': 'comm', 'Frank App': 'shop', 'Freedome': 'security', 'Galaxy Store': 'utility', 'Galleria': 'utility', 'Game Launcher': 'games', 'Geo News': 'news', 'Gmail': 'comm', 'Google': 'leisure', 'Google Play Kauppa': 'utility', 'Google Play Music': 'leisure', 'Google Play Musiikki': 'leisure', 'Google Play Palvelut': 'utility', 'Google Play Store': 'utility', 'Google-sovellus': 'leisure', 'Googlen tekstistä puheeksi -moottori': 'comm', 'Grindr': 'socialmedia', 'H&M': 'shop', 'HAVEN KBH': 'leisure', 'HSL': 'transport', 'HSL Mobiililippu': 'transport', 'Hatch': 'games', 'Hay Day': 'games', 'Head Ball 2': 'games', 'Headspace': 'leisure', 'Health Mate': 'sports', 'Hearthstone': 'games', 'Helsingin Sanomat': 'news', 'Hesburger': 'shop', 'Hidden City': 'games', 'Hootsuite': 'socialmedia', 'I Love Hue': 'games', 'ICE - In Case of Emergency': 'comm', 'Ilta-Sanomat': 'news', 'Iltalehti': 'news', 'Imgur': 'leisure', 'Instagram': 'socialmedia', 'Internet': 'leisure', 'Iso Omena': 'shop', 'Jeopardy!': 'games', 'Jodel': 'socialmedia', 'Järj. UI': 'system', 'K-Ruoka': 'shop', 'KDE Connect': 'work', 'Kalenteri': 'utility', 'Kamera': 'utility', 'Kauppalehti': 'news', 'Kello': 'utility', 'Klarna': 'shop', 'Knudge.me': 'work', 'Kuvakaappaus': 'leisure', 'Kuvat': 'utility', 'Käyttöliitt.': 'system', 'LINE': 'comm', 'LINE Camera': 'comm', 'Latauksen hallinta': 'system', 'Lataustenhallinta': 'system', 'Leffapeli': 'leisure', 'Libby': 'leisure', 'LinkedIn': 'socialmedia', 'Linkity Pro': 'work', 'LiveTulokset': 'leisure', 'Lunchie Market': 'shop', 'MTV Uutiset': 'news', 'MadLipz': 'leisure', 'Mahjong': 'games', 'Maps': 'utility', 'Match and Explore': 'games', 'McAfee Security': 'security', 'McDonalds': 'shop', 'MensajerÃ\xada': 'comm', 'Mensajería': 'comm', 'Messages': 'comm', 'Messenger': 'comm', 'Messenger Lite': 'comm', 'MoMoMood': 'wellbeing', 'MobilePay': 'shop', 'Modo STAMINA': 'sports', 'Momotoko': 'shop', 'Moodle': 'work', 'Moves': 'sports', 'Music Center': 'leisure', 'Musiikki': 'leisure', 'My Files': 'work', 'MyFitnessPal': 'sports', 'MysticMessenger': 'comm', 'Netflix': 'leisure', 'Nextory': 'leisure', 'Norstat': 'leisure', 'Norwegian': 'travel', 'Numerovalitsin': 'comm', 'OPSkin': 'shop', 'Ohjelmistopäivitys': 'system', 'OneDrive': 'work', 'Optimoija': 'system', 'Orbot': 'comm', 'Outlook': 'comm', 'PINS': 'shop', 'Paradise Island 2': 'games', 'Pedometer - Step Counter': 'sports', 'Pedometer Step Counter': 'sports', 'Peel Remote': 'leisure', 'Phone': 'comm', 'Photos': 'leisure', 'Pic Collage': 'leisure', 'Pinterest': 'socialmedia', 'Pivo': 'shop', 'PlayStation': 'games', 'Player FM': 'leisure', 'Pocket Camp': 'games', 'Podcast Go': 'leisure', 'Podcast Player': 'leisure', 'Podcast Republic': 'leisure', 'Pokémon GO': 'games', 'Pokémon GO': 'games', 'Polar Flow': 'sports', 'Pornhub': 'leisure', 'Puhelin': 'comm', 'Puhelin – puheluiden hallinta': 'comm', 'Puhelu': 'comm', 'Puhelutallennin': 'comm', 'Pyramid Solitaire Saga': 'games', 'QuizTaisto PREMIUM': 'games', 'ROMEO UNCUT': 'socialmedia', 'Radio': 'leisure', 'ResQ Club': 'shop', 'Romantic love messages': 'comm', 'Runtastic': 'sports', 'S-mobiili': 'shop', 'SDP Kansalaispaneeli': 'socialmedia', 'STAMINA-tila': 'sports', 'Samsung Music': 'leisure', 'Samsung capture': 'utility', 'Sanapala': 'games', 'Shazam': 'leisure', 'Sheets': 'work', 'Signal': 'comm', 'Six Pack in 30 Days': 'sports', 'Skype': 'comm', 'Slack': 'work', 'Smartâ\\x80\\x8bThings': 'utility', 'Snapchat': 'socialmedia', 'Solitaire': 'games', 'Solitaire Collection': 'games', 'SoundCloud': 'leisure', 'SoundHound': 'leisure', 'Sports Tracker': 'sports', 'Spotify': 'leisure', 'State of Survival': 'games', 'Steam': 'games', 'Super Mario Run': 'games', 'System UI': 'system', 'Sähköposti': 'comm', 'Sää': 'news', 'Sähköposti': 'comm', 'TUI Suomi': 'travel', 'Tarot Reading': 'leisure', 'Tarot Universe': 'leisure', 'Teams': 'work', 'Telegeram': 'comm', 'Telegram': 'comm', 'Telia Turvapaketti': 'security', 'Teléfono': 'comm', 'Teléfono': 'comm', 'The Secret Society': 'games', 'Ticketmaster': 'shop', 'TikTok': 'comm', 'Timely': 'work', 'Tinder': 'socialmedia', 'TripAdvisor': 'travel', 'Tumblr': 'socialmedia', 'TuneIn Radio': 'leisure', 'Twitch': 'games', 'Twitter': 'socialmedia', 'Uber': 'transport', 'Upsi': 'sports', 'Uutisvahti': 'news', 'VR Lähijunat': 'transport', 'Viber': 'comm', 'Viestit': 'comm', 'WEBTOON': 'leisure', 'We Heart It': 'socialmedia', 'WeShare': 'shop', 'Weather': 'news', 'WhatsApp': 'comm', 'Wilma': 'work', 'Wish': 'shop', 'Wolt': 'shop', 'Wordfeud FREE': 'games', 'Wordfeud Free': 'games', 'Wrapp': 'shop', 'XCOM': 'games', 'Yle Areena': 'news', 'YouTube': 'leisure', 'YouTube Music': 'leisure', 'Youtify': 'leisure', 'Zalando': 'shop', 'Zoom': 'work', 'eBay': 'shop', 'happn': 'socialmedia', 'mtv': 'news', 'myTuner Free': 'leisure', 'pixiv': 'leisure', 'upday': 'news'}, **kwargs)[source]
This function is a helper function for other screen preprocessing. The function classifies the screen events into the groups specified by group_map.
- Parameters:
- df: pandas.DataFrame
Input data frame
- config: dict, optional
Dictionary keys containing optional arguments for the computation of screen information. The following arguments are used:
app_column_name: Column containing the app name. Defaults to ‘application_name’. group_map: A dictionary mapping the app names to app groups. (required)
(e.g. ‘my_app’:’my_app_group’)
- Returns:
- df: dataframe
Resulting dataframe
- niimpy.preprocessing.application.extract_features_app(df, bat=None, screen=None, features=None)[source]
This function computes and organizes the selected features for application events. The function aggregates the features by user, by app group, by time window. If no time window is specified, it will automatically aggregate the features in 30 mins non-overlapping windows. If no group_map is provided, a default one will be used.
The complete list of features that can be calculated are: app_count, and app_duration.
- Parameters:
- df: pandas.DataFrame
Input data frame
- features: dict, optional
Dictionary keys contain the names of the features to compute. If none is given, all features will be computed.
- Returns:
- result: dataframe
Resulting dataframe