Skip to content

Predict

fyt.commands.predict

Batch prediction command: load a saved pipeline and score new data.

read_table(path)

Read a csv or parquet file by extension.

Parameters:

Name Type Description Default
path Path

Input file path.

required

Returns:

Type Description
DataFrame

The loaded DataFrame.

Raises:

Type Description
ValueError

For unsupported file extensions.

run_prediction(config)

Score a data file with a saved pipeline and write the results.

Parameters:

Name Type Description Default
config PredictCommandConfig

Prediction configuration.

required

Returns:

Type Description
DataFrame

The DataFrame that was written to config.output_path.

Raises:

Type Description
ValueError

If config.id_column is not present in the input data.

write_table(df, path)

Write a DataFrame as csv or parquet by extension.

Parameters:

Name Type Description Default
df DataFrame

DataFrame to write.

required
path Path

Output file path.

required

Raises:

Type Description
ValueError

For unsupported file extensions.