### Install hboard (Web Server) Source: https://context7.com/datacanvasio/hyperboard/llms.txt Install the web-based visualization server using pip or conda. ```bash # Install via pip pip install hboard ``` ```bash # Or install via conda conda install -c conda-forge hboard ``` -------------------------------- ### Start HyperBoard web server Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard/README.md Initialize and start the web server to monitor the specified event file. ```python from hboard.app import WebApp webapp = WebApp("events.txt") webapp.start() ``` -------------------------------- ### CLI - Start Web Server Source: https://context7.com/datacanvasio/hyperboard/llms.txt Use the `hboard` command-line tool to visualize completed experiments by starting a web server. You can specify the event file path and a custom port. ```bash # View CLI help hboard -h # usage: hboard [-h] {server} ... # hboard command is used to visualize the experiment ``` ```bash # Start web server to visualize a completed experiment hboard server --event-file=/path/to/events.json ``` ```bash # Specify a custom port hboard server --event-file=/path/to/events.json --port=9999 ``` ```bash # Example with sample data from repository hboard server --event-file=hboard/hboard/tests/events_example.json # Access dashboard at http://localhost:8888 ``` -------------------------------- ### Start Visualization Web Server Source: https://context7.com/datacanvasio/hyperboard/llms.txt Start the HyperBoard web visualization server. Ensure `event_file` is defined before instantiation. ```python from hboard.app import WebApp webapp = WebApp(event_file=event_file, server_port=8888) webapp.start() ``` -------------------------------- ### Install hboard-widget (Jupyter Integration) Source: https://context7.com/datacanvasio/hyperboard/llms.txt Install the Jupyter widget for inline experiment visualization in notebooks. ```bash # Install via pip pip install hboard-widget ``` ```bash # Or install via conda conda install -c conda-forge hboard-widget ``` -------------------------------- ### Install HyperBoard via pip Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard/README.md Standard installation method using the Python package manager. ```shell pip install hboard ``` -------------------------------- ### View server logs Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard/README.md Example output showing the server running status. ```shell 02-24 20:45:58 I hboard.app.py 77 - experiment visualization http server is running at: http://0.0.0.0:8888 ``` -------------------------------- ### Initialize hboard-frontend Project Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard-frontend/README.md Navigates into the hboard-frontend directory, installs project dependencies using yarn, and builds the project using webpack. Ensure you have already cloned the repository and installed global packages. ```bash cd HyperBoard/hboard-frontend yarn webpack ``` -------------------------------- ### Install hboard-widget with pip Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard-widget/README.md Use this command to install the hboard-widget package using pip. ```shell pip install hboard-widget ``` -------------------------------- ### Install HyperBoard via conda Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard/README.md Alternative installation method using the conda package manager. ```shell conda install -c conda-forge hboard ``` -------------------------------- ### Install Global Packages Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard-frontend/README.md Installs webpack, webpack-cli, and yarn globally using npm. Ensure Node.js v14.15.0+ is installed. ```bash npm install -g webpack webpack-cli yarn ``` -------------------------------- ### Programmatically Create Experiment Events Source: https://context7.com/datacanvasio/hyperboard/llms.txt Demonstrates how to programmatically create and write experiment events to an NDJSON file using Python. Includes functions for writing events and examples for experiment start, step progression, and trial results. ```python import json def write_event(event_file, event_type, payload): """Append an event to the experiment event file.""" event = {"type": event_type, "payload": payload} with open(event_file, 'a', newline='\n') as f: f.write(json.dumps(event)) f.write('\n') # Create event file and initialize experiment event_file = "./my_experiment_events.json" # Write experiment start event write_event(event_file, "experimentStart", { "task": "binary", "datasets": [{"kind": "Train", "shape": [1000, 20], "memory": 160000}], "steps": [ {"index": 0, "name": "preprocessing", "type": "CustomStep", "status": "wait"}, {"index": 1, "name": "model_search", "type": "SearchStep", "status": "wait"} ] }) # Write step progress events write_event(event_file, "stepStart", {"index": 0, "status": "process"}) write_event(event_file, "stepEnd", {"index": 0, "status": "finish"}) # Write trial results write_event(event_file, "trialEnd", { "stepIndex": 1, "trialData": { "trialNo": 1, "maxTrials": 50, "reward": 0.95, "elapsed": 5.2, "hyperParams": {"n_estimators": "100", "max_depth": "10"} } }) ``` -------------------------------- ### NDJSON Event File Format Examples Source: https://context7.com/datacanvasio/hyperboard/llms.txt Illustrates the newline-delimited JSON (NDJSON) format for experiment events, including examples for experiment start, step progression, trial results, early stopping, and experiment completion. ```json // Event file format: one JSON object per line // experimentStart - Initialize experiment with configuration {"type": "experimentStart", "payload": {"task": "regression", "datasets": [{"kind": "Train", "task": "regression", "shape": [404, 16], "memory": 51840}], "steps": [{"index": 0, "name": "data_clean", "type": "DataCleanStep", "status": "wait", "configuration": {"cv": true}}], "evaluation_metric": null}} // stepStart - Mark step as running {"type": "stepStart", "payload": {"index": 0, "status": "process", "start_datetime": 1645519525.487}} // stepEnd - Mark step complete with results {"type": "stepEnd", "payload": {"index": 0, "name": "data_clean", "type": "DataCleanStep", "status": "finish", "extension": {"features": {"inputs": ["col1", "col2"], "outputs": ["col1"], "reduced": ["col2"]}}, "end_datetime": 1645519525.602}} // trialEnd - Record hyperparameter trial results {"type": "trialEnd", "payload": {"stepIndex": 2, "trialData": {"trialNo": 1, "maxTrials": 10, "hyperParams": {"learning_rate": "0.1", "max_depth": "5"}, "models": [{"fold": 0, "importances": [{"name": "feature1", "imp": 0.65}]}], "reward": 3.21, "elapsed": 2.24, "is_cv": true, "metricName": "rmse"}}} // earlyStopped - Early stopping triggered {"type": "earlyStopped", "payload": {"stepIndex": 2, "data": {"reason": "max_no_improved_trials", "best_reward": 3.21}}} // experimentEnd - Experiment complete {"type": "experimentEnd", "payload": {}} ``` -------------------------------- ### Install hboard_widget package Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard-widget/js/README.md Use this command to install the required widget package for Hyperboard in a Node.js environment. ```bash npm install --save hboard_widget ``` -------------------------------- ### Build HyperBoard from source Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard/README.md Commands to build the frontend assets and install the Python package. ```shell cd hboard/js # build frontend yarn yarn build rm -rf ../hboard/assets/ cp -r build/ ../hboard/assets/ # install cd .. python setup.py install ``` -------------------------------- ### Visualize experiment data Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard/README.md Start the web server and load a specific experiment JSON file. ```shell cd HyperBoard hboard server --event-file=hboard/hboard/tests/events_example.json ``` -------------------------------- ### Create and Start WebApp Source: https://context7.com/datacanvasio/hyperboard/llms.txt Create a Tornado-based HTTP server to monitor experiment event files and serve a real-time dashboard. The server automatically handles port conflicts. For non-blocking execution, use WebAppRunner in a separate thread. ```python from hboard.app import WebApp, WebAppRunner # Create a web application to monitor an experiment event file # Parameters: # event_file: path to the experiment events JSON file # server_port: HTTP server port (default: 8888) # port_retries: number of alternate ports to try if port is in use (default: 50) webapp = WebApp( event_file="./events/experiment_events.json", server_port=8888, port_retries=50 ) # Start the server (blocking call) webapp.start() # Server logs: "experiment visualization http server is running at: http://0.0.0.0:8888" # For non-blocking execution, use WebAppRunner in a separate thread webapp = WebApp(event_file="./events/experiment_events.json", server_port=8888) runner = WebAppRunner(webapp) runner.start() # Starts in background thread # Access dashboard at http://localhost:8888 # Stop the server when done runner.stop() ``` -------------------------------- ### Build hboard-widget from source Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard-widget/README.md Install the hboard-widget in editable mode and enable Jupyter extensions after cloning the source code. ```bash cd ./hboard-widget pip install -e . jupyter nbextension install --py --symlink --overwrite --sys-prefix hboard_widget jupyter nbextension enable --py --sys-prefix hboard_widget jupyter labextension develop --overwrite hboard_widget ``` -------------------------------- ### WebVisExperimentCallback Integration Source: https://context7.com/datacanvasio/hyperboard/llms.txt Integrate `WebVisExperimentCallback` with Hypernets experiments to automatically start a web server and stream events in real-time. It handles event file creation, web server lifecycle, and event streaming. ```python from hboard.callbacks import WebVisExperimentCallback from hypernets.experiment import make_experiment from hypernets.examples.plain_model import PlainModel, PlainSearchSpace from hypernets.tabular.datasets import dsutils from sklearn.model_selection import train_test_split # Load dataset df = dsutils.load_boston() df_train, df_eval = train_test_split(df, test_size=0.2) # Create the visualization callback # Parameters: # event_file_dir: directory to store event log files (default: "./events") # server_port: HTTP server port (default: 8888) ``` -------------------------------- ### Install hboard-widget with conda Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard-widget/README.md Use this command to install the hboard-widget package using conda from the conda-forge channel. ```shell conda install -c conda-forge hboard-widget ``` -------------------------------- ### Events API Endpoint Source: https://context7.com/datacanvasio/hyperboard/llms.txt Fetch experiment events from the web server using the REST API. The frontend polls this endpoint for real-time dashboard updates. You can fetch all events or events starting from a specific index. ```bash # Fetch all events from the beginning curl http://localhost:8888/api/events # Response format: # {"code": 0, "data": {"events": [ # {"type": "experimentStart", "payload": {...}}, # {"type": "stepStart", "payload": {...}}, # {"type": "trialEnd", "payload": {...}}, # ... # ]}} # Fetch events starting from a specific index (for incremental updates) curl "http://localhost:8888/api/events?begin=5" # Response contains only events from index 5 onwards # {"code": 0, "data": {"events": [{"type": "stepEnd", ...}, ...]}} ``` -------------------------------- ### Configure and Create Experiment Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard-widget/hboard_widget/examples/01.visual_experiment.ipynb Loads the dataset, splits it into training and evaluation sets, and initializes the experiment with a specific search space. ```python df = dsutils.load_boston() df_train, df_eval = train_test_split(df, test_size=0.2) search_space = PlainSearchSpace(enable_lr=False, enable_nn=False, enable_dt=False, enable_dtr=True) experiment = make_experiment(PlainModel, df_train, target='target', search_space=search_space, callbacks=[], search_callbacks=[]) ``` -------------------------------- ### Initialize Hypernets Experiment Environment Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard-widget/hboard_widget/examples/01.visual_experiment.ipynb Imports necessary libraries and modules for setting up a Hypernets experiment. ```python import warnings warnings.filterwarnings('ignore') from sklearn.model_selection import train_test_split from hypernets.examples.plain_model import PlainModel, PlainSearchSpace from hypernets.experiment import make_experiment from hypernets.tabular.datasets import dsutils ``` -------------------------------- ### Create event file Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard/README.md Initialize an empty file to store experiment state events. ```shell touch events.txt ``` -------------------------------- ### Display Experiment Process Widget Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard-widget/hboard_widget/examples/01.visual_experiment.ipynb Runs the experiment and displays the ExperimentProcessWidget to monitor the training progress. ```python from hboard_widget import ExperimentProcessWidget estimator = experiment.run(max_trials=3) widget = ExperimentProcessWidget(experiment) display(widget) ``` -------------------------------- ### Display Experiment Summary Widget Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard-widget/hboard_widget/examples/01.visual_experiment.ipynb Initializes and displays the ExperimentSummary widget for an existing experiment object. ```python from hboard_widget import ExperimentSummary experiment_summary_widget = ExperimentSummary(experiment) display(experiment_summary_widget) ``` -------------------------------- ### Configure WebVisExperimentCallback for Experiment Monitoring Source: https://context7.com/datacanvasio/hyperboard/llms.txt Use WebVisExperimentCallback to enable a web-based dashboard for experiment tracking. The dashboard is accessible at the specified server port during execution. ```python web_callback = WebVisExperimentCallback( event_file_dir="./experiment_logs", server_port=8888, exit_web_server_on_finish=False ) # Create search space search_space = PlainSearchSpace( enable_lr=True, enable_nn=False, enable_dt=True, enable_dtr=True ) # Create experiment with visualization callback experiment = make_experiment( PlainModel, df_train, target='target', search_space=search_space, callbacks=[web_callback], # Add visualization callback search_callbacks=[] ) # Run experiment - dashboard automatically available at http://localhost:8888 estimator = experiment.run(max_trials=20) ``` -------------------------------- ### Display hboard help Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard/README.md View command-line usage information for the hboard tool. ```shell hboard -h ``` -------------------------------- ### Display Dataset Summary Widget Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard-widget/hboard_widget/examples/01.visual_experiment.ipynb Initializes and displays the DatasetSummary widget to visualize dataset information. ```python from hboard_widget import DatasetSummary dataset_summary_widget = DatasetSummary(experiment) display(dataset_summary_widget) ``` -------------------------------- ### Display Experiment Configuration with ExperimentSummary Source: https://context7.com/datacanvasio/hyperboard/llms.txt The ExperimentSummary widget provides an inline view of experiment metadata and configuration within a Jupyter notebook. ```python import warnings warnings.filterwarnings('ignore') from sklearn.model_selection import train_test_split from hypernets.examples.plain_model import PlainModel, PlainSearchSpace from hypernets.experiment import make_experiment from hypernets.tabular.datasets import dsutils from hboard_widget import ExperimentSummary # Load and prepare data df = dsutils.load_boston() df_train, df_eval = train_test_split(df, test_size=0.2) # Create search space search_space = PlainSearchSpace( enable_lr=False, enable_nn=False, enable_dt=False, enable_dtr=True ) # Create experiment experiment = make_experiment( PlainModel, df_train, target='target', search_space=search_space, callbacks=[], search_callbacks=[] ) # Display experiment configuration widget # Shows: task type, dataset shape, memory usage, pipeline steps, early stopping config experiment_summary_widget = ExperimentSummary(experiment) display(experiment_summary_widget) ``` -------------------------------- ### Visualize dataset information with DatasetSummary widget Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard-widget/README.md Instantiate and display the DatasetSummary widget to visualize dataset characteristics derived from the experiment's data. ```python from hboard_widget import DatasetSummary dataset_summary_widget = DatasetSummary(experiment.get_data_character()) display(dataset_summary_widget) ``` -------------------------------- ### Monitor Real-time Progress with ExperimentProcessWidget Source: https://context7.com/datacanvasio/hyperboard/llms.txt The ExperimentProcessWidget visualizes live experiment execution, including trial results and performance metrics. ```python import warnings warnings.filterwarnings('ignore') from sklearn.model_selection import train_test_split from hypernets.examples.plain_model import PlainModel, PlainSearchSpace from hypernets.experiment import make_experiment from hypernets.tabular.datasets import dsutils from hboard_widget import ExperimentProcessWidget # Load and prepare data df = dsutils.load_boston() df_train, df_eval = train_test_split(df, test_size=0.2) # Create search space with multiple model types search_space = PlainSearchSpace( enable_lr=True, enable_nn=False, enable_dt=True, enable_dtr=True ) # Create experiment experiment = make_experiment( PlainModel, df_train, target='target', search_space=search_space, callbacks=[], search_callbacks=[] ) # Run experiment estimator = experiment.run(max_trials=10) # Display experiment process widget after completion ``` -------------------------------- ### Automatic Jupyter Visualization with NotebookExperimentCallback Source: https://context7.com/datacanvasio/hyperboard/llms.txt Integrates `NotebookExperimentCallback` into an experiment to automatically create and update visualization widgets in Jupyter notebooks during execution. Loads data, defines a search space, and runs the experiment. ```python import warnings warnings.filterwarnings('ignore') from sklearn.model_selection import train_test_split from hypernets.examples.plain_model import PlainModel, PlainSearchSpace from hypernets.experiment import make_experiment from hypernets.tabular.datasets import dsutils from hboard_widget.callbacks import NotebookExperimentCallback # Load and prepare data df = dsutils.load_boston() df_train, df_eval = train_test_split(df, test_size=0.2) # Create the notebook visualization callback notebook_callback = NotebookExperimentCallback() # Create search space search_space = PlainSearchSpace( enable_lr=True, enable_dt=True, enable_dtr=True ) # Create experiment with notebook callback experiment = make_experiment( PlainModel, df_train, target='target', search_space=search_space, callbacks=[notebook_callback], # Add notebook visualization callback search_callbacks=[] ) # Run experiment - widget automatically created and updated in real-time estimator = experiment.run(max_trials=10) ``` -------------------------------- ### Clone Project Repository Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard-frontend/README.md Clones the HyperBoard project repository from GitHub. This command should be run in your terminal. ```bash git clone https://github.com/DataCanvasIO/HyperBoard.git ``` -------------------------------- ### Build JS for development Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard-widget/README.md Rebuild the JavaScript frontend when making code changes in the js directory. ```bash cd ./hboard-widget/js yarn run build ``` -------------------------------- ### Display Experiment Widget Source: https://context7.com/datacanvasio/hyperboard/llms.txt Instantiates and displays an experiment widget for visualizing experiment progress and results. ```python widget = ExperimentProcessWidget(experiment) display(widget) ``` -------------------------------- ### Append experiment event Source: https://github.com/datacanvasio/hyperboard/blob/main/hboard/README.md Add a JSON-formatted experiment event to the event file. ```shell echo '{"type": "experimentStart", "payload": {"task": "binary", "datasets": [{"kind": "Train", "task": "binary", "shape": [904, 17], "memory": 123072}], "steps": [{"index": 0, "name": "data_clean", "type": "DataCleanStep", "status": "wait", "configuration": {"cv": true, "data_cleaner_args": {"nan_chars": null, "correct_object_dtype": true, "drop_constant_columns": true, "drop_label_nan_rows": true, "drop_idness_columns": true, "drop_columns": null, "reserve_columns": null, "drop_duplicated_columns": false, "reduce_mem_usage": false, "int_convert_to": "float"}, "name": "data_clean", "train_test_split_strategy": null}, "extension": {}, "start_datetime": null, "end_datetime": null}, {"index": 1, "name": "space_searching", "type": "SpaceSearchStep", "status": "wait", "configuration": {"cv": true, "name": "space_searching", "num_folds": 3, "earlyStopping": {"enable": true, "exceptedReward": null, "maxNoImprovedTrials": 10, "timeLimit": 3600, "mode": "max"}}, "extension": {}, "start_datetime": null, "end_datetime": null}, {"index": 2, "name": "final_ensemble", "type": "EnsembleStep", "status": "wait", "configuration": {"ensemble_size": 20, "name": "final_ensemble", "scorer": "make_scorer(accuracy_score)"}, "extension": {}, "start_datetime": null, "end_datetime": null}], "evaluation_metric": null, "confusion_matrix": null, "resource_usage": null, "prediction_stats": null}}' >> events.txt ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.