phitter package

Subpackages

Submodules

phitter.main module

class phitter.main.Phitter(data, fit_type='continuous', num_bins=None, confidence_level=0.95, minimum_sse=inf, subsample_size=None, subsample_estimation_size=None, distributions_to_fit='all', exclude_distributions='any')

Bases: object

Fit continuous or discrete distributions to a given dataset.

property best_distribution
property df_not_rejected_distributions: DataFrame | None
property df_sorted_distributions_sse: DataFrame | None
dict_to_dataframe(data)
Return type:

DataFrame

fit(n_workers=1)

Fits the appropriate distributions to the data using the specified number of workers.

Parameters:

n_workers (int, optional) – The number of workers to use for fitting the distributions (default is 1).

get_n_test_null(id_distribution)
Return type:

int

get_n_test_passed(id_distribution)
Return type:

int

get_parameters(id_distribution)
Return type:

dict

get_sse(id_distribution)
Return type:

float

get_test_anderson_darling(id_distribution)
Return type:

dict

get_test_chi_square(id_distribution)
Return type:

dict

get_test_kolmogorov_smirnov(id_distribution)
Return type:

dict

property not_rejected_distributions
plot_distribution(id_distribution, plot_title='HISTOGRAM', plot_xaxis_title='Domain', plot_yaxis_title='Probability Density/Mass Function', plot_legend_title=None, plot_height=400, plot_width=600, plot_bar_color='rgba(128,128,128,1)', plot_bargap=0.15, plot_line_color='rgba(255,0,0,1)', plot_line_width=3, plotly_plot_renderer=None, plot_engine='plotly')
plot_ecdf(plot_title='EMPIRICAL CUMULATIVE DISTRIBUTION FUNCTION', plot_xaxis_title='Domain', plot_yaxis_title='Cumulative Distribution Function', plot_xaxis_min_offset=0.3, plot_xaxis_max_offset=0.3, plot_legend_title=None, plot_height=400, plot_width=600, plot_line_color='rgba(255,0,0,1)', plot_line_width=2, plot_line_name='Empirical Distribution', plot_bar_color='rgba(128,128,128,1)', plotly_plot_renderer=None, plot_engine='plotly')
plot_ecdf_distribution(id_distribution, plot_title='ECDF', plot_xaxis_title='Domain', plot_yaxis_title='Cumulative Distribution Function', plot_xaxis_min_offset=0.3, plot_xaxis_max_offset=0.3, plot_legend_title=None, plot_height=400, plot_width=600, plot_empirical_line_color='rgba(128,128,128,1)', plot_empirical_line_width=4, plot_empirical_line_name='Empirical Distribution', plot_empirical_bar_color='rgba(128,128,128,1)', plot_empirical_bargap=0.15, plot_distribution_line_color='rgba(255,0,0,1)', plot_distribution_line_width=2, plotly_plot_renderer=None, plot_engine='plotly')
plot_histogram(plot_title='HISTOGRAM', plot_xaxis_title=None, plot_yaxis_title=None, plot_legend_title=None, plot_height=400, plot_width=600, plot_bar_color='rgba(128,128,128,1)', plot_bargap=0.15, plotly_plot_renderer=None, plot_engine='plotly')
plot_histogram_distributions(n_distributions=10, n_distributions_visible=1, plot_title='HISTOGRAM', plot_xaxis_title='Domain', plot_yaxis_title='Probability Density/Mass Function', plot_legend_title='DISTRIBUTIONS', plot_height=400, plot_width=600, plot_bar_color='rgba(128,128,128,1)', plot_bargap=0.15, plotly_plot_renderer=None, plot_engine='plotly')
qq_plot(id_distribution, plot_title='QQ PLOT', plot_xaxis_title='Theoretical Quantiles', plot_yaxis_title='Sample Quantiles', plot_legend_title=None, plot_height=400, plot_width=600, qq_marker_name='Markers QQ', qq_marker_color='rgba(128,128,128,1)', qq_marker_size=6, plotly_plot_renderer=None, plot_engine='plotly')
qq_plot_regression(id_distribution, plot_title='QQ PLOT', plot_xaxis_title='Theoretical Quantiles', plot_yaxis_title='Sample Quantiles', plot_legend_title=None, plot_height=400, plot_width=600, qq_marker_name='Markers QQ', qq_marker_color='rgba(128,128,128,1)', qq_marker_size=6, regression_line_name='Regression', regression_line_color='rgba(255,0,0,1)', regression_line_width=2, plotly_plot_renderer=None, plot_engine='plotly')
property sorted_distributions_sse
summarize(k=20)
summarize_info(k=10)

Module contents