liveBook · Manning

Machine learning workflow

As explained in Vibe Engineering

A machine-learning pipeline is an ordered workflow that prepares data, trains a model, and produces or evaluates predictions.

A machine-learning workflow is an ordered pipeline that turns prepared data into model predictions and measured performance. The practical risk is treating a generated notebook as a finished system: missing input preparation can stop execution, while a working model can still be unsuitable for production. section 4.5.4 section 4.5.6

A disciplined workflow makes each stage explicit:

  • Load the preprocessed CSV; the pipeline depends on the earlier feature-engineering step having created it. section 4.5.4
  • Clean and prepare the data by removing null Dosage_Value and Salt_Name entries and filtering prices above the 99th percentile. section 4.5.4
  • Select and encode features, including categorical handling for Salt_Name, before fitting the model. section 4.5.4
  • Fit a RandomForestRegressor and evaluate predictions with R², mean absolute error, and root mean square error. section 4.5.4
  • Treat evaluation as a decision point rather than a victory condition: rough price estimation may be acceptable, but missing domain factors can block production use. section 4.5.6

Price prediction pipeline

A medicine-price workflow loads engineered features, removes incomplete rows and extreme prices, encodes categorical values, trains a regressor, and calculates R², MAE, and RMSE on predictions. The resulting model can support rough estimation while still exposing gaps in the features used by human experts. section 4.5.4 section 4.5.6

price_threshold = df['price'].quantile(0.99)
df = df[df['price'] < price_threshold]

Inspect the explicit 99th-percentile price filter used to remove outliers or potentially broken values before training. section 4.5.4

Listing 4.5 Evaluating the model’s performance
Y_pred = model.predict(X_test)
 
r2 = r2_score(Y_test, Y_pred)
mae = mean_absolute_error(Y_test, Y_pred)
rmse = np.sqrt(np.mean((Y_test - Y_pred)**2))
 

Inspect the evaluation calculation that compares predictions with held-out test values using R², MAE, and RMSE. section 4.5.4

How Vibe Engineering covers it

How deep it goes
Explains cleaning, outlier filtering, encoding, fitting, and evaluation, then stops short of production-ready feature completeness.
Examples
Uses Indian medicine data, a 99th-percentile price filter, Salt_Name encoding, RandomForestRegressor, and R², MAE, and RMSE.
What it assumes
Requires a previously generated engineered-feature CSV and teaches the remaining preparation, training, and evaluation steps explicitly.
What you can do after
Evaluate a trained price-prediction pipeline and judge whether its features support rough estimation or production use.
How it connects
Connects data cleaning, feature engineering, categorical encoding, regression, outlier handling, and model evaluation.

Also explained in

Compare how 9 books explain machine learning workflow →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.