Skip to content

Conversation

@JasonHonKL
Copy link
Contributor

The current example is outdated and still uses a model that the code indicates is deprecated. I have updated it to the latest version using the model builder.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR updates the house prices example to use the modern ModelBuilder API instead of the deprecated Model.build() method. The change represents a straightforward migration from an older API pattern to the current recommended approach in the Plexe framework.

The key architectural change involves separating configuration from model building: instead of passing all parameters to a single Model() constructor and then calling build(), the new pattern uses ModelBuilder() for initial configuration (provider settings, verbosity) and then calls build() with model-specific parameters (intent, datasets, schemas, callbacks). This separation follows a builder pattern that provides better organization of concerns and likely improved maintainability.

The change maintains identical functionality while modernizing the API usage. All the same provider configurations, model constraints, timeout settings, and MLFlow callbacks are preserved. The example continues to demonstrate the same machine learning workflow - predicting house prices using linear regression and decision tree models with specific hardware constraints - but now uses the non-deprecated API that new users should follow.

This update ensures the example code aligns with current framework recommendations and removes deprecation warnings that would otherwise confuse users learning from the examples.

Important Files Changed

Files Modified (1)
Filename Score Overview
examples/house_prices.py 4/5 Updated from deprecated Model.build() to modern ModelBuilder API while preserving all functionality

Confidence score: 4/5

  • This PR is safe to merge with minimal risk as it's a straightforward API migration
  • Score reflects a simple API update that maintains identical functionality while following current best practices
  • No files require special attention as the change is a direct translation to the new API pattern

Sequence Diagram

sequenceDiagram
    participant User
    participant ModelBuilder
    participant ProviderConfig
    participant MLFlowCallback
    participant Model
    participant Dataset
    participant plexe

    User->>ProviderConfig: "Create provider configuration"
    ProviderConfig-->>User: "Provider config created"
    
    User->>ModelBuilder: "Initialize with provider config"
    ModelBuilder-->>User: "ModelBuilder instance created"
    
    User->>Dataset: "Read training CSV"
    Dataset-->>User: "Training dataframe loaded"
    
    User->>MLFlowCallback: "Create callback with tracking URI"
    MLFlowCallback-->>User: "Callback configured"
    
    User->>ModelBuilder: "build(datasets, intent, output_schema, callbacks)"
    ModelBuilder->>Dataset: "Process training data"
    Dataset-->>ModelBuilder: "Data processed"
    ModelBuilder->>MLFlowCallback: "Log experiment"
    MLFlowCallback-->>ModelBuilder: "Experiment logged"
    ModelBuilder-->>User: "Model built and returned"
    
    User->>plexe: "save_model(model, filename)"
    plexe-->>User: "Model saved to file"
    
    User->>Dataset: "Read test CSV and sample"
    Dataset-->>User: "Test dataframe loaded"
    
    User->>Model: "predict(test_records)"
    Model-->>User: "Predictions returned"
    
    User->>Model: "describe()"
    Model-->>User: "Model description returned"
    
    User->>User: "Print predictions and description"
Loading

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

vaibs-d
vaibs-d previously approved these changes Aug 19, 2025
Copy link
Contributor

@vaibs-d vaibs-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for updating this @JasonHonKL :)

@vaibs-d
Copy link
Contributor

vaibs-d commented Aug 19, 2025

hey @JasonHonKL seems like there was a linting issue. Can you please fix this? :)

@JasonHonKL
Copy link
Contributor Author

@vaibs-d thanks for the reminder I have fixed the formatting CI error.

@vaibs-d vaibs-d merged commit d7f7646 into plexe-ai:main Aug 19, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants