diff --git a/visualpython/js/m_ml/Pipeline.js b/visualpython/js/m_ml/Pipeline.js index 1c2e2bcc..53a3e465 100644 --- a/visualpython/js/m_ml/Pipeline.js +++ b/visualpython/js/m_ml/Pipeline.js @@ -83,7 +83,7 @@ define([ modelStep: 1, step: [ { name: 'ml_dataSplit', label: 'Data Split', useApp: true }, - { name: 'ml_regression', label: 'Regressor', useApp: true }, + { name: 'ml_regression', label: 'Regressor', useApp: true, child: ['pp_fit', 'pp_predict'] }, { name: 'pp_fit', label: 'Fit' }, { name: 'pp_predict', label: 'Predict' }, { name: 'ml_evaluation', label: 'Evaluation', useApp: true, state: { modelType: 'rgs' } }, @@ -94,7 +94,7 @@ define([ modelStep: 1, step: [ { name: 'ml_dataSplit', label: 'Data Split', useApp: true }, - { name: 'ml_classification', label: 'Classifier', useApp: true }, + { name: 'ml_classification', label: 'Classifier', useApp: true, child: ['pp_fit', 'pp_predict'] }, { name: 'pp_fit', label: 'Fit' }, { name: 'pp_predict', label: 'Predict' }, { name: 'ml_evaluation', label: 'Evaluation', useApp: true, state: { modelType: 'clf' } }, @@ -104,7 +104,7 @@ define([ label: 'Clustering', modelStep: 0, step: [ - { name: 'ml_clustering', label: 'Clustering', useApp: true }, + { name: 'ml_clustering', label: 'Clustering', useApp: true, child: ['pp_fit', 'pp_predict', 'pp_transform'] }, { name: 'pp_fit', label: 'Fit' }, { name: 'pp_predict', label: 'Predict' }, { name: 'pp_transform', label: 'Transform' }, @@ -115,7 +115,7 @@ define([ label: 'Dimension Reduction', modelStep: 0, step: [ - { name: 'ml_dimensionReduction', label: 'Dimension Reduction', useApp: true }, + { name: 'ml_dimensionReduction', label: 'Dimension Reduction', useApp: true, child: ['pp_fit', 'pp_transform'] }, { name: 'pp_fit', label: 'Fit' }, { name: 'pp_transform', label: 'Transform' } ] @@ -125,7 +125,7 @@ define([ modelStep: 1, step: [ { name: 'ml_dataSplit', label: 'Data Split', useApp: true }, - { name: 'ml_gridSearch', label: 'GridSearch', useApp: true }, + { name: 'ml_gridSearch', label: 'GridSearch', useApp: true, child: ['pp_fit', 'pp_predict'] }, { name: 'pp_fit', label: 'Fit' }, { name: 'pp_predict', label: 'Predict' }, { name: 'ml_evaluation', label: 'Evaluation', useApp: true }, @@ -134,7 +134,22 @@ define([ } // menu libraries for ml - let libObj = JSON.parse(librariesJson); + let libObj = {}; + if (vpConfig.extensionType === 'lab' || vpConfig.extensionType === 'lite') { + libObj = librariesJson; + + this.MlAppComponent = {}; + this.MlAppComponent['ml_dataSplit'] = require('./dataSplit'); + this.MlAppComponent['ml_dataPrep'] = require('./DataPrep'); + this.MlAppComponent['ml_regression'] = require('./Regression'); + this.MlAppComponent['ml_classification'] = require('./Classification'); + this.MlAppComponent['ml_clustering'] = require('./Clustering'); + this.MlAppComponent['ml_dimensionReduction'] = require('./DimensionReduction'); + this.MlAppComponent['ml_gridSearch'] = require('./GridSearch'); + this.MlAppComponent['ml_evaluation'] = require('./evaluation'); + } else { + libObj = JSON.parse(librariesJson); + } this.mlAppList = libObj.library.item.filter(x => x.id === 'pkg_ml')[0].item; this.modelConfig = ML_LIBRARIES; @@ -268,7 +283,7 @@ define([ let appFileList = []; // load pipeline items tplObj.step.forEach((stepObj, idx) => { - let { name, label, useApp=false, state={} } = stepObj; + let { name, label, useApp=false, child=[], state={} } = stepObj; ppTag.appendFormatLine(`