Apps¶
mljar-supervised can generate Mercury apps from trained AutoML models. You can:
- generate the app workspace with
AutoML.app() - start it locally with
AutoML.local_app() - publish it quickly with
AutoML.publish_app() - run or host the generated app manually on your own infrastructure
Generate app files¶
Use app() to generate the app workspace:
from supervised import AutoML
automl = AutoML(results_path="AutoML")
automl.fit(X, y)
automl.app()
The generated app directory contains runtime files such as:
predict_single.ipynbpredict_batch.ipynbapp_support.pymljar_app.jsonconfig.tomlrequirements.txtruntime.txtautoml.zip
The default generated app title is MLJAR AutoML. You can provide your own title with:
automl.app(title="Churn Prediction")
Start locally¶
Use local_app() to generate the app, start Mercury, and open the browser:
automl.local_app()
The local app runs in the foreground.
Note
Press Ctrl+C to stop the local app.
Start manually¶
You can also start the generated app manually. This is useful if you want to control the environment yourself or debug the generated workspace.
Generate the app:
automl.app()
Then run Mercury in the generated app directory:
cd AutoML/app
mercury --working-dir=.
If Mercury is not installed in the current environment, install the generated app dependencies first:
pip install -r requirements.txt
Publish quickly¶
Use publish_app() for the fastest way to put the app online:
automl.publish_app()
This helper:
- signs in through
platform.mljar.com - creates or updates the app URL
- uploads the generated runtime files
- prints progress and friendly error messages
- remembers the last successfully published app URL
If you want to reuse a specific published app URL:
automl.publish_app(url="https://your-app.ismvp.org")
Publish or host manually¶
Using platform.mljar.com is simply the fastest path, but it is not required.
You can generate the app workspace with app() and then host it yourself:
- Generate the app files
- Install the generated dependencies
- Run Mercury on your own server
- Deploy with your own preferred hosting setup
This is a good option when you want full control over infrastructure, networking, or deployment workflow.
Generated app behavior¶
The generated app can include:
- a single prediction dashboard
- batch CSV scoring
- prediction download for batch mode
- feature importance plots when available
- feature context plots for single prediction mode
Limits¶
If the trained model has more than 15 features, the generated app will include batch CSV scoring only.
Warning
For datasets with more than 15 features, mljar-supervised skips the single prediction widget dashboard and generates a batch-only app.
Recommended usage¶
- use
app()when you want the generated files - use
local_app()when you want the quickest local preview - use
publish_app()when you want the fastest hosted deployment - use manual startup or your own server when you need full control
- regenerate the app after retraining the model
Tutorials¶
If you want a beginner-friendly walkthrough after training a model, check: