| --- |
| license: odbl |
| configs: |
| - config_name: default |
| data_files: |
| - split: train |
| path: nuclear_power_plants_dataset_cleaned_and_sorted.csv |
| language: |
| - en |
| tags: |
| - chemistry |
| - nuclear |
| - geo |
| size_categories: |
| - 1K<n<10K |
| --- |
| --- |
|
|
| # Predicting Whether a Nuclear Reactor Is PWR or BWR |
|
|
| ## Dataset Overview |
|
|
| This project is based on the **Geo Nuclear Data** dataset from Kaggle. |
| The dataset contains information about nuclear reactors around the world, including geographic and technical features such as: |
|
|
| - Country |
| - Plant name |
| - Latitude |
| - Longitude |
| - Reactor type |
| - Capacity |
| - Status |
| - Construction and operational dates |
|
|
| The original dataset was cleaned and filtered in order to focus only on two reactor types: |
|
|
| - **PWR** |
| - **BWR** |
|
|
| ## Sample Usage |
|
|
| You can load this dataset directly from Hugging Face using the `datasets` library: |
|
|
| ```python |
| from datasets import load_dataset |
| |
| dataset = load_dataset("jonblustein/GeoNuclearData") |
| df = dataset["train"].to_pandas() |
| print(df.head()) |
| ``` |
|
|
| ## Research Question |
|
|
| **Can we predict whether a reactor is PWR or BWR?** |
|
|
| ## Data Wrangling and Cleaning |
|
|
| After cleaning, the final dataset contained **573 rows**. |
|
|
| ## Descriptive Statistics and Main Notes |
|
|
| The cleaned dataset still showed class imbalance: |
|
|
| - **PWR:** 483 reactors |
| - **BWR:** 120 reactors |
|
|
| This means the dataset contains many more PWR reactors than BWR reactors, which may affect classification performance. |
|
|
| ## Research Questions, Visualizations, and Answers |
|
|
| ### Question 1: Is there a difference in capacity between PWR and BWR reactors? |
|
|
| This question was explored using a bar chart comparing the **mean** and **median** capacity of each reactor type. |
|
|
|  |
|
|
| **Answer:** |
| Yes. PWR reactors generally show higher capacity values than BWR reactors. |
| Both the average and the median capacity are higher for PWR reactors, although the number of PWR reactors in the dataset is also much larger. |
|
|
| ### Question 2: Are PWR and BWR reactors distributed differently across geographic locations? |
|
|
| This question was explored using a **world map** based on latitude and longitude. |
|
|
|  |
|
|
| **Answer:** |
| The map shows that nuclear reactors are highly concentrated near coastlines. |
| There is some geographic difference between PWR and BWR reactors, but not a perfect separation. |
| For example, many reactors in Russia and nearby regions appear to be PWR, and China also shows many PWR reactors. |
|
|
| In general, the map suggests two visible geographic blocs: one around the United States and another around Russia/China. |
| This pattern is not perfectly sharp, but it is visible enough to suggest that geographic location may contain useful predictive information. |
|
|
| ### Question 3: Which countries contain the highest numbers of PWR and BWR reactors? |
|
|
| This question was explored using a **stacked bar chart** of reactor counts by country and reactor type. |
|
|
|  |
|
|
| **Answer:** |
| The United States and China appear to have the highest numbers of reactors, followed by countries such as Japan and France. |
| Russia appears lower than expected in this dataset maybe because of Chernobyl. |
| The distribution of PWR and BWR reactors is not the same in all countries, which suggests that country may be useful as a predictive feature. |
|
|
| ### Question 4: How does the total global capacity compare between PWR and BWR reactors? |
|
|
| This question was explored using a **bar chart** of total capacity by reactor type. |
|
|
|  |
|
|
| **Answer:** |
| PWR reactors contribute much more total global capacity than BWR reactors in this dataset. |
| This matches the earlier findings that PWR reactors are both more common and usually larger in capacity. |
|
|
| ## Main Insights |
|
|
| The main findings of the exploratory analysis were: |
|
|
| - **Capacity** was the most informative feature in the dataset. |
| - Geographic location was useful, but not strong enough on its own. |
| - There was no single feature that perfectly separated PWR and BWR reactors. |
| - The classification task seems to depend on a **combination of several features together**, not on one perfect variable. |
|
|
| ## Decisions Made During the Analysis |
|
|
| Several important decisions were made during the project: |
|
|
| - I decided to focus only on **PWR** and **BWR** reactors. |
| - I removed rows with missing values in important columns. |
| - I removed rows with missing coordinates because location was relevant to the research question. |
| - I filled missing values in `Capacity` using the median. |
| - I checked skewness in `Capacity`, but did not apply transformation because the skewness was moderate and not extreme. |
| - I compared several models before selecting the final one. |
|
|
| ## Modeling |
|
|
| The target variable was: |
|
|
| - **ReactorType** |
| - `0 = BWR` |
| - `1 = PWR` |
|
|
| The main engineered and selected features included: |
|
|
| ### Numeric features |
| - Capacity |
| - Latitude |
| - Longitude |
| - AbsLatitude |
| - ConstructionYear |
| - OperationalYear |
| - YearsToOperation |
| - ReactorAge |
|
|
| ## got to say that at first i used only capacity and the cordinates. |
| ## after that i improved my model with the other features |
|
|
| ### Categorical features |
| - Status |
| - Country |
| - CountryCode |
|
|
| The following models were tested: |
|
|
| - Logistic Regression |
| - Balanced Logistic Regression |
| - Random Forest |
| - Gradient Boosting |
|
|
| ## Model Results |
|
|
| The best model was **Random Forest**. |
|
|
| ### Best Model: Random Forest |
|
|
| - **Accuracy:** 0.8957 |
| - **Macro F1-score:** 0.8467 |
| - **BWR Recall:** 0.7917 |
| - **PWR Recall:** 0.9231 |
|
|
| **Interpretation:** |
| Random Forest performed better than the other models because it was able to capture more complex patterns in the data. |
| It also gave the best balance between overall performance and detection of both reactor types. |
|
|
| ## Limitations |
|
|
| This project has several limitations: |
|
|
| - Some useful variables originally had missing values. |
| - The dataset is imbalanced, with many more PWR reactors than BWR reactors. |
| - Geographic coordinates alone do not clearly separate the two reactor types. |
| - Some interesting geographic or political patterns may exist, but they would require further research beyond this dataset. |
|
|
| ## Final Conclusion |
|
|
| This project showed that it is possible to predict whether a nuclear reactor is PWR or BWR with good performance. |
|
|
| The exploratory analysis showed that **Capacity** is the strongest single feature, while geographic location and country also provide useful information. |
| However, no single feature perfectly separates the two classes. |
|
|
| Among all tested models, **Random Forest** gave the best results and was selected as the final model. |