[Paper Review] Code Generation for Machine Learning using Model-Driven Engineering and SysML
This paper presents a model-driven approach that automatically generates executable machine learning code from SysML models using stereotype-based configuration and template mapping. By decoupling code generation logic from transformation logic via JSON configuration, the method enables flexible, maintainable, and extensible code generation without modifying the core generator, demonstrating feasibility in a weather forecasting case study.
Data-driven engineering refers to systematic data collection and processing using machine learning to improve engineering systems. Currently, the implementation of data-driven engineering relies on fundamental data science and software engineering skills. At the same time, model-based engineering is gaining relevance for the engineering of complex systems. In previous work, a model-based engineering approach integrating the formalization of machine learning tasks using the general-purpose modeling language SysML is presented. However, formalized machine learning tasks still require the implementation in a specialized programming languages like Python. Therefore, this work aims to facilitate the implementation of data-driven engineering in practice by extending the previous work of formalizing machine learning tasks by integrating model transformation to generate executable code. The method focuses on the modifiability and maintainability of the model transformation so that extensions and changes to the code generation can be integrated without requiring modifications to the code generator. The presented method is evaluated for feasibility in a case study to predict weather forecasts. Based thereon, quality attributes of model transformations are assessed and discussed. Results demonstrate the flexibility and the simplicity of the method reducing efforts for implementation. Further, the work builds a theoretical basis for standardizing data-driven engineering implementation in practice.
Motivation & Objective
- To bridge the gap between formalized machine learning tasks in SysML models and their implementation in programming languages like Python.
- To enable model-driven engineering in data-driven engineering by automating code generation from SysML models.
- To improve maintainability and extensibility of code generation without modifying the transformation engine.
- To establish a foundation for standardizing machine learning implementation in industrial systems engineering.
Proposed method
- The method uses SysML with custom stereotypes to semantically annotate machine learning components such as features, models, and data sources.
- A JSON-based mapping configuration links SysML stereotypes to code templates, enabling dynamic code generation.
- Generic code templates are populated with stereotype attributes using a lightweight, extensible transformation engine.
- The transformation engine is decoupled from code generation logic, allowing updates via configuration and new templates without changing the core logic.
- The approach supports modularity by separating model transformation logic from code generation templates and configuration.
- The implementation uses Jupyter Notebooks to execute and validate generated code, with unique block markers for traceability.
Experimental results
Research questions
- RQ1RQ1: Which model properties can be used in the context of model-driven engineering to automatically derive a machine learning model?
- RQ2RQ2: What means of software engineering allows to extend and maintain the machine learning code derivation without changes in the model transformation?
- RQ3RQ3: How can model transformations be assessed for quality attributes such as modularity, completeness, and conciseness in the context of machine learning code generation?
Key findings
- The method successfully generates executable machine learning code from SysML models using stereotype-based configuration and template mapping.
- The separation of configuration and transformation logic enables extensibility without modifying the code generator, supporting maintainability.
- The approach demonstrates feasibility in a real-world weather forecasting case study using an open dataset.
- The generated code is validated in Jupyter Notebooks, confirming correctness and traceability through unique block markers.
- The method supports flexible target language selection by defining new templates without altering the transformation engine.
- Quality attributes such as modularity, completeness, and conciseness are achieved through configuration-driven design and template reuse.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.