Added print statements for probabilities without .max(axis=1), made various changes in training script, evaluation script and data processing script.#9
Merged
Conversation
…arious changes in training script, evaluation script and data processing script.
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the generative model training and evaluation pipeline to use scikit-learn pipelines with integrated normalization, adds a new evaluation script for LLM benchmarking, and includes debugging output for probability analysis.
Key changes:
- Modified data processing to optionally skip normalization and return fitted scalers
- Refactored training to use sklearn pipelines combining MinMaxScaler and GaussianMixture
- Added comprehensive evaluation script with probability analysis and debugging output
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/scripts/train_generative_model.py | Simplified data loading logic and integrated with new pipeline approach |
| src/scripts/evaluate_llm_benchmark.py | New evaluation script for LLM benchmarking with probability analysis |
| src/european_values/llm_evaluation.py | New module implementing GMM-based evaluation with pipeline support |
| src/european_values/generative_training.py | Refactored to use sklearn pipelines and added extensive probability debugging |
| src/european_values/data_processing.py | Modified to support optional normalization and return fitted scalers |
saattrupdan
requested changes
Aug 6, 2025
Co-authored-by: Dan Saattrup Smart <47701536+saattrupdan@users.noreply.github.com>
Co-authored-by: Dan Saattrup Smart <47701536+saattrupdan@users.noreply.github.com>
Co-authored-by: Dan Saattrup Smart <47701536+saattrupdan@users.noreply.github.com>
Co-authored-by: Dan Saattrup Smart <47701536+saattrupdan@users.noreply.github.com>
Co-authored-by: Dan Saattrup Smart <47701536+saattrupdan@users.noreply.github.com>
Co-authored-by: Dan Saattrup Smart <47701536+saattrupdan@users.noreply.github.com>
Co-authored-by: Dan Saattrup Smart <47701536+saattrupdan@users.noreply.github.com>
Co-authored-by: Dan Saattrup Smart <47701536+saattrupdan@users.noreply.github.com>
Co-authored-by: Dan Saattrup Smart <47701536+saattrupdan@users.noreply.github.com>
Member
|
@AnnikaSimonsen Please mark my comments as resolved if you've fixed them by now. Also, there's a code check failing, which is due to the processing function returning a tuple now. Needs to be fixed in the |
Co-authored-by: Dan Saattrup Smart <47701536+saattrupdan@users.noreply.github.com>
Co-authored-by: Dan Saattrup Smart <47701536+saattrupdan@users.noreply.github.com>
- Update train_discriminative_classifier.py to handle (df, scaler) return - Update optimise_survey.py to handle (df, scaler) return - Update create_plot.py to handle (df, scaler) return - Fixes failing CI code check
…llm_benchmark.py - Remove unnecessary load_gmm_pipeline function, use joblib.load directly - Simplify process_responses function with minimal NaN handling - Try pipeline.predict_proba() first, fallback to component access - Add flexible data loading to support both EVS trend and EVS/WVS datasets - Fix tuple unpacking for process_data return value Addresses reviewer feedback
saattrupdan
requested changes
Aug 7, 2025
| """Main evaluation function.""" | ||
| # Load data | ||
| logger.info("Loading data...") | ||
| df = load_evs_wvs_data() |
| from european_values.data_processing import process_data | ||
| from european_values.generative_training import train_generative_model | ||
| from european_values.generative_training import ( | ||
| train_generative_model, # <-- This was missing! |
Member
There was a problem hiding this comment.
Nit: No internal comments in the code please 🙂
Suggested change
| train_generative_model, # <-- This was missing! | |
| train_generative_model |
This file contains hidden or 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
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.