This folder contains corrected versions of the original Recipe Recommender / EDA notebooks.
Use improved_final_submission_complete.ipynb if you want the entire assignment in one notebook.
improved_data_reading.ipynbimproved_typecasting.ipynbimproved_feature_extraction.ipynbimproved_eda.ipynbimproved_final_submission_part1.ipynbimproved_final_submission_part2.ipynbimproved_final_submission_complete.ipynb
By default, the notebooks expect:
./data/RAW_recipes.csv
./data/RAW_interactions.csv
You can set another local or S3 location with environment variables:
export RECIPE_DATA_ROOT=/path/to/dataor
export RECIPE_DATA_ROOT=s3a://your-real-bucket/pathYou can also set the two files independently:
export RECIPES_PATH=/path/RAW_recipes.csv
export INTERACTIONS_PATH=/path/RAW_interactions.csv- Added all missing imports (
FloatTypeequivalent throughtypes,IntegerType, andWindow). - Removed brittle
inferSchemaassumptions and explicitly cast required numeric fields. - Replaced the placeholder-only S3 path with configurable local/S3 paths.
- Correctly removed
[/]before parsing thenutritionlist. - Avoided division by zero when creating per-100-calorie nutrient features.
- Correctly converted tag strings such as
['tag-a', 'tag-b']toarray<string>. - Rebuilt the recipe/interactions join after recipe transformations so
combined_dfcontains transformed tags/features. - Replaced invalid
StringIndexer + OneHotEncoderon tag arrays with binaryCountVectorizermulti-hot encoding. - Fixed invalid
explode('tags')usage by ensuring tags are arrays first. - Replaced Unix timestamp arithmetic with
to_date+datedifffordays_between. - Created
days_betweeninside the EDA notebook before plotting it. - Removed full-dataset
combined_df.toPandas()and converted only bounded/aggregated plotting data. - Completed the previously incomplete final-submission Part 2 notebook.
- Added a single complete notebook containing Tasks 01–09.
pip install pyspark pandas matplotlib seaborn jupyterA Java installation compatible with your Spark version is also required.