Woodwork contains global configuration options that can be set by users to control the behavior of certain aspects of Woodwork. This guide will provide an overview of working with these options, including viewing the current settings and updating the config values.
First, we will demonstrate how to display the current configuration options. Once you have imported Woodwork, you can view the options with ww.config as shown below.
ww.config
[1]:
import woodwork as ww ww.config
Woodwork Global Config Settings ------------------------------- natural_language_threshold: 10
The output of ww.config lists each of the available config variables followed by it’s current setting. In the output above, the natural_language_threshold config variable has been set to 10.
natural_language_threshold
10
The process of updating a config variable is done simply with a call to the ww.config.set_option function. This function requires two arguments: the name of the config variable to update, and the new value to set.
ww.config.set_option
To illustrate this, we will update the natural_language_threshold config variable to have a value of 25 instead of the default value of 10:
25
[2]:
ww.config.set_option('natural_language_threshold', 25) ww.config
Woodwork Global Config Settings ------------------------------- natural_language_threshold: 25
As you can see from the output above, the value for the natural_language_threshold config variable has now been updated to 25.
If you need access to the value that is set for a specific config variable you can access it with the ww.config.get_option function, passing in the name of the config variable for which you want the value:
ww.config.get_option
[3]:
ww.config.get_option('natural_language_threshold')
Finally, config variables can be reset to their default values using the ww.config.reset_option function, passing in the name of the variable to reset. To demonstrate this, we will reset the natural_language_threshold config variable to its default value:
ww.config.reset_option
[4]:
ww.config.reset_option('natural_language_threshold') ww.config
This section provides an overview of the current config options that can be set within Woodwork.
The natural_language_threshold config variable helps control the distinction between Categorical and NaturalLanguage logical types during type inference. More specifically, this threshold represents the average string length that is used to distinguish between these two types. If the average string length in a column is greater than this threshold, the column will be inferred as a NaturalLanguage column, otherwise it will be inferred as a Categorical column. The natural_language_threshold config variable defaults to 10.
Categorical
NaturalLanguage