senadj
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # App Find – Machine Learning ## Find Android application alternatives that require fewer permissions. This recommendation engine was developed to help privacy-concerned users to find alternatives for their Android applications. ## How does it work? Topic modeling was applied to the application descriptions of about 571k Android applications to create a model that we used to assign topic IDs to applications. These topic IDs group similar applications together. A single page application (SPA) was developed based on React and Redux, which consumes the metadata and recommendations from the backend. The backend itself is developed in Python and fetches data from a PostgreSQL database that contains all the data needed. ## Functions - [x] Search and filter functions to browse for Google Play Store applications - [x] Find alternatives on the application detail page that require fewer permissions - [x] Compare our recommendation with Google's filtered application recommendations ## Repository Description This repository contains the machine learning part of the application. The other parts of the application can be found in other repos: App Find Frontend: https://github.zhaw.ch/neut/appfind-frontend App Find Backend: https://github.zhaw.ch/neut/appfind-backend App Find Deployment: https://github.zhaw.ch/neut/appfind-deployment ## Machine Learning Setup Our implementation works with Python v3.7. Please make sure to use the same Python version. Python needs an environment to run the Python scripts with its dependencies. To keep dependencies of different projects separate, we recommend using a Python virtual environment. There are many tools like venv, conda, or pipenv to create virtual environments. In our example, we will use pipenv. Pipenv has to be installed first, as described in the documentation: https://github.com/pypa/pipenv Then, open a shell in the root folder. The folder contains a file called "Pipfile" in the root location. All the dependencies should be installed into the virtual environment by running the following command: `pipenv install` ## Data The machine learning process requires data from the Google Play Store. Unfortunately, we cannot provide the metadata for download due to legal reasons. However, the access key with limited access can be obtained from the data provider called "AppMonsta". They provide the data free of charge until larger datasets are required. The plan can be updated anytime, to have a subscription for larger datasets. A free API key can be obtained here: https://appmonsta.com/dashboard/get_api_key More information about the datasets and the API can be found here: https://appmonsta.com/dashboard/api-documentation To download the data and save it to a file, execute this command in the command line: ``` curl --compressed -u "{API_KEY}:X" \ "https://api.appmonsta.com/v1/stores/android/details.json?date=2020-05-30&country=US" ``` ## Scripts For the machine learning part of the application, many scripts were created to automate topic modeling, topic inference, cross-validation, scoring, etc. In the table below there is an overview of the scripts with a brief description of what they do. | Script | Description | |---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 1_clean_descriptions.py | This script is used to preprocess and clean the raw data in the data preparation process. It removes, for example, emails, links, and phone numbers from the application description texts used to create the topic models. | | 2_hdp_tomotopy_topic_modelling.py | This script applies topic modeling with Hierarchical Dirichlet Process (HDP) implemented in the Tomotopy library over the application descriptions. | | 2_lda_gensim_topic_modelling.py | This script applies topic modeling with Latent Dirichlet Allocation (LDA) implemented in the Gensim library over the application descriptions. | | 2_lda_tomotopy_topic_modelling.py | This script applies topic modeling with Latent Dirichlet Allocation (LDA) implemented in the Tomotopy library over the application descriptions. | | 2_minibatchkmeans_sklearn_topic_modelling.py | This script applies topic modeling with Minibatch-K-Means implemented in the Scikit-learn library over the application descriptions. | | 2_nmf_gensim_topic_modelling.py | This script applies topic modeling with Non-Negative Matrix Factorization (NMF) implemented in the Gensim library over the application descriptions. | | 2_nmf_sklearn_topic_modelling.py | This script applies topic modeling with Non-Negative Matrix Factorization (NMF) implemented in the Scikit-learn library over the application descriptions. | | 3_hdp_tomotopy_topic_mapping.py | This script annotates a topic id to each application description. The used topic model is generated with Hierarchical Dirichlet Process (HDP) implemented in the Tomotopy library. | | 3_lda_gensim_topic_mapping.py | This script annotates a topic id to each application description. The used topic model is generated with Latent Dirichlet Allocation (LDA) implemented in the Gensim library. | | 3_lda_tomotopy_topic_mapping.py | This script annotates a topic id to each application description. The used topic model is generated with Latent Dirichlet Allocation (LDA) implemented in the Tomotopy library. | | 3_minibatchkmeans_sklearn_topic_mapping.py | This script annotates a topic id to each application description. The used topic model is generated with Minibatch-K-Means implemented in the Scikit-learn library. | | 3_nmf_gensim_topic_mapping.py | This script annotates a topic id to each application description. The used topic model is generated with Non-Negative Matrix Factorization (NMF) implemented in the Gensim library. | | 3_nmf_sklearn_topic_mapping.py | This script annotates a topic id to each application description. The used topic model is generated with Non-Negative Matrix Factorization (NMF) implemented in the Scikit-learn library. | | 4_hdp_tomotopy_topic_mapping_loop.py | This script is automatically executing the script "3_hdp_tomotopy_topic_mapping.py" with multiple numbers of topics. | | 4_lda_gensim_topic_mapping_loop.py | This script is automatically executing the script "3_hdp_gensim_topic_mapping.py" with multiple numbers of topics. | | 4_lda_gensim_topic_modelling_loop.py | This script is automatically executing the script "2_lda_gensim_topic_modelling.py" with multiple numbers of topics. | | 4_lda_tomotopy_topic_mapping_loop.py | This script is automatically executing the script "2_lda_tomotopy_topic_modelling.py" with multiple numbers of topics. | | 4_minibatchkmeans_sklearn_topic_mapping_loop.py | This script is automatically executing the script "3_minibatchkmeans_sklearn_topic_mapping.py" with multiple numbers of topics. | | 4_minibatchkmeans_sklearn_topic_modelling_loop.py | This script is automatically executing the script "2_minibatch_sklearn_topic_modelling.py" with multiple numbers of topics. | | 4_nmf_gensim_topic_mapping_loop.py | This script is automatically executing the script "2_hdp_tomotopy_topic_modelling.py" with multiple numbers of topics. | | 4_nmf_gensim_topic_modelling_loop.py | This script is automatically executing the script "2_nmf_gensim_topic_modelling.py" with multiple numbers of topics. | | 4_nmf_sklearn_topic_mapping_loop.py | This script is automatically executing the script "3_nmf_sklearn_topic_mapping.py" with multiple numbers of topics. | | 4_nmf_sklearn_topic_modelling_loop.py | This script is automatically executing the script "2_nmf_sklearn_topic_modelling.py" with multiple numbers of topics. | | 5_analayze_coherence.py | This script selects the generated topic models, calculates the coherence values, and plots the results. | | 5_create_cross_validation_sets.py | This script creates sub-datasets required for cross-validation. It is used to create K-folds for Stratisfied Cross-Validation and a train-test set for Hold-Out Cross-Validation. | | 5_execute_all.py | This script executes all topic modeling, mapping, coherence calculation processes with all the algorithms and libraries. | | 5_run_cross_validation.py | This script runs cross validation with datasets created with "5_create_cross_validation_sets.py" automatically. | | 5_run_cross_validation_coherence.py | This script calculates the coherence values of the models created with "5_run_cross_validation.py" automatically. | | 6_distribution_analysis.py | This script analyzes distributions following distributions: genre, word count, topic, permissions, free paid, price, downloads, ads, rating, release year. | | 6_scoring_manual_groups.py | This script ranks the models after manually defined applications sets, which we believe should share the same topic id. | | 6_scoring_related_apps.py | This script ranks the models after comparing the topic ids generated by the models against Google's recommendations. | | 7_infer_final_model.py | This script executes the script "3_hdp_tomotopy_topic_mapping" with the data of the final model. | | 7_label_final.model.py | This script labels the topics of the final model. | | 7_train_final_model.py | The models can be trained further, even if the training was stopped. This script trains the final model further with more iterations. | | 8_benchmark_hdp.py | This script extracts information from a Tomotopy HDP model, such as: topic training time, inference time, model size. | | 8_benchmark_hdp_analyze.py | This script analyzes the data generated with the script "8_benchmark_hdp.py" and plots them. | | 9_download_app_images.py | This script downloads images of all applications from Google Play Store. It is used to save the file locally, in order not to hit Google's servers each time the recommendation engine is used. |

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully