Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jayhuang75/4b44b66cee6cff96857868ae3802a7eb to your computer and use it in GitHub Desktop.

Select an option

Save jayhuang75/4b44b66cee6cff96857868ae3802a7eb to your computer and use it in GitHub Desktop.
go-train-delay-ml-pipeline-feature-target
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