A verbose = False kind of option with python read_resource function.

hbajpai
hbajpai New Altair Community Member
edited November 2024 in Community Q&A
This is more of an aesthetics question rather than a functionality one. Is there a way that we can set verbose as False in the read resource function in python.

The function that helps us to connect with Rapidminer Studio data is as follows:
df_raw, df_edited = connector.read_resource(['//filename1', 
                                             '//filename2'])
However, we have huge overburden information on the connection between python and rapidminer.
2020-03-31 11:11:45,408 [INFO -- studio]: Java Version: 1.8.0_232
2020-03-31 11:11:45,411 [INFO -- studio]: Gathering launch settings...
2020-03-31 11:11:46,280 [INFO -- studio]: Done.
2020-03-31 11:11:46,282 [INFO -- studio]: Launching RapidMiner Studio BATCH now...
2020-03-31 11:11:47,253 [INFO -- studio]: RapidMiner Studio version 9.6.000, Copyright (C) 2001-2020 RapidMiner GmbH
2020-03-31 11:11:47,254 [INFO -- studio]: See End User License Agreement information in the file named EULA.
2020-03-31 11:11:47,537 [INFO -- studio]: Mar 31, 2020 11:11:47 AM com.rapidminer.tools.I18N <clinit>
2020-03-31 11:11:47,538 [INFO -- studio]: Set locale to en.
2020-03-31 11:11:47,581 [INFO -- studio]: Mar 31, 2020 11:11:47 AM com.rapidminer.tools.PlatformUtilities logInfo
2020-03-31 11:11:47,584 [INFO -- studio]: rapidminer.home is 'C:\Program Files\RapidMiner\RapidMiner Studio'.
2020-03-31 11:11:47,654 [INFO -- studio]: Mar 31, 2020 11:11:47 AM com.rapidminer.core.license.ProductConstraintManager initialize
2020-03-31 11:11:47,655 [INFO -- studio]: Initializing license manager.
2020-03-31 11:11:47,655 [INFO -- studio]: Mar 31, 2020 11:11:47 AM com.rapidminer.core.license.ProductConstraintManager initialize
2020-03-31 11:11:47,656 [INFO -- studio]: Using default license location.
2020-03-31 11:11:47,657 [INFO -- studio]: Mar 31, 2020 11:11:47 AM com.rapidminer.core.license.ProductConstraintManager initialize
2020-03-31 11:11:47,658 [INFO -- studio]: Registering default product.
2020-03-31 11:11:47,839 [INFO -- studio]: Mar 31, 2020 11:11:47 AM com.rapidminer.repository.FileRepositoryProvider load
2020-03-31 11:11:47,841 [WARNING -- studio]: Unknown tag: remoteRepository
2020-03-31 11:11:47,841 [INFO -- studio]: Mar 31, 2020 11:11:47 AM com.rapidminer.repository.FileRepositoryProvider load
2020-03-31 11:11:47,842 [WARNING -- studio]: Unknown tag: remoteRepository
2020-03-31 11:11:48,449 [INFO -- studio]: Mar 31, 2020 11:11:48 AM com.rapidminer.tools.plugin.Plugin registerPlugins
2020-03-31 11:11:48,451 [INFO -- studio]: Register plugin: Anomaly Detection
2020-03-31 11:11:48,452 [INFO -- studio]: Mar 31, 2020 11:11:48 AM com.rapidminer.tools.plugin.Plugin registerPlugins
2020-03-31 11:11:48,452 [INFO -- studio]: Register plugin: Converters
2020-03-31 11:11:48,453 [INFO -- studio]: Mar 31, 2020 11:11:48 AM com.rapidminer.tools.plugin.Plugin registerPlugins
2020-03-31 11:11:48,454 [INFO -- studio]: Register plugin: Database Envy
2020-03-31 11:11:48,455 [INFO -- studio]: Mar 31, 2020 11:11:48 AM com.rapidminer.tools.plugin.Plugin registerPlugins


Tagged:

Best Answers

  • tkenez
    tkenez New Altair Community Member
    Answer ✓
    Hey there!

    Good news: there is such an option!

    Basically, we use the Python logging package by default to print logs to the standard output. The standard loglevel is INFO, you can change this by specifying the loglevel parameter when instantiating the Studio connector object.

    Here are the possible loglevel values listed that you can use: https://docs.python.org/2/library/logging.html#levels

    Hope this helps,
    Tamas


  • hbajpai
    hbajpai New Altair Community Member
    edited April 2020 Answer ✓
    tkenez,

    Thanks for the reply, I was able to set the log to critical and avoid all other information. I was searching for the arguments in the read_resource function, it did not occur to me to check the Studio initialization. The final initialization looked liked below for me.
    connector = rapidminer.Studio(studio_home= "C:/Program Files/RapidMiner/RapidMiner Studio",
                                  logger=None, 
                                  loglevel=50, rm_stdout=None,
                                  override_python_binary=False)

Answers

  • tkenez
    tkenez New Altair Community Member
    Answer ✓
    Hey there!

    Good news: there is such an option!

    Basically, we use the Python logging package by default to print logs to the standard output. The standard loglevel is INFO, you can change this by specifying the loglevel parameter when instantiating the Studio connector object.

    Here are the possible loglevel values listed that you can use: https://docs.python.org/2/library/logging.html#levels

    Hope this helps,
    Tamas


  • hbajpai
    hbajpai New Altair Community Member
    edited April 2020 Answer ✓
    tkenez,

    Thanks for the reply, I was able to set the log to critical and avoid all other information. I was searching for the arguments in the read_resource function, it did not occur to me to check the Studio initialization. The final initialization looked liked below for me.
    connector = rapidminer.Studio(studio_home= "C:/Program Files/RapidMiner/RapidMiner Studio",
                                  logger=None, 
                                  loglevel=50, rm_stdout=None,
                                  override_python_binary=False)