Created
December 20, 2021 05:23
-
-
Save jayhuang75/4b44b66cee6cff96857868ae3802a7eb to your computer and use it in GitHub Desktop.
go-train-delay-ml-pipeline-feature-target
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
| async fn feature_and_target( | |
| &self, | |
| df: &DataFrame, | |
| ) -> (PolarResult<DataFrame>, PolarResult<DataFrame>) { | |
| /* Read a dataframe, select the columns we need for feature training and target and return | |
| the two new dataframes*/ | |
| //id,date,departure,depart_scheduled,destination,arrival_scheduled | |
| let features = df.select(vec![ | |
| "date", | |
| "departure", | |
| "depart_scheduled", | |
| "destination", | |
| "arrival_scheduled", | |
| ]); | |
| let target = df.select("delay"); | |
| (features, target) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment