Skip to content
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

Finished up experimental LV-Lite and cleaned up the rest of the LV code. #1769

Merged
merged 90 commits into from
May 31, 2024

Conversation

jdramsey
Copy link
Collaborator

No description provided.

jdramsey added 14 commits May 7, 2024 04:10
The condition in the LvLite class was updated. The statement is now checking if the index of 'e' is greater than the index of 'c', rather than less than. This change improves the efficiency of the scoring procedure.
… joe-work-2024-5-7

# Conflicts:
#	tetrad-lib/src/main/java/edu/cmu/tetrad/search/LvLite.java
…6.5-SNAPSHOT

New adjustment set methods were introduced in the Paths class. These methods calculate the adjustment sets between two nodes. Two new test methods have also been added to the TestGraph class to validate the new functionality. The version of the tetrad-lib and tetrad-gui artifacts was updated to 7.6.5-SNAPSHOT in the pom.xml files.
This change removes the unnecessary import of 'UnsupportedOperationException' from various search and test java files. The standard java 'UnsupportedOperationException' is used instead of 'javax.help.UnsupportedOperationException', making the code cleaner and more aligned with standard Java coding practices.
Reorganized several conditional statements and added a new array list 'toRemove2' in LvLite.java to improve logic flow. In TestGraph.java, optimized the adjustment set tests to handle different end points. Added validation checks in various classes to ensure estimated graph paths are legal.
The LvLite class has been renamed to BfciSb in both the main algorithm and the corresponding algorithm comparison files. The algorithm implementation has been significantly refactored to match the new BFCI-SB (BFCI Score-based) algorithm. This includes updates to the method of scoring and edge orientation, as well as changes to how certain steps are handled in the algorithm.
The BfciSb algorithm has been extensively refactored to improve efficiency and readability. Edge orientation steps have been revised and code redundancy has been reduced. The previously named LvLite class has been renamed to BfciSb for consistency and correctness with the new updated algorithm.
Enhanced logic for graph generation processes and improved related log messages. Specifically, this updated the way unshielded colliders are copied from CPDAG to PAG, added checks to avoid processing unnecessary nodes, and introduced certain points to improve the debug experience by adding more descriptive logging steps. This leads to better understanding and tracking of the graph generation and orientation process.
Removed the feature of resolving almost cyclic paths from various graph search algorithms to improve overall code clarity and efficiency. Adjusted any dependent classes consequently to fit the changes made in graph search.
The main function, 'reorientWithCircles', has been moved up within the code base for better readability and structure. Additionally, the conditions for edge validation operations in the 'doRequiredOrientations' function have been updated. The changes aim to simplify the conditions checking the adjacency and endpoints of the nodes to improve efficiency and clarity.
The BfciSb class in the tetrad-lib package has been largely reorganized. Several methods such as copyUnshieldedColliders, tryRemovingEdgesAndOrienting, reorientWithCircles, have been newly created or significantly refactored for more clarity. Additionally, obsolete 'thresholdLvLite' mention has been removed from the documentation.
This commit includes refactoring and reordering of fields in multiple classes, specifically BFci, GraspFci, SpFci, Fci, and GFci. Redundant spacing in some classes has been removed as well. The verbose variable was moved down the variable order in a few of these classes.
The FciOrient objects in the Cfci, Rfci, and SpFci classes have been updated to use the SepsetsGreedy class instead of the previous classes (SepsetsMaxP and SepsetsSet) for their initialization. This should enhance the efficiency of these classes as SepsetsGreedy offers a more efficient algorithm.
This commit modifies the TetradLogger messages in the BfciSb class. It changes the orientation details provided in the log messages to reflect accurate edge modification. This ensures that log messages are now precisely indicating the operations being performed on the nodes and edges within the graph.
@jdramsey jdramsey requested a review from bja43 May 14, 2024 07:18
Two Javadoc comments were added. One was added to the `adjustmentSets` method in the `Paths` class to clarify its return value. The second was added to the `setDepth` method in the `GraspFci` class, explaining its function to set the depth for the search algorithm.
The adjustment set calculation methodology has been updated in Path.java and corresponding test changes made in TestGraph.java. The new calculation method now takes into account the maximum path length for non-amenable paths and prioritizes rewarding paths close to either the source or the target node. The update offers guidance to users to choose the optimum adjustment set when multiple options are available.
The commit expands the different types of paths possible in the PathsAction java class. It also adjusts the maximum path length from 3 to 8. The newly included paths are amenable paths, non-amenable paths, all paths, confounder paths, and latent confounder paths. The Paths.java class is also adjusted to handle these new types properly.
The commented-out code in the Paths.java file was removed to improve code readability and maintainability. This unused code was creating confusion in understanding the flow and logic of the application.
The commented-out code in the Paths.java file was removed to improve code readability and maintainability. This unused code was creating confusion in understanding the flow and logic of the application.
This commit enhances the functionality of the graph and path representation, especially for the adjustment sets. It changes the GraphUtils path string method to include a boolean showBlocked parameter to show if a path is blocked. It also introduces a new JTextFieldWithPrompt class which extends JTextField to include a prompt in the text field. This is used to allow users to enter conditioning variables for paths in graph. Lastly, several changes were made to clean up and enhance the UI in PathsAction.
This commit includes refactoring of PathsAction.java and updates to several classes related to path calculations. Changes in PathsAction.java mainly focus on removing unnecessary elements, improving readability, and adding documentation. Updated classes in the library include GraphUtils.java and Paths.java, where new documentation and functionality for path calculations have been added.
The codebase underwent several changes mainly in PathsAction and GraphUtils files. Conciseness and improved readability was achieved through the grouping of repetitive code into methods like listPaths. The look of the JTextArea was enhanced with the use of multi-line strings.
The codebase underwent several changes mainly in PathsAction and GraphUtils files. Conciseness and improved readability was achieved through the grouping of repetitive code into methods like listPaths. The look of the JTextArea was enhanced with the use of multi-line strings.
This commit adds the original implementation of the Fask algorithm, which uses conditional independence and non-Gaussian pairwise orientation methods to search for adjacency and orientation in a graph. The method is robust and works well even if the graph contains feedback loops, including 2-cycles.
The Fask class has been cleaned up and the parameter list has been updated. Some unnecessary comments were removed and parameter names were simplified for clarity. Additionally, functionality for selecting the type of Fask Left Right rule to use was added, extending the flexibility of the class.
Refactored the structure of Fask, FaskOrig and related TestSimulatedFmri classes by removing duplicate functions and redundant code. Adjusted the construction of FASK algorithm in accordance with recent modifications. Updated javadocs with clearer explanations, use cases, and implementation details.
The statistical methods (calculating correlations, correcting skewness, etc.) used in the Fask class have been relocated. This internal code restructuring doesn't affect the functionality of the class but could improve code readability and maintenance.
Removed the use of FaskOrig and replaced with the updated Fask class. This involves updating the method calls and the parameters' names. Also, changed multiple methods' visibility in the Fask class from private to public.
The changes reflect a refactoring in how the Paths Calculation methods work in the Graph Editor. In particular, the maximum length for a path is now set using a Parameters object instead of directly via user preferences. This change improves the flexibility and clarity of the code by consolidating parameter management in a single place. Additionally, the adjustment paths logic has been updated to use parameters instead of hardcoded values for maximum number of sets, maximum distance, and maximum length.
The "firstPass" boolean variable used in the LvLite file was unnecessary and hence it has been removed. This modification reduces complexity and improves readability, without altering the functionality of the graph operations.
The log message in the LvLite class has been updated to correctly indicate that the source of information is CPDAG, not scorer. This change ensures the correct source is reflected in the message.
The existing LvLite class has been refactored to incorporate the doColliderRule variable. This aims to enhance flexibility in the orientation process by allowing for different rule applications based on the variable's boolean value. Additionally, two new statistics are introduced, namely NumberEdgesTrue and NumberEdgesEst, which provide the number of edges in the true and estimated graphs, respectively. Variations in the graph's number of edges provide important insights in terms of the graph's complexity and connectivity.
The `GridSearchModel` class has been updated to no longer serialize `algNames` and `selectedParameters` lists. A `selectedAlgorithmModels` list was added as an instance variable. In the `GridSearchEditor` class, several instance variables related to saving data and options were removed and the related logic was commented out. The "Add Simulation" Dialog has been renamed to "Add Algorithm".
The `GridSearchModel` class has been updated to no longer serialize `algNames` and `selectedParameters` lists. A `selectedAlgorithmModels` list was added as an instance variable. In the `GridSearchEditor` class, several instance variables related to saving data and options were removed and the related logic was commented out. The "Add Simulation" Dialog has been renamed to "Add Algorithm".
Refactored GridSearchModel and GridSearchEditor classes mainly by modifying list storing approach, changing transient fields to non-transient, and implementing new AlgorithmSpec and SimulationSpec classes to encapsulate algorithm and simulation details respectively. The code is cleaned up and optimized for better performance.
This commit introduces caching for the comparison and verbose output texts in the GridSearchModel. Additionally, unnecessary variables have been removed from the GridSearchEditor. The Cached texts are updated at the end of a grid search, and they are loaded into their corresponding text areas when the GridSearchEditor is initialized.
…umb algorithm

The LvLite algorithm is updated to include a variable for 'doDiscriminatingPathColliderRule' and implement associated logic. The LvDumb algorithm was also added. Some parameters are updated in 'algcomparison' file and others to adapt to these changes.
Two new statistics "MC-ADPass" and "MC-KSPass" are introduced and respective normalization values have been inverted for better statistical properties. A couple of typographical errors in the comments have been corrected. Unnecessary imports have been removed and classes have been initialized for improved efficiency. The ability to sort results by utility has been added.
Updated the calculation methods for Markov statistics in MarkovCheckKolmogorovSmirnoffP and MarkovCheckAndersonDarlingP to average the results over two iterations. Also, changed the return condition in MarkovCheckKsPasses to p > 0.05 instead of p > 0.0. In addition, new GUI options were added to GridSearchModel and GridSearchEditor to allow showing utilities in algorithm comparison.
Made PrintStream declarations transient in multiple places across the tetrad library and GUI to avoid potential serialization issues. Also, renamed the algorithm 'LvDumb' to 'LvBossPag' and reworded descriptions accordingly. Added a new simulation class 'SingleDatasetSimulation' for supplying single dataset in place of simulated data. Modified 'AlgcomparisonModel' (now 'GridSearchModel') to handle algorithm knowledge and optionally consider a supplied dataset. Updated 'SaveSessionAction' to show an error message when a session fails to save due to serialization issues.
Added a new class JTextFieldWithPrompt for displaying prompts in text fields. Additionally, made PrintWriter instances in DataForCalibrationRfci serializable, and moved the JTextFieldWithPrompt class from PathsAction to EditorUtils for better organization.
Removed unused logic in the addTableColumnsTab function of GridSearchEditor.java. Unneeded logic regarding "Weights for Statistics" and parameter handling has been eliminated. Action listener for "Edit Utilities" has been simplified.
The double weight was extracted from the call chain for more clarity. This enhances the readability of the code in GridSearchEditor by breaking down complex lines into simpler segments. Thus, the code maintanability is improved.
The update includes providing comments for setter methods and private variables in various classes such as LvLite, IndTestConditionalGaussianLrt and MarkovCheck. These comments have been integrated to improve clarity and provide necessary usage information.
This commit refactors the Rfci and GridSearchModel classes. In Rfci, it makes logging of elapsed time conditional based on the "verbose" variable and imports specific classes instead of using wildcard import statements. A new comment is added in GridSearchModel to explain a variable.
The double weight was extracted from the call chain for more clarity. This enhances the readability of the code in GridSearchEditor by breaking down complex lines into simpler segments. Thus, the code maintanability is improved.
This commit adds error logging to the serialization and deserialization processes which was missing beforehand. The error messages notify the user when an object fails to serialize or deserialize, providing the class name and error details for troubleshooting.
This commit introduces serialization and deserialization methods to various classes in the edu/cmu/tetrad directory. ObjectOutputStream and ObjectInputStream are used to handle the serialization and deserialization process, and exceptions are logged using TetradLogger if they occur.
An unnecessary backtick (`) was removed from the parameter name "algcomparisonSetAlgorithmKnowledge" in the setAlgorithmKnowledge method within the GridSearchModel class. This correction allows the function to reference the correct parameter name.
The code has been refactored to include type checking before doing a type conversion, improving error handling. Unnecessary import statements have been removed. Additionally, white spaces and line alignment have been corrected for better readability. The readResolve method in the NodeType class, which was not being used, has also been removed.
Several new constructors have been added to the GridSearchModel class. These constructors enable initialization of GridSearchModel with different combinations of arguments such as KnowledgeBoxModel, GraphSource, DataWrapper, and Parameters. This provides more flexibility when initializing GridSearchModel instances. Also, adjustments have made in some method's documentation for clarity and old unused method 'setWeight' was deleted.
The commit mainly adds the 'transient' keyword to several variables in TetradLogger class to avoid them being serialized. Another significant change includes renaming of 'LvBossPag' class to 'LvDumb'. Several redundancies in GridSearchModel class have been cleaned up and error handling improvements have been made in classes like Comparison and GridSearchModel. Scroll functionality has also been added in GridSearchEditor class.
Improved the handling of statistics model creation by checking for no-argument constructors before instantiation to avoid exceptions. Also corrected the filtering logic in the Directed Acyclic Graph (DAG) to Page (PAG) conversion utility to properly remove non-measured nodes.
The enumeration classes, ParamComparison, ParamType, ParamConstraintType, NodeType, have been refactored. Serialization and deserialization methods have been added to several classes. In addition, null checks have been added for setNodeType and getNodeType methods, a 'Grid Search' button has been added to the toolbar, and the IndTestType enum class has been refactored.
Copy link
Collaborator

@bja43 bja43 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are too many options for the grid search to exhaustively check them all, but I was able to get a few simple comparisons up and running without issue.

@jdramsey jdramsey merged commit ebaba1b into development May 31, 2024
@jdramsey jdramsey deleted the joe-work-2024-5-7 branch May 31, 2024 21:08
@jdramsey
Copy link
Collaborator Author

Thanks. I'll make a snapshot to send to Peter; he's been playing with it. He might have opinions too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants