Developing Third-party Algorithm
The example project is provided together with X-BD installation package, and it contains the following items.
Item | Description |
---|---|
backend | Contains exercise.py (algorithm training) and runtime.py (runtime algorithm) files. You can directly edit them to develop your own algorithm. |
frontend | Contains frontend developing files of the algorithm. |
manifest.json | Records algorithm name, version number and configuration. |
Editing exercise.py
Input Parameter
- dataSources: Can contain multiple data sets and use
ds = dataSources[0]
to get the first data set.
Parameter | Description |
---|---|
data | Each array is the data of the field. |
struct | Data structure. |
role | Field role. Options are 2 (dependent), 1 (independent), 0 (none). |
customName | Field name. |
name | Encrypted field name. |
- config: Design the configuration which you can set during modeling on the right side.
Output Parameter
dataSources: Data structure is similar to input data sources.
model: Model information that can be shared in runtime. It must be output in the type of string.
insight: Data displayed on the front end. It can be hidden when there is no specific requirements.
Process Example
Editing runtime.py
Input Parameter
dataSources/config: Same as the content in exercise.py file.
model: Model information (string).
Output Parameter
Data structure is similar to input data sources.
Process Example
Editing manifest.json
Parameter | Description |
---|---|
algorithmName |
|
alias |
|
description | Cannot exceed 500 in length. |
version |
|
versionFeatures | Features of the current version. Cannot exceed 500 in length. |
algorithmCategory |
|
defaultConfig |
Uploading Algorithm
- Pack the 3 files, including exercise.py, runtime.py and manifest.json into a zip file.
- Log in to supOS, and then select Data Intelligence > Data Science > Bigdata Analysis > Extend algorithm.
- Click Import, select the package from local, and then click OK.