dataprp库本地参数

To help users quickly manage the parameters, currently, we defined four global parameters. Global parameter applies to all the plots which has that parameter.

Global Parameter Description
width Change the plots’ width in plot(df, col1), plot(df, col1, col2), plot(df, col1, col2, col3), plot_correlation() and plot_missing().
height Change the plots’ height in plot(df, col1), plot(df, col1, col2) and plot(df, col1, col2, col3), plot_correlation() and plot_missing().
bins Apply to bins for Histogram, KDE Plot, Box Plot, Word Length, Line Chart, Spectrum.
ngroups Apply to bars and slices for the Bar Chart and Pie Chart.

Local parameters are plot-specified and the names are separated by … The portion before the first . is plot name and the portion after the first . is parameter name. The . is also used when the parameter name contains more than one word. When global parameter and local parameter are both entered by a user in config, the global parameter will be overwrote by local parameters for specific plots

In the following tables we summarize the parameters for each API. You can also find the parameters for each plot in the Config API reference.

plot()

Local Parameter Type Default Description
hist.bins int 50 Maximum number of bins to display in the Histogram
hist.yscale` str “linear” Y-axis scale (“linear” or “log”) for the `Histogram
bar.bars int 10 Maximum number of bars to display in the Bar Chart
bar.sort_descending bool True Whether to sort the bars in descending order in the Bar Chart`
bar.color str “#1f77b4” Color of the bars in the Bar Chart
insight.duplicates.threshold int 1 Warn if the percent of duplicated values is above this threshold in the Insights`
insight.uniform.threshold float 0.999 The p-value threshold for chi-square test in the Insights
insight.missing.threshold int 1 Warn if the percent of missing values is above this threshold in the Insights
insight.skewed.threshold float 1e-5 The p-value for the scipy.skewtest which test whether the skew is different from the normal distributionin in the Insights
insight.infinity.threshold int 1 Warn if the percent of infinites is above this threshold in the Insights
insight.zeros.threshold int 5 Warn if the percent of zeros is above this threshold in the Insights
insight.negatives.threshold int 1 Warn if the percent of megatives is above this threshold in the Insights
insight.normal.threshold float 0.99 The p-value threshold for normal test, it is based on D’Agostino and Pearson’s test that combines skew and kurtosis to produce an omnibus test of normality in the Insights
insight.high_cardinality.threshold int 50 The threshold for unique values count, count larger than threshold yields high cardinality in the Insights
insight.constant.threshold int 1 The threshold for unique values count, count equals to threshold yields constant value in the Insights
insight.outstanding_no1.threshold float 1.5 The threshold for outstanding no1 insight, measures the ratio of the largest category count to the second-largest category count in the Insights
insight.attribution.threshold float 0.5 The threshold for the attribution insight, measures the percentage of the top 2 categories in the Insights
insight.high_word_cardinality.threshold int 1000 The threshold for the high word cardinality insight, which measures the number of words of that cateogory in the Insights
insight.outstanding_no1_word.threshold int 0 The threshold for the outstanding no1 word threshold, which measures the ratio of the most frequent word count to the second most frequent word count in the Insights
insight.outlier.threshold int 0 The threshold for the outlier count for the Insights in the Box Plot`
kde.yscale` str “linear” Y-axis scale (“linear” or “log”) for the `KDE Plot
kde.hist_color str “#aec7e8” Color of the histogram in the KDE Plot
kde.line_color str “#d62728” Color of the line in the KDE Plot
box.ngroups` int 15 Maximum number of groups for categorical column to display in the `Box Plot
box.bins` int 50 Maximum number of bins for numerical column to display in the `Box Plot
box.unit` str “auto” Defines the time unit to group values over for a datetime column. It can be “year”, “quarter”, “month”, “week”, “day”, “hour”,“minute”, “second”. With default value “auto”, it will use the time unit such that the resulting number of groups is closest to 15 in the `Box Plot
box.sort_descending` bool True Whether to sort the boxes in descending order of frequency in the `Box Plot
box.color str “#d62728” Color of the Box Plot
value_table.ngroups int 10
pie.slices` int 10 Maximum number of pie slices to display in the Pie Chart
wordcloud.top_words` int 30 Maximum number of most frequent words to display in the Word Cloud
wordlen.bins` int 50 Maximum number of bins in the Word Length
line.bins` int 50 Maximum number of bins to display in the Line Chart
line.sort_descending` bool True Whether to sort the groups in descending order of frequency in the `Line Chart
line.yscale` str “linear” Y-axis scale (“linear” or “log”) for the `Line Chart
line.unit` str “auto” Defines the time unit to group values over for a datetime column. It can be “year”, “quarter”, “month”, “week”, “day”, “hour”, “minute”, “second”. With default value “auto”, it will use the time unit such that the resulting number of groups is closest to 15 in the `Line Chart
line.agg` str “mean” Specify the aggregate to use when aggregating over a numeric column in the `Line Chart
scatter.sample_size` int 1000 Number of points to randomly sample per partition in the `Scatter Plot
scatter.sample_rate` float “None” Defines the sample rate per partition in the `Scatter Plot. Cannot be used with sample_size. Set it to 1.0 for no sampling
hexbin.tile_size float “auto” The size of the tile in the hexbin plot. Measured from the middle of a hexagon to its left or right corner in the Hexbin Plot.
nested.nsubgroups` int 5 Maximum number of most frequent values from the second column to display (computed on the filtered data consisting of the most frequent values from the first column) in the `Nested Bar Chart
stacked.ngroups` int 10 Maximum number of most frequent values from the first column to display in the `Stacked Bar Chart
stacked.nsubgroups` int 5 Maximum number of most frequent values from the second column to display (computed on the filtered data consisting of the most frequent values from the first column) in the `Stacked Bar Chart
stacked.unit` str “auto” Defines the time unit to group values over for a datetime column. It can be “year”, “quarter”, “month”, “week”, “day”, “hour”, “minute”, “second”. With default value “auto”, it will use the time unit such that the resulting number of groups is closest to 15 in the `Stacked Bar Chart
stacked.sort_descending` bool True Whether to sort the groups in descending order of frequency in the `Stacked Bar Chart
heatmap.ngroups` int 10 Maximum number of most frequent values from the first column to display in the `Heat Map
heatmap.nsubgroups` int 5 Maximum number of most frequent values from the second column to display (computed on the filtered data consisting of the most frequent values from the first column)in the `Heat Map

plot_missing()

Local Parameter Type Default Description
spectrum.bins int 20 Maximum number of bins to display in the Spectrum
PDF.sample_size int 100 Number of evenly spaced samples between the minimum and maximum values to compute the PDF at
CDF.sample_size int 100 Number of evenly spaced samples between the minimum and maximum values to compute the CDF at

plot_correlation()

Local Parameter Type Default Description
scatter.sample_size` int 1000 Number of points to randomly sample per partition in the Scatter Plot in plot_correlation(df, x, y)
scatter.sample_rate float “None” Defines the sample rate per partition in the `Scatter Plot. Cannot be used with sample_size. Set it to 1.0 for no sampling

create_report()

Local Parameter Type Default Description
bar.bars int 10 Maximum number of bars to display in the Bar Chart
bar.sort_descending bool True Whether to sort the bars in descending order in the Bar Chart`
`bar.yscale str “linear” Y-axis scale (“linear” or “log”) for the Bar Chart
pie.slices` int 10 Maximum number of pie slices to display in the Pie Chart
pie.sort_descending bool True Whether to sort the slices in descending order of frequency in the Pie Chart
wordcloud.top_words int 30 Maximum number of most frequent words to display in the Word Cloud
wordcloud.stopword bool True Whether to remove stopwords in the Word Cloud
wordcloud.lemmatize bool False Whether to lemmatize the words in the Word Cloud
wordcloud.stem bool False Whether to apply Potter Stem on the words in the Word Cloud
wordfreq.top_words int 30 Maximum number of most frequent words to display in the Word Frequency
wordcloud.stopword bool True Whether to remove stopwords in the Word Frequency
wordcloud.lemmatize bool False Whether to lemmatize the words in the Word Frequency
wordcloud.stem bool False Whether to apply Potter Stem on the words in the Word Frequency
wordlen.bins int 50 Maximum number of bins in the Word Length
wordlen.yscale str “linear” Y-axis scale (“linear” or “log”) for the Word Length
line.unit str “auto” Defines the time unit to group values over for a datetime column. It can be “year”, “quarter”, “month”, “week”, “day”, “hour”, “minute”, “second”. With default value “auto”, it will use the time unit such that the resulting number of groups is closest to 15 in the `Line Chart
kde.bins int 50 Maximum number of bins in the KDE Plot
kde.yscale` str “linear” Y-axis scale (“linear” or “log”) for the `KDE Plot
box.sort_descending` bool True Whether to sort the boxes in descending order of frequency in the `Box Plot
spectrum.bins int 20 Maximum number of bins to display in the Spectrum

你可能感兴趣的:(python)