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 |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
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. |