Skip to main content
Version: 4.0

Developing Third-party Algorithm

The example project is provided together with X-BD installation package, and it contains the following items.

ItemDescription
backendContains exercise.py (algorithm training) and runtime.py (runtime algorithm) files. You can directly edit them to develop your own algorithm.
frontendContains frontend developing files of the algorithm.
manifest.jsonRecords 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. data set
ParameterDescription
dataEach array is the data of the field.
structData structure.
roleField role. Options are 2 (dependent), 1 (independent), 0 (none).
customNameField name.
nameEncrypted field name.

get data

  • 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

ParameterDescription
algorithmName
  • Must be unique in the platform.
  • Cannot end with a number.
  • Cannot exceed 50 in length.
  • Update with the same name.
alias
  • Cannot contain Chinese characters or /. Combinations of letters, numbers and underscores are recommended.
  • Cannot duplicate.
descriptionCannot exceed 500 in length.
version
  • Meet the regular expression "\d+(\.\d+){2}". For example, v0.0.1.
  • Must be unique.
  • Update by the ascending order of version number.
versionFeaturesFeatures of the current version. Cannot exceed 500 in length.
algorithmCategory
  • DataInOut: Level 1.
  • DataPreprocessing: Level 1.
  • FeatureEngineering: Level 1.
  • MachineLearning: Level 1.
  • Regression: Level 2.
  • Classification: Level 2.
  • Optimization: Level 2.
  • Cluster: Level 2.
defaultConfig

Uploading Algorithm

  1. Pack the 3 files, including exercise.py, runtime.py and manifest.json into a zip file.
  2. Log in to supOS, and then select Data Intelligence > Data Science > Bigdata Analysis > Extend algorithm.
  3. Click Import, select the package from local, and then click OK.