def dataframes(days):
    """ Invoke script responsible for pre-processing data.
    """
    from listenbrainz_spark.recommendations import create_dataframes
    with app.app_context():
        _ = create_dataframes.main(train_model_window=days)
Пример #2
0
import sys
import logging

from listenbrainz_spark.stats import user
from listenbrainz_spark.recommendations import create_dataframes
from listenbrainz_spark.recommendations import train_models
from listenbrainz_spark.recommendations import recommend

if __name__ == '__main__':
    if len(sys.argv) != 2:
        print("Usage: manage.py <module_name>")
        sys.exit(-1)

    # The root logger always defaults to WARNING level
    # The level is changed from WARNING to INFO
    logging.getLogger().setLevel(logging.INFO)

    module_name = sys.argv[1]
    if module_name == 'create_dataframes':
        create_dataframes.main()
    elif module_name == 'train_models':
        train_models.main()
    elif module_name == 'recommend':
        recommend.main()
    elif module_name == 'user':
        user.main()