this is my code (New Text Document.txt) and have this error:

"
Traceback (most recent call last):
 File "d:\python\practice\Main\final 5.py", line 246, in <module>
 'Evolutionary Algorithm': {'pH': optimal_evolutionary_pH, 'Acidic': optimal_evolutionary_acidic, 'Titer': optimal_evolutionary_titer}
 ^^^^^^^^^^^^^^^^^^^^^^^
NameError: name 'optimal_evolutionary_pH' is not defined
"

fix the error and give me the full code


Proposed Thesis Chapters and Sub-Chapters
1. Title Page
Title: The title should clearly reflect the focus of your thesis. Example: Optimization of Chinese Hamster Ovary (CHO) Cell Culture Conditions Using Machine Learning.
Your Name
Advisor’s Name
Institution
Department
Date of Submission
2. Abstract
Purpose: A concise summary of your research (around 250-300 words). The abstract should include:
The objective of your study.
The methods used (mention machine learning and data analysis).
Key findings (optimal conditions for CHO cells, improved titer, etc.).
Conclusions (how this contributes to the field of biotechnology).
3. Acknowledgements
Purpose: Acknowledge individuals or organizations that helped you in your research.
Include your advisor, colleagues, family, and any institutions that provided support or funding.
4. Table of Contents
Purpose: List all chapters, sections, subsections, tables, and figures with corresponding page numbers.
5. List of Figures and Tables
Purpose: Organize all figures and tables with page references for easy navigation.
Chapter 1: Introduction
1.1 Background
Purpose: Introduce the reader to your research topic and provide context.
Discuss the importance of CHO cells in producing biopharmaceuticals, particularly monoclonal antibodies.
Explain the challenges of optimizing cell culture conditions to enhance product quality (e.g., reducing acidic variants, increasing titer).
Introduce machine learning as a tool for optimization and explain its growing relevance in biotechnology.
1.2 Problem Statement
Purpose: Clearly define the problem your thesis addresses.
State that traditional optimization methods are time-consuming and often rely on trial and error.
Highlight the need for an efficient and data-driven method, such as machine learning, to optimize cell culture conditions.
1.3 Research Objectives
Purpose: Outline the specific goals of your research.
Primary Objective: To optimize CHO cell culture conditions using machine learning to improve mAb production yield and quality.
Secondary Objectives:
Identify key factors (like temperature) influencing product yield.
Build and evaluate machine learning models to predict optimal culture conditions.
1.4 Research Questions
Purpose: Define the questions your thesis will answer.
How can temperature optimization improve CHO cell production yield?
Which machine learning models are most effective for predicting optimal culture conditions?
How can the variability in acidic charge variants be minimized?
1.5 Significance of the Study
Purpose: Justify why this research is important.
Discuss the potential economic and scientific impact of optimizing mAb production.
Mention the broader implications of integrating machine learning in bioprocessing.
1.6 Thesis Structure
Purpose: Provide a roadmap for the reader.
Briefly describe the content of each chapter, helping readers understand the flow of the thesis.
Chapter 2: Literature Review
2.1 CHO Cells and Monoclonal Antibody (mAb) Production
Purpose: Provide background information on CHO cells and their role in producing therapeutic proteins.
Explain why CHO cells are preferred for industrial mAb production.
Discuss the factors influencing CHO cell growth and how media conditions impact product quality.
2.2 Charge Variants and Their Impact on mAb Quality
Purpose: Explain the importance of minimizing charge variants.
Define acidic and basic charge variants and their effects on mAb functionality, efficacy, and safety.
Summarize techniques used to measure and quantify charge variants (e.g., cation-exchange chromatography).
2.3 Traditional Methods of Media Optimization
Purpose: Review how cell culture conditions were traditionally optimized.
Discuss experimental approaches (such as Design of Experiments or trial and error) and their limitations in terms of efficiency and precision.
2.4 Machine Learning in Bioprocessing
Purpose: Introduce machine learning as a solution to optimization challenges.
Review relevant literature on the use of machine learning in optimizing cell culture conditions.
Discuss how machine learning models (e.g., decision trees, XGBoost) have been applied in similar studies.
2.5 Feature Selection and Ranking
Purpose: Review feature selection methods for identifying the most influential factors in bioprocess optimization.
Discuss Pearson’s correlation coefficient and machine learning techniques like Random Forest and SHAP for ranking features based on their importance.
2.6 Research Gap
Purpose: Summarize what is missing in current research.
Highlight the need for a machine learning-driven framework specifically for CHO cell culture optimization, which your study aims to fill.
Chapter 3: Materials and Methods
3.1 Data Collection
Purpose: Explain how you gathered the data for your analysis.
Describe the experimental setup for culturing CHO cells.
Detail the media formulations and how variables such as temperature, acidic charge variants, and titer were measured.
3.2 Data Preprocessing
Purpose: Describe how you prepared the data for analysis.
Explain how missing data was handled, how variables were normalized or transformed, and how the data was cleaned for machine learning models.
3.3 Machine Learning Models
Purpose: Provide details about the models you used.
Discuss the regression models applied (e.g., linear regression, XGBoost, decision trees).
Explain why certain models were chosen based on their interpretability, performance, and ability to predict outcomes.
3.4 Model Training and Validation
Purpose: Explain how you trained and tested your models.
Describe your use of cross-validation to ensure reliable results.
Mention the performance metrics used to evaluate the models (e.g., RMSE, R²).
3.5 Medium Optimization Using Selected Models
Purpose: Detail the process of using the selected machine learning model for optimizing cell culture conditions.
Explain how the best-performing model was used to simulate different media formulations and predict the optimal temperature.
3.6 Experimental Validation
Purpose: Describe how you validated the model predictions experimentally.
Discuss the outcomes of experiments conducted with the optimized media formulation, comparing them with control conditions.
Chapter 4: Results
4.1 Descriptive Statistics
Purpose: Provide an overview of your dataset.
Include basic statistics for each variable (mean, median, standard deviation).
Show data visualizations (e.g., histograms, box plots) for Temperature, Acidic, and Titer.
4.2 Feature Ranking and Selection Results
Purpose: Present the results of feature selection.
Show correlation matrices, feature importance scores from Random Forest, and SHAP analysis results.
4.3 Model Performance and Evaluation
Purpose: Compare the performance of your machine learning models.
Include tables summarizing the results (e.g., RMSE, R²) for each model.
Present box plots comparing model performance (similar to Fig. 6).
4.4 Media Optimization
Purpose: Present the predicted optimal conditions for CHO cell culture.
Show visualizations of predicted results for acidic charge variants and titer under different temperature conditions.
4.5 Experimental Validation Results
Purpose: Present the experimental results validating the model’s predictions.
Compare the optimized medium’s performance with control media.
Chapter 5: Discussion
5.1 Interpretation of Results
Purpose: Analyze the meaning of your findings.
Discuss the significance of key features, particularly temperature, in improving CHO cell yield and reducing acidic variants.
5.2 Comparison with Literature
Purpose: Compare your findings with existing studies.
Explain how your results align or diverge from previous research on media optimization and machine learning applications.
5.3 Implications for Industrial Bioprocessing
Purpose: Discuss how your findings could be applied in real-world mAb production.
Mention the potential to improve production efficiency and reduce costs in industrial settings.
5.4 Limitations of the Study
Purpose: Acknowledge any limitations in your research.
For example, mention sample size, any assumptions made, or constraints in model generalizability.
5.5 Recommendations for Future Research
Purpose: Suggest how future studies can build on your work.
Recommend expanding the dataset or exploring more advanced machine learning techniques.
Chapter 6: Conclusion
6.1 Summary of Findings
Purpose: Recap the key findings of your study.
Summarize how machine learning helped identify optimal CHO cell culture conditions.
6.2 Contributions to the Field
Purpose: Highlight the original contributions of your work.
Emphasize how your research advances the use of machine learning in bioprocess optimization.
6.3 Future Directions
Purpose: Conclude with suggestions for future work.
Recommend further experimental validation or testing in industrial bioreactors.
7. References
Purpose: Provide a complete list of references cited throughout the thesis.
Follow your institution’s guidelines (APA, MLA, IEEE, etc.).
8. Appendices
Purpose: Include any additional material not covered in the main text.
Add raw data, additional tables or figures, and Python code used in your machine learning analysis.
How to Write Each Section
Keep it clear and concise: Avoid unnecessary jargon, and make sure each section flows logically.
Use figures and tables: Where possible, support your text with visual aids.
Cite references: Ensure that any claims are supported by evidence from literature.
Connect theory with practice: In the methods and discussion sections, explain how your theoretical research aligns with practical experimentation.
Revise frequently: Write drafts of each section, revise, and get feedback from your advisor or peers.