-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #12
Open
danmcgib
wants to merge
18
commits into
main
Choose a base branch
from
develop
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Argument Handling: The update checks if the first argument (formula) is actually a DataFrame. If it is, the function treats it as the data parameter and sets formula to None. This ensures that the function can handle both a formula and a DataFrame as the first argument.
This update enhances the hist() function by adding proper support for subplots. Previously, the subplot argument was not handled correctly, and multiple histograms could not be displayed within a single figure. Now, users can specify subplots using the subplot argument, which allows for seamless integration of multiple histograms within a grid of subplots. Key Changes: Subplot Handling: Added a subplot argument to allow plotting within specific subplots (subplot=(nrows, ncols, index)). If a subplot is provided, the histogram will be plotted in the specified subplot. If no subplot is provided, a new figure will be created. Improved Layout: Added a check to automatically adjust the layout when multiple subplots are used (plt.tight_layout()).
Updated hist() Function with Subplot Support
Summary: This update adds support for subplots to the hist_res function, allowing users to specify a subplot position within a larger figure grid. If a subplot argument is provided (as a tuple, e.g., (nrows, ncols, index)), the histogram of residuals will be plotted in the specified location within the subplot grid. If no subplot is provided, a new figure is created. Changes Made: Added a subplot argument to hist_res, enabling it to position the histogram and normal distribution curve within a specified subplot. Modified the function to use plt.subplot(*subplot) if a subplot argument is passed, or plt.figure() to create a new figure when subplot is None.
Summary: This update adds subplot support to the plot_res function, allowing users to specify a subplot location within a grid of plots. If a subplot argument is provided (as a tuple, e.g., (nrows, ncols, index)), the residual plot will be displayed in the specified subplot position. If no subplot is provided, a new figure will be created. Changes Made: Added a subplot parameter to plot_res, enabling it to be positioned within a specified subplot grid. Implemented plt.subplot(*subplot) to place the plot in a grid when subplot is provided, or plt.figure() to generate a new figure when subplot is None.
New Parameters: main specifies the title of the histogram plot. xlab sets the x-axis label. ylab sets the y-axis label. Usage of New Parameters: plt.title(main) sets the plot’s title. plt.xlabel(xlab) and plt.ylabel(ylab) set the x-axis and y-axis labels, respectively.
hists(), plot_cook(), plot_cor()
added main, xlab, and ylab arguments
1. main: This sets the main title of the scatter plot matrix. 2. xcolor: Sets the color of the scatter points for independent (X) variables. 3. ycolor: Sets the color of the scatter points where the dependent (Y) variable is involved. 4. lines: A boolean argument that, if True, adds regression lines to each plot in the matrix. 5. linescolor: Specifies the color of the regression lines if lines=True.
fit.py summary.py barplot, hist, hist_res, plot_res
1. New input_data Argument: Replaced formula_or_data with a more intuitive input_data argument, allowing the function to handle: - A DataFrame for plotting all numeric columns. - A Series for generating a single histogram. - A list of Series (vector-like input) to plot multiple histograms. - A formula for specifying dependent and independent variables. 2. Support for Vector-like Input: Added the ability to handle lists of Series (e.g., input_data = [df['XOM'], df['MSFT']]). The function concatenates these into a DataFrame and creates histograms for each. 3. Expanded Input Flexibility: Maintains support for: - DataFrame input (plots all numeric columns). - Formula input (plots dependent and independent variables). - Vector-like input (plots specific columns). - Single Series input (plots one numeric column). 4. Enhanced Error Handling: Improved robustness by adding error checks for invalid input types, making the function more reliable. 5. Code Refinements: - Improved readability and layout calculations for easier maintenance and usage. - Optimized logic for handling diverse inputs, ensuring smooth transitions between different input types.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.