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

Add data transformation to new_feature_template #252

Closed
wants to merge 16 commits into from

Conversation

Damonamajor
Copy link
Contributor

@Damonamajor Damonamajor commented Aug 6, 2024

This refactors the previous data transformation into five specific objectives.

  • Inidividual Pins
  • Individual Cards
  • Neighborhood Level Summary Stats for Pins
  • Neighborhood Level Summary Stats for Cards
  • Leaflet maps which include both Pins and Cards

Key changes
-The wonkiest part of this is the leaflet map, which pivots wider based on the different SHAP values. For example, if a pin has 4 cards, it has value_1, value_2 ,etc. allowing the leaflet map to display the individual value for each card, while plotting based on pin.

#250

@@ -0,0 +1,119 @@
target_feature_value <- params$added_feature
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are used throughout all the other docs, without being explicitly mentioned in the others.

select(
meta_pin, meta_card_num, pred_card_shap_baseline_fmv,
{{ target_feature_value }}
) %>%
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renames the value to append _shap, allowing the feature value to be merged without creating .x, .y.

)

# Summarizing data by neighborhood code
card_nbhd <- card_individual %>%
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are mostly used for the ggplots for neighborhood mapping.

) %>%
ungroup() %>%
right_join(pin_individual, by = c("meta_pin" = "meta_pin")) %>%
mutate(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removes the dollar::scales before dividing by it.

@Damonamajor Damonamajor closed this Sep 3, 2024
@Damonamajor Damonamajor deleted the add_data_transformation branch October 31, 2024 19:28
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.

1 participant