diff --git a/js/Application.js b/js/Application.js index 66decffb6..e6a856a5f 100644 --- a/js/Application.js +++ b/js/Application.js @@ -51,8 +51,6 @@ define( || sharedState.CohortDefinition.dirtyFlag().isDirty() || sharedState.IRAnalysis.dirtyFlag().isDirty() || sharedState.CohortPathways.dirtyFlag().isDirty() - || sharedState.estimationAnalysis.dirtyFlag().isDirty() - || sharedState.predictionAnalysis.dirtyFlag().isDirty() || sharedState.CohortCharacterization.dirtyFlag().isDirty() ); }); @@ -118,45 +116,26 @@ define( httpService.setUnauthorizedHandler(() => authApi.resetAuthParams()); httpService.setUserTokenGetter(() => authApi.getAuthorizationHeader()); + const exp = authApi.tokenExpirationDate(); + const now = new Date(); + + if (!exp || exp <= now) { authApi.resetAuthParams(); } else { await authApi.refreshToken(); } + try{ + await authApi.loadUserInfo(); await i18nService.getAvailableLocales(); } catch (e) { reject(e.message); } - if (config.userAuthenticationEnabled) { - try { - // Routes to welcome are part of auth flow, loadUserInfo in this case is unnecessary and fails. - // More importantly it can trigger an infinite loop when skipLoginEnabled is enabled. - if (!window.location.href.includes("/welcome/")) { - await authApi.loadUserInfo(); - } - } catch (e) { - reject(e.message); - } - - } authApi.isAuthenticated.subscribe(executionService.checkExecutionEngineStatus); this.attachGlobalEventListeners(); await executionService.checkExecutionEngineStatus(authApi.isAuthenticated()); - // Add user interaction listener that keeps refreshing the token as long - // as the user is active (either moving mouse, navigating with keyboard and/or typing): - var userInteractionCount = 0; - console.log("Adding user interaction listeners..."); + // Add user interaction listeners to reset idle timeout + // (throttled inside resetIdleTimeout to at most once per minute) ["mouseover", "keydown", "focusin"].forEach(eventType => { - window.addEventListener(eventType, (event) => { - userInteractionCount++; - if (userInteractionCount % 30 == 0) { - console.log(">>> Checking user token...."); - userInteractionCount = 0; - // Refresh the Atlas token if it is close to expiring: - if (authApi.isAuthenticated() && this.timeToExpire() < config.refreshTokenThreshold) { - console.log(">>> Token close to expiring. Refreshing user token...."); - authApi.refreshToken(); - } - } - }); + window.addEventListener(eventType, () => authApi.resetIdleTimeout()); }); resolve(); @@ -198,39 +177,15 @@ define( initServiceInformation() { console.info('Initializing service information'); return new Promise((resolve, reject) => { - const serviceCacheKey = 'ATLAS|' + config.api.url; - const cachedService = lscache.get(serviceCacheKey); - - if (cachedService && cachedService.sources) { - console.info('cached service'); - config.api.sources = cachedService; - sourceApi.setSharedStateSources(cachedService.sources); - resolve(); - } else { - sharedState.sources([]); - - if (config.userAuthenticationEnabled && !authApi.isAuthenticated()) { - this.authSubscription = authApi.isAuthenticated.subscribe(async (isAuthed) => { - if (isAuthed) { - sharedState.appInitializationStatus(await sourceApi.initSourcesConfig()); - this.authSubscription.dispose(); - console.info('Re-initialized service information'); - } - }); - sharedState.appInitializationStatus(constants.applicationStatuses.running); + sourceApi.initSourcesConfig() + .then(function (appStatus) { + sharedState.appInitializationStatus(appStatus); + console.info('Init sources from server'); resolve(); - return; - } else { - sourceApi.initSourcesConfig() - .then(function (appStatus) { - sharedState.appInitializationStatus(appStatus); - console.info('Init sources from server'); - resolve(); - }); - } - } + }); }); } + checkOAuthError() { let hash = window.location.hash; if (hash && hash.includes("oauth_error_email")) { diff --git a/js/components/ac-access-denied.html b/js/components/ac-access-denied.html index 74c919a40..75b77c744 100644 --- a/js/components/ac-access-denied.html +++ b/js/components/ac-access-denied.html @@ -1,8 +1,6 @@ -
|
-
-
+
+ |
@@ -115,17 +115,17 @@
-
+
-
+
-
-
+
-
+
+
diff --git a/js/pages/configuration/users-import/users-import.js b/js/pages/configuration/users-import/users-import.js
index a1f1a4a24..f02f9dd5e 100644
--- a/js/pages/configuration/users-import/users-import.js
+++ b/js/pages/configuration/users-import/users-import.js
@@ -56,7 +56,7 @@ define(['knockout',
this.loading = ko.observable();
this.providers = ko.observable();
this.isAuthenticated = authApi.isAuthenticated;
- this.canImport = ko.pureComputed(() => this.isAuthenticated() && authApi.isPermittedImportUsers());
+ this.canImport = ko.pureComputed(() => authApi.isPermittedImportUsers());
this.hasMultipleProviders = ko.pureComputed(() => this.providers() && !!this.providers().ldapUrl && !!this.providers().adUrl);
this.hasMultipleProviders.subscribe((newValue) => {
this.wizardStep(newValue ? this.WIZARD_STEPS.PROVIDERS : this.WIZARD_STEPS.MAPPING);
@@ -199,7 +199,7 @@ define(['knockout',
roleGroups: this.rolesMapping().map(m => ({
role: {
id: m.id,
- role: m.role,
+ name: m.name,
},
groups: m.groups,
})),
@@ -244,8 +244,8 @@ define(['knockout',
this.selectedUser(data);
this.selectedRoles(this.roles().filter(role => !role.defaultImported).map(r => ({
...r,
- selected: ko.observable(data.roles().find(role => role.role === r.role)),
- })));
+ selected: ko.observable(data.roles().find(role => role.name === r.name)),
+ })));
this.isAtlasRolesDialog(true);
}
@@ -254,7 +254,7 @@ define(['knockout',
}
renderRoles(data, type, row) {
- const label = (row && row.roles && row.roles().length > 0) ? row.roles().map(role => role.role).sort().join(", ") : 'No roles';
+ const label = (row && row.roles && row.roles().length > 0) ? row.roles().map(role => role.name).sort().join(", ") : 'No roles';
return '' + label + '';
}
@@ -301,9 +301,9 @@ define(['knockout',
setRoles() {
if (this.selectedUser()) {
this.selectedUser().roles(this.selectedRoles().filter(r => r.selected()).map(r => ({
- role: r.role,
+ role: r.name,
id: r.id,
- })));
+ })));
this.usersList.valueHasMutated();
}
this.closeRolesModal();
diff --git a/js/pages/data-sources/data-sources.js b/js/pages/data-sources/data-sources.js
index 95206ccc4..325292a04 100644
--- a/js/pages/data-sources/data-sources.js
+++ b/js/pages/data-sources/data-sources.js
@@ -119,7 +119,7 @@ define([
this.isAuthenticated = authApi.isAuthenticated;
this.canViewCdmResults = ko.pureComputed(() => {
- return (config.userAuthenticationEnabled && this.isAuthenticated() && authApi.isPermittedViewCdmResults()) || !config.userAuthenticationEnabled;
+ return authApi.isPermittedViewCdmResults();
});
this.showSelectionArea = params.showSelectionArea == undefined ? true : params.showSelectionArea;
diff --git a/js/pages/estimation/PermissionService.js b/js/pages/estimation/PermissionService.js
deleted file mode 100644
index 0d365fbd4..000000000
--- a/js/pages/estimation/PermissionService.js
+++ /dev/null
@@ -1,56 +0,0 @@
-define([
- 'services/AuthAPI',
-], function (
- AuthAPI,
-) {
- return class PermissionService {
-
- static isPermittedCreate() {
- return AuthAPI.isPermitted(`estimation:post`);
- }
-
- static isPermittedList() {
- return AuthAPI.isPermitted(`estimation:get`);
- }
-
- static isPermittedLoad(id) {
- return AuthAPI.isPermitted(`estimation:${id}:get`);
- }
-
- static isPermittedUpdate(id) {
- return AuthAPI.isPermitted(`estimation:${id}:put`);
- }
-
- static isPermittedDelete(id) {
- return AuthAPI.isPermitted(`estimation:${id}:delete`);
- }
-
- static isPermittedCopy(id) {
- return AuthAPI.isPermitted(`estimation:${id}:copy:get`);
- }
-
- static isPermittedDownload(id) {
- return AuthAPI.isPermitted(`estimation:${id}:download:get`);
- }
-
- static isPermittedExport(id) {
- return AuthAPI.isPermitted(`estimation:${id}:export:get`);
- }
-
- static isPermittedGenerate(id, sourceKey) {
- return AuthAPI.isPermitted(`estimation:${id}:generation:*:post`) && AuthAPI.isPermitted(`source:${sourceKey}:access`);
- }
-
- static isPermittedListGenerations(id) {
- return AuthAPI.isPermitted(`estimation:${id}:generation:get`);
- }
-
- static isPermittedResults(id) {
- return AuthAPI.isPermitted(`estimation:generation:${id}:result:get`);
- }
-
- static isPermittedImport() {
- return AuthAPI.isPermitted(`estimation:import:post`);
- }
- }
-});
diff --git a/js/pages/estimation/cca-manager.html b/js/pages/estimation/cca-manager.html
deleted file mode 100644
index 05b1d6a02..000000000
--- a/js/pages/estimation/cca-manager.html
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/js/pages/estimation/components/cca-specification-view-edit.js b/js/pages/estimation/components/cca-specification-view-edit.js
deleted file mode 100644
index 9776ee694..000000000
--- a/js/pages/estimation/components/cca-specification-view-edit.js
+++ /dev/null
@@ -1,153 +0,0 @@
-define([
- 'knockout',
- 'text!./cca-specification-view-edit.html',
- 'utils/AutoBind',
- 'components/Component',
- 'utils/CommonUtils',
- '../inputTypes/ComparativeCohortAnalysis/CohortMethodAnalysis',
- '../inputTypes/Comparison',
- '../const',
- './editors/comparison-editor',
- './editors/cohort-method-analysis-editor',
- './editors/negative-control-outcome-cohort-settings-editor',
- './editors/positive-control-sythesis-settings-editor',
- 'less!./cca-specification-view-edit.less',
-], function (
- ko,
- view,
- AutoBind,
- Component,
- commonUtils,
- CohortMethodAnalysis,
- Comparison,
- constants,
-) {
- class ComparativeCohortAnalysisSpecificationViewEdit extends AutoBind(Component) {
- constructor(params) {
- super(params);
- this.specificationPillMode = ko.observable('all');
- this.comparisons = params.comparisons;
- this.cohortMethodAnalysisList = params.estimationAnalysis().estimationAnalysisSettings.analysisSpecification.cohortMethodAnalysisList;
- this.subscriptions = params.subscriptions;
- this.editorComponentName = ko.observable(null);
- this.editorComponentParams = ko.observable({});
- this.editorDescription = ko.observable();
- this.editorHeading = ko.observable();
- this.editorArray = ko.observableArray();
- this.estimationAnalysis = params.estimationAnalysis;
- this.options = constants.options;
- this.isEditPermitted = params.isEditPermitted;
- this.cca = constants.getCca(this.isEditPermitted())[0];
- this.loading = params.loading;
- this.managerMode = ko.observable('summary');
- this.defaultCovariateSettings = params.defaultCovariateSettings;
- }
-
- comparisonTableRowClickHandler(data, obj, tableRow, rowIndex) {
- if (
- obj.target.className.indexOf("btn-remove") >= 0 ||
- obj.target.className.indexOf("fa-times") >= 0
- ) {
- this.deleteFromTable(this.comparisons, obj, rowIndex);
- } else if (
- obj.target.className.indexOf("btn-copy") >= 0 ||
- obj.target.className.indexOf("fa-clone") >= 0
- ) {
- this.copyComparison(obj, rowIndex);
- } else {
- this.editComparison(data);
- }
- }
-
- analysisSettingsTableRowClickHandler(data, obj, tableRow, rowIndex) {
- if (
- obj.target.className.indexOf("btn-remove") >= 0 ||
- obj.target.className.indexOf("fa-times") >= 0
- ) {
- this.deleteFromTable(this.cohortMethodAnalysisList, obj, rowIndex);
- } else if (
- obj.target.className.indexOf("btn-copy") >= 0 ||
- obj.target.parentElement.className.indexOf("btn-copy") >= 0
- ) {
- this.copyAnalysisSettings(obj, rowIndex);
- } else {
- this.editAnalysis(data);
- }
- }
-
- addAnalysis() {
- this.cohortMethodAnalysisList.push(
- new CohortMethodAnalysis({description: ko.i18n('ple.spec.newAnalysis', 'New analysis')() + ' ' + (this.cohortMethodAnalysisList().length + 1)}, this.defaultCovariateSettings())
- );
- // Get the index
- const index = this.cohortMethodAnalysisList().length - 1;
- this.editAnalysis(this.cohortMethodAnalysisList()[index]);
- }
-
- editAnalysis(analysis) {
- this.editorArray = this.cohortMethodAnalysisList;
- this.editorHeading(ko.i18n('ple.spec.analysisSettings', 'Analysis Settings'));
- this.editorDescription(ko.i18n('ple.spec.analysisSettingsDescription', 'Add or update the analysis settings'));
- this.editorComponentName('cohort-method-analysis-editor');
- this.editorComponentParams({
- analysis: analysis,
- subscriptions: this.subscriptions,
- isEditPermitted: this.isEditPermitted
- });
- this.managerMode('editor')
- }
-
- copyAnalysisSettings(obj, index) {
- const newAnalysis = ko.toJS(this.cohortMethodAnalysisList()[index]);
- newAnalysis.analysisId = this.cohortMethodAnalysisList().length + 1;
- newAnalysis.description = ko.i18nformat('common.copyOf', 'Copy of <%=name%>', {name: newAnalysis.description})();
- this.cohortMethodAnalysisList.push(new CohortMethodAnalysis(newAnalysis));
- }
-
- addComparison() {
- this.comparisons.push(
- new Comparison()
- );
- // Get the index
- var index = this.comparisons().length - 1;
- this.editComparison(this.comparisons()[index]);
- }
-
- editComparison(comparison) {
- this.editorArray = this.comparisons;
- this.editorHeading(ko.i18n('ple.spec.comparison', 'Comparison'));
- this.editorDescription(ko.i18n('ple.spec.comparisonDescription', 'Add or update the target, comparator, outcome(s) cohorts and negative control outcomes'));
- this.editorComponentName('comparison-editor');
- this.editorComponentParams({
- comparison: comparison,
- subscriptions: this.subscriptions,
- isEditPermitted: this.isEditPermitted
- });
- this.managerMode('editor')
- }
-
- copyComparison(obj, index) {
- const newComparison = ko.toJS(this.comparisons()[index]);
- newComparison.target = null;
- newComparison.comparator = null;
- this.comparisons.push(new Comparison(newComparison));
- }
-
- deleteFromTable(list, obj, index) {
- // Check if the button or inner element were clicked
- if (
- obj.target.className.indexOf("btn-remove") >= 0 ||
- obj.target.className.indexOf("fa-times") >= 0
- ) {
- list.splice(index, 1);
- }
- }
-
- closeEditor() {
- this.editorArray.valueHasMutated();
- this.managerMode('summary');
- }
- }
-
- return commonUtils.build('comparative-cohort-analysis-specification-view-edit', ComparativeCohortAnalysisSpecificationViewEdit, view);
-});
\ No newline at end of file
diff --git a/js/pages/estimation/components/cca-specification-view-edit.less b/js/pages/estimation/components/cca-specification-view-edit.less
deleted file mode 100644
index 0098a4784..000000000
--- a/js/pages/estimation/components/cca-specification-view-edit.less
+++ /dev/null
@@ -1,3 +0,0 @@
-.settings-disabled {
- pointer-events: none;
-}
\ No newline at end of file
diff --git a/js/pages/estimation/components/cca-utilities.html b/js/pages/estimation/components/cca-utilities.html
deleted file mode 100644
index fd37359f6..000000000
--- a/js/pages/estimation/components/cca-utilities.html
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/js/pages/estimation/components/cca-utilities.js b/js/pages/estimation/components/cca-utilities.js
deleted file mode 100644
index 9cbd94726..000000000
--- a/js/pages/estimation/components/cca-utilities.js
+++ /dev/null
@@ -1,142 +0,0 @@
-define([
- 'knockout',
- 'text!./cca-utilities.html',
- 'components/Component',
- 'utils/CommonUtils',
- 'services/file',
- 'appConfig',
- 'services/Estimation',
- '../PermissionService',
- '../const',
- 'clipboard',
- '../inputTypes/ComparativeCohortAnalysis/FullAnalysis',
- 'services/analysis/Cohort',
- '../inputTypes/TargetComparatorOutcome',
- 'faceted-datatable',
- 'utilities/import',
- 'utilities/export',
-], function (
- ko,
- view,
- Component,
- commonUtils,
- fileService,
- config,
- EstimationService,
- PermissionService,
- constants,
- clipboard,
- FullAnalysis,
- Cohort,
- TargetComparatorOutcome,
-) {
- class ComparativeCohortAnalysisUtilities extends Component {
- constructor(params) {
- super(params);
-
- this.utilityPillMode = ko.observable('download');
- this.defaultLoadingMessage = ko.i18n('common.loadingWithDots', 'Loading...')();
- this.constants = constants;
- this.options = constants.options;
- this.cohortMethodAnalysisList = params.estimationAnalysis().estimationAnalysisSettings.analysisSpecification.cohortMethodAnalysisList;
- this.comparisons = params.comparisons;
- this.dirtyFlag = params.dirtyFlag;
- this.isExporting = ko.observable(false);
- this.fullAnalysisList = params.fullAnalysisList;
- this.fullSpecification = params.fullSpecification;
- this.loading = params.loading;
- this.subscriptions = params.subscriptions;
- this.loadingDownload = ko.observable(false);
- this.loadingMessage = params.loadingMessage;
- this.packageName = params.packageName;
- this.selectedAnalysisId = params.estimationId;
- this.criticalCount = params.criticalCount;
- this.exportService = EstimationService.exportEstimation;
- this.importService = EstimationService.importEstimation;
- this.isPermittedExport = PermissionService.isPermittedExport;
- this.isPermittedImport = PermissionService.isPermittedImport;
- this.isEditPermitted = params.isEditPermitted;
- this.afterImportSuccess = params.afterImportSuccess;
- this.cca = constants.getCca(this.isEditPermitted())[0];
-
- this.specificationValid = ko.pureComputed(() => this.criticalCount() <= 0);
-
- this.validPackageName = ko.pureComputed(() => {
- return (this.packageName() && this.packageName().length > 0)
- });
-
- this.subscriptions.push(this.utilityPillMode.subscribe(() => {
- if (this.utilityPillMode() == 'download') {
- this.computeCartesian();
- }
- }));
-
- // Fire the subscription upon load.
- this.utilityPillMode.valueHasMutated();
- }
-
- computeCartesian() {
- // Init
- this.loadingDownload(true);
- this.fullAnalysisList.removeAll();
-
- // Explode T+C for all O's
- var fullComparisonList = [];
- this.comparisons().forEach((tcos) => {
- tcos.outcomes().forEach((outcome) => {
- fullComparisonList.push(new TargetComparatorOutcome({
- target: tcos.target(),
- comparator: tcos.comparator(),
- outcome: new Cohort(outcome),
- }))
- });
- })
-
- // Full Analysis
- var fullAnalysisCartesian = commonUtils.cartesian(
- fullComparisonList,
- this.cohortMethodAnalysisList(),
- );
- fullAnalysisCartesian.forEach(element => {
- if (element.length != 2) {
- console.error("Expecting array with index 0: TargetComparatorOutcome, 1: CohortMethodAnalysis");
- } else {
- this.fullAnalysisList().push(
- new FullAnalysis(element[0],element[1])
- );
- }
- });
- this.fullAnalysisList.valueHasMutated();
- this.loadingDownload(false);
- }
-
- downloadPackage() {
- this.loadingMessage("Starting download...");
- this.loading(true);
- fileService.loadZip(
- config.api.url + constants.apiPaths.downloadCcaAnalysisPackage(this.selectedAnalysisId(), this.packageName()),
- `estimation_study_${this.selectedAnalysisId()}_export.zip`
- )
- .catch((e) => console.error("error when downloading: " + e))
- .finally(() => this.loading(false));
- }
-
- copyFullSpecificationToClipboard() {
- var currentClipboard = new clipboard('#btnCopyFullSpecificationClipboard');
-
- currentClipboard.on('success', function (e) {
- e.clearSelection();
- $('#copyFullSpecificationToClipboardMessage').fadeIn();
- setTimeout(function () {
- $('#copyFullSpecificationToClipboardMessage').fadeOut();
- }, 1500);
- });
-
- currentClipboard.on('error', function (e) {
- console.error('Error copying to clipboard');
- });
- }
- }
-
- return commonUtils.build('comparative-cohort-analysis-utilities', ComparativeCohortAnalysisUtilities, view);
-});
\ No newline at end of file
diff --git a/js/pages/estimation/components/editors/cohort-method-analysis-editor.html b/js/pages/estimation/components/editors/cohort-method-analysis-editor.html
deleted file mode 100644
index 7166894ae..000000000
--- a/js/pages/estimation/components/editors/cohort-method-analysis-editor.html
+++ /dev/null
@@ -1,280 +0,0 @@
-
-
-
-
-
-
-
-
- Your study has invalid design that prevent you from reviewing the full specification details and downloading the study package. Please check "Messages" tab
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Covariate selection
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/js/pages/estimation/components/editors/match-args-editor.js b/js/pages/estimation/components/editors/match-args-editor.js
deleted file mode 100644
index c7cd96143..000000000
--- a/js/pages/estimation/components/editors/match-args-editor.js
+++ /dev/null
@@ -1,34 +0,0 @@
-define([
- 'knockout',
- 'text!./match-args-editor.html',
- 'components/Component',
- 'utils/CommonUtils',
- '../../const',
- 'databindings',
-], function (
- ko,
- view,
- Component,
- commonUtils,
- constants,
-) {
- class MatchArgsEditor extends Component {
- constructor(params) {
- super(params);
-
- this.matchArgs = params.matchArgs;
- this.options = constants.options;
- this.isEditPermitted = params.isEditPermitted;
-
- // TODO: At the moment, we do not expose the ability
- // to edit Match/Stratify by covariate arguments
- // and if we do, we need to format the covariate
- // ID list as numbers
- this.hasCovariateIds = ko.pureComputed(() => {
- return (this.matchArgs.covariateIds !== undefined)
- });
- }
- }
-
- return commonUtils.build('match-args-editor', MatchArgsEditor, view);
-});
\ No newline at end of file
diff --git a/js/pages/estimation/components/editors/negative-control-outcome-cohort-settings-editor.html b/js/pages/estimation/components/editors/negative-control-outcome-cohort-settings-editor.html
deleted file mode 100644
index eaca0a318..000000000
--- a/js/pages/estimation/components/editors/negative-control-outcome-cohort-settings-editor.html
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
diff --git a/js/pages/estimation/components/editors/negative-control-outcome-cohort-settings-editor.js b/js/pages/estimation/components/editors/negative-control-outcome-cohort-settings-editor.js
deleted file mode 100644
index 094c7ac7a..000000000
--- a/js/pages/estimation/components/editors/negative-control-outcome-cohort-settings-editor.js
+++ /dev/null
@@ -1,26 +0,0 @@
-define([
- 'knockout',
- 'text!./negative-control-outcome-cohort-settings-editor.html',
- 'components/Component',
- 'utils/CommonUtils',
- '../../const',
- 'databindings',
-], function (
- ko,
- view,
- Component,
- commonUtils,
- constants,
-) {
- class NegativeControlOutcomeCohortSettingsEditor extends Component {
- constructor(params) {
- super(params);
- this.isEditPermitted = params.isEditPermitted;
-
- this.negativeControlCohortSettings = params.negativeControlCohortSettings;
- this.options = constants.options;
- }
- }
-
- return commonUtils.build('nc-outcome-cohort-settings-editor', NegativeControlOutcomeCohortSettingsEditor, view);
-});
\ No newline at end of file
diff --git a/js/pages/estimation/components/editors/outcome-model-args-editor.html b/js/pages/estimation/components/editors/outcome-model-args-editor.html
deleted file mode 100644
index da736aa00..000000000
--- a/js/pages/estimation/components/editors/outcome-model-args-editor.html
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/js/pages/estimation/components/editors/outcome-model-args-editor.js b/js/pages/estimation/components/editors/outcome-model-args-editor.js
deleted file mode 100644
index 8da818f10..000000000
--- a/js/pages/estimation/components/editors/outcome-model-args-editor.js
+++ /dev/null
@@ -1,61 +0,0 @@
-define([
- 'knockout',
- 'text!./outcome-model-args-editor.html',
- 'components/Component',
- 'utils/CommonUtils',
- '../../const',
- 'utils/DataTypeConverterUtils',
- 'databindings',
- 'cyclops',
-], function (
- ko,
- view,
- Component,
- commonUtils,
- constants,
- dataTypeConverterUtils
-) {
- class OutcomeModelArgsEditor extends Component {
- constructor(params) {
- super(params);
-
- this.outcomeModelArgs = params.outcomeModelArgs;
- this.matchStratifySelection = params.matchStratifySelection;
- this.options = constants.options;
- this.isEditPermitted = params.isEditPermitted;
- this.subscriptions = params.subscriptions;
- this.showControlDisplay = ko.observable(false);
- this.showPriorDisplay = ko.observable(false);
- this.excludeCovariateIds = ko.observable(this.outcomeModelArgs.excludeCovariateIds() && this.outcomeModelArgs.excludeCovariateIds().length > 0 ? this.outcomeModelArgs.excludeCovariateIds().join() : '');
- this.includeCovariateIds = ko.observable(this.outcomeModelArgs.includeCovariateIds() && this.outcomeModelArgs.includeCovariateIds().length > 0 ? this.outcomeModelArgs.includeCovariateIds().join() : '');
- this.interactionCovariateIds = ko.observable(this.outcomeModelArgs.interactionCovariateIds() && this.outcomeModelArgs.interactionCovariateIds().length > 0 ? this.outcomeModelArgs.interactionCovariateIds().join() : '');
- this.useRegularization = ko.observable(constants.isUsingRegularization(this.outcomeModelArgs.prior) ? true : false);
-
- this.subscriptions.push(this.includeCovariateIds.subscribe(newValue => {
- this.outcomeModelArgs.includeCovariateIds(dataTypeConverterUtils.commaDelimitedListToNumericArray(newValue));
- }));
-
- this.subscriptions.push(this.excludeCovariateIds.subscribe(newValue => {
- this.outcomeModelArgs.excludeCovariateIds(dataTypeConverterUtils.commaDelimitedListToNumericArray(newValue));
- }));
-
- this.subscriptions.push(this.interactionCovariateIds.subscribe(newValue => {
- this.outcomeModelArgs.interactionCovariateIds(dataTypeConverterUtils.commaDelimitedListToNumericArray(newValue));
- }));
-
- this.subscriptions.push(this.useRegularization.subscribe(newValue => {
- constants.setRegularization(newValue, this.outcomeModelArgs.prior);
- }));
- }
-
- toggleControlDisplay() {
- this.showControlDisplay(!this.showControlDisplay());
- }
-
- togglePriorDisplay() {
- this.showPriorDisplay(!this.showPriorDisplay());
- }
- }
-
- return commonUtils.build('outcome-model-args-editor', OutcomeModelArgsEditor, view);
-});
\ No newline at end of file
diff --git a/js/pages/estimation/components/editors/positive-control-sythesis-settings-editor.html b/js/pages/estimation/components/editors/positive-control-sythesis-settings-editor.html
deleted file mode 100644
index c790bb8fe..000000000
--- a/js/pages/estimation/components/editors/positive-control-sythesis-settings-editor.html
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/js/pages/estimation/components/editors/stratify-args-editor.js b/js/pages/estimation/components/editors/stratify-args-editor.js
deleted file mode 100644
index 853479169..000000000
--- a/js/pages/estimation/components/editors/stratify-args-editor.js
+++ /dev/null
@@ -1,34 +0,0 @@
-define([
- 'knockout',
- 'text!./stratify-args-editor.html',
- 'components/Component',
- 'utils/CommonUtils',
- '../../const',
- 'databindings',
-], function (
- ko,
- view,
- Component,
- commonUtils,
- constants,
-) {
- class StratifyArgsEditor extends Component {
- constructor(params) {
- super(params);
-
- this.stratifyArgs = params.stratifyArgs;
- this.options = constants.options;
- this.isEditPermitted = params.isEditPermitted;
-
- // TODO: At the moment, we do not expose the ability
- // to edit Match/Stratify by covariate arguments
- // and if we do, we need to format the covariate
- // ID list as numbers
- this.hasCovariateIds = ko.pureComputed(() => {
- return (this.stratifyArgs.covariateIds !== undefined)
- });
- }
- }
-
- return commonUtils.build('stratify-args-editor', StratifyArgsEditor, view);
-});
\ No newline at end of file
diff --git a/js/pages/estimation/const.js b/js/pages/estimation/const.js
deleted file mode 100644
index e90e1be9b..000000000
--- a/js/pages/estimation/const.js
+++ /dev/null
@@ -1,446 +0,0 @@
-define(
- (require, exports) => {
- const pageTitle = 'Estimation';
- const ko = require('knockout');
- const config = require('appConfig');
- const _ = require('lodash');
- const consts = require('const');
- const commonUtils = require('utils/CommonUtils');
-
- const apiPaths = {
- downloadCcaAnalysisPackage: (id, name) => `estimation/${id}/download?packageName=${name}`,
- downloadResults: id => `estimation/generation/${id}/result`,
- };
-
- const paths = {
- root: '/estimation/cca/',
- ccaAnalysis: id => `/estimation/cca/${id}`,
- ccaAnalysisDash: id => `#${paths.ccaAnalysis(id)}`,
- createCcaAnalysis: () => '#/estimation/cca/0',
- browser: () => '#/estimation',
- };
-
-
- const conceptSetCrossReference = {
- targetComparatorOutcome: {
- targetName: "estimationAnalysisSettings.analysisSpecification.targetComparatorOutcomes",
- propertyName: {
- includedCovariateConcepts: "includedCovariateConceptIds",
- excludedCovariateConcepts: "excludedCovariateConceptIds",
- },
- },
- negativeControlOutcomes: {
- targetName: "negativeControlOutcomes",
- propertyName: "outcomeId",
- },
- analysisCovariateSettings: {
- targetName: "estimationAnalysisSettings.analysisSpecification.cohortMethodAnalysisList.getDbCohortMethodDataArgs.covariateSettings",
- propertyName: {
- includedCovariateConcepts: "includedCovariateConceptIds",
- excludedCovariateConcepts: "excludedCovariateConceptIds",
- },
- },
- positiveControlCovariateSettings: {
- targetName: "positiveControlSynthesisArgs.covariateSettings",
- propertyName: {
- includedCovariateConcepts: "includedCovariateConceptIds",
- excludedCovariateConcepts: "excludedCovariateConceptIds",
- },
- }
- };
-
- const isUsingRegularization = (prior) => {
- return !(prior.priorType() === "none" && prior.useCrossValidation() === false);
- }
-
- const setRegularization = (enable, prior) => {
- if (enable === true) {
- prior.priorType("laplace");
- prior.useCrossValidation(true);
- } else {
- prior.priorType("none");
- prior.useCrossValidation(false);
- }
- }
-
- const getTimeAtRisk = (createStudyPopArgs) => {
- return (createStudyPopArgs.riskWindowStart() + "-" + createStudyPopArgs.riskWindowEnd() + ko.i18n('common.daysAbbr', 'd')() +
- " (" + ko.i18n('common.min', 'min')() + ": " + createStudyPopArgs.minDaysAtRisk() +
- ko.i18n('common.daysAbbr', 'd')() + ")");
- };
-
- const options = {
- removeButton: ``,
- copyButton: ``,
- numberOfStrataOptions: _.range(1,11).map(v => '' + v),
- maxRatioOptions: _.range(0,11).map(v => '' + v),
- dayOptions: ['0', '1', '7', '14', '21', '30', '60', '90', '120', '180', '365', '548', '730', '1095'],
- maxCohortSizeOptions: ['0', '1000', '5000', '10000', '50000', '100000'],
- maxCohortSizeForFittingOptions: ['250000', '150000', '100000', '50000', '10000', '5000', '0'],
- yesNoOptions: [{
- name: ko.i18n('options.yes', 'Yes'),
- id: true,
- }, {
- name: ko.i18n('options.no', 'No'),
- id: false
- }],
- removeDuplicateSubjectOptions: [{
- name: ko.i18n('ple.spec.options.keepAll', 'Keep All'),
- id: 'keep all',
- }, {
- name: ko.i18n('ple.spec.options.keepFirst', 'Keep First'),
- id: 'keep first'
- }, {
- name: ko.i18n('ple.spec.options.removeAll', 'Remove All'),
- id: 'remove all'
- }],
- trimOptions: [{
- name: ko.i18n('ple.spec.options.none', 'None'),
- id: 'none',
- }, {
- name: ko.i18n('ple.spec.options.byPercent', 'By Percent'),
- id: 'byPercent'
- }, {
- name: ko.i18n('ple.spec.options.toEquipoise', 'To Equipoise'),
- id: 'toEquipoise'
- }],
- matchStratifyOptions: [{
- name: ko.i18n('ple.spec.options.none', 'None'),
- id: 'none',
- }, {
- name: ko.i18n('ple.spec.options.matchOnPropensityScore', 'Match on propensity score'),
- id: 'matchOnPs'
- }, {
- name: ko.i18n('ple.spec.options.stratifyOnPropensityScore', 'Stratify on propensity score'),
- id: 'stratifyByPs'
- }],
- caliperScaleOptions: [{
- name: ko.i18n('ple.spec.options.standardizedLogit', 'Standardized Logit'),
- id: 'standardized logit',
- }, {
- name: ko.i18n('ple.spec.options.standardized', 'Standardized'),
- id: 'standardized'
- }, {
- name: ko.i18n('ple.spec.options.propensityScore', 'Propensity score'),
- id: 'propensity score'
- }],
- stratificationBaseSelectionOptions: [{
- name: ko.i18n('ple.spec.options.all', 'All'),
- id: 'all',
- }, {
- name: ko.i18n('ple.spec.options.target', 'Target'),
- id: 'target'
- }, {
- name: ko.i18n('ple.spec.options.comparator', 'Comparator'),
- id: 'comparator'
- }],
- outcomeModelTypeOptions: [{
- name: ko.i18n('ple.spec.options.logisticRegression', 'Logistic regression'),
- id: 'logistic',
- }, {
- name: ko.i18n('ple.spec.options.poissonRegression', 'Poisson regression'),
- id: 'poisson'
- }, {
- name: ko.i18n('ple.spec.options.coxProportionalHazards', 'Cox proportional hazards'),
- id: 'cox'
- }],
- occurrenceTypeOptions: [{
- name: ko.i18n('ple.spec.options.allOccurrences', 'All occurrences'),
- id: 'all',
- }, {
- name: ko.i18n('ple.spec.options.firstOccurrence', 'First occurrence'),
- id: 'first'
- }],
- domains: [{
- name: ko.i18n('ple.spec.options.condition', 'Condition'),
- id: 'condition',
- }, {
- name: ko.i18n('ple.spec.options.drug', 'Drug'),
- id: 'drug'
- }, {
- name: ko.i18n('ple.spec.options.device', 'Device'),
- id: 'device'
- }, {
- name: ko.i18n('ple.spec.options.measurement', 'Measurement'),
- id: 'measurement'
- }, {
- name: ko.i18n('ple.spec.options.observation', 'Observation'),
- id: 'observation'
- }, {
- name: ko.i18n('ple.spec.options.procedure', 'Procedure'),
- id: 'procedure'
- }, {
- name: ko.i18n('ple.spec.options.visit', 'Visit'),
- id: 'visit'
- }],
- positiveControlSynthesisArgs: {
- modelType: [{
- name: ko.i18n('ple.spec.options.poisson', 'Poisson'),
- id: 'poisson',
- }, {
- name: ko.i18n('ple.spec.options.survival', 'Survival'),
- id: 'survival'
- }],
- minOutcomeCountForModelOptions: ['100', '75', '50', '25', '10'],
- minOutcomeCountForInjectionOptions: ['100', '75', '50', '25', '10'],
- washoutPeriodOptions: ['0', '1', '7', '14', '21', '30', '60', '90', '120', '180', '183', '365', '548', '730', '1095'],
- dayOptions: ['0', '1', '7', '14', '21', '30', '60', '90', '120', '180', '365', '548', '730', '1095'],
- maxSubjectsForModelOptions: ['0', '1000', '5000', '10000', '50000', '100000', '150000', '200000', '250000'],
- yesNoOptions: [{
- name: ko.i18n('options.yes', 'Yes'),
- id: true,
- }, {
- name: ko.i18n('options.no', 'No'),
- id: false
- }],
- }
- };
- const getCca = (canEdit) => [{
- comparisonTableColumns: [
- {
- title: ko.i18n('columns.remove', 'Remove'),
- render: (s, p, d) => {
- return options.removeButton;
- },
- orderable: false,
- searchable: false,
- className: 'col-remove',
- visible: canEdit,
- },
- {
- title: ko.i18n('columns.targetId', 'Target Id'),
- data: d => d.target().id,
- visible: false,
- },
- {
- title: ko.i18n('columns.target', 'Target'),
- data: d => d.target().name,
- },
- {
- title: ko.i18n('columns.comparatorId', 'Comparator Id'),
- data: d => d.comparator().id,
- visible: false,
- },
- {
- title: ko.i18n('columns.comparator', 'Comparator'),
- data: d => d.comparator().name,
- },
- {
- title: ko.i18n('columns.outcomes', 'Outcomes'),
- render: (s, p, d, a, b, c) => {
- if (d.outcomes().length > 1) {
- let tooltipText = "";
- d.outcomes().forEach((element, index) => {
- element = ko.toJS(element);
- if (index > 0) {
- tooltipText += ("" + element.name + "");
- }
- });
- const outcomeDisplay = d.outcomes().length === 2 ? "outcome" : "outcomes";
- return ko.toJS(d.outcomes()[0]).name + "
-
-
-(" + (d.outcomes().length - 1) + "+ more " + outcomeDisplay + "" + tooltipText + ") ";
- } else if (d.outcomes().length === 1) {
- return ko.toJS(d.outcomes()[0]).name;
- } else {
- return 0;
- }
- }
- },
- {
- title: ko.i18n('columns.ncOutcomes', 'NC Outcomes'),
- data: d => d.negativeControlOutcomesConceptSet().name,
- },
- {
- title: ko.i18n('columns.inclCovariates', 'Incl Covariates'),
- data: d => d.includedCovariateConceptSet().length,
- visible: false,
- },
- {
- title: ko.i18n('columns.exclCovariates', 'Excl Covariates'),
- data: d => d.excludedCovariateConceptSet().length,
- visible: false,
- },
- {
- title: ko.i18n('columns.copy', 'Copy'),
- render: (s, p, d) => {
- return options.copyButton;
- },
- orderable: false,
- searchable: false,
- className: 'col-copy',
- visible: canEdit,
- },
- ],
- comparisonTableOptions: {
- ...commonUtils.getTableOptions('S'),
- dom: '<<"row vertical-align"<"col-xs-6"l><"col-xs-6 search"f>><"row vertical-align">" + - ko.unwrap(consts.timeAtRiskCohortDate.find(f => f.id === d.createStudyPopArgs.addExposureDaysToStart()).name); - } else { - return ''; - } - } - }, - { - title: ko.i18n('columns.timeAtRiskEnd', 'Time At Risk End'), - render: (s, p, d) => { - if (d.createStudyPopArgs != null) { - return d.createStudyPopArgs.riskWindowEnd() + - " " + - " " + - ko.unwrap(consts.timeAtRiskCohortDate.find(f => f.id === d.createStudyPopArgs.addExposureDaysToEnd()).name); - } else { - return ''; - } - } - }, - { - title: ko.i18n('columns.minimumTimeAtRisk', 'Minimum Time At Risk'), - render: (s, p, d) => { - if (d.createStudyPopArgs != null) { - return d.createStudyPopArgs.minDaysAtRisk() + ""; - } else { - return ''; - } - } - }, - { - title: ko.i18n('columns.adjustmentStrategy', 'Adjustment Strategy'), - render: (s, p, d) => { - if (d.matchOnPs()) { - return ko.i18nformat('ple.spec.options.matching', '<%=ratio%>:1 matching', {ratio: d.matchOnPsArgs.maxRatio()})(); - } else if (d.stratifyByPs()) { - return ko.i18nformat('ple.spec.options.stratification', 'Stratification (stratum: <%=stratum%>)', {stratum: d.stratifyByPsArgs.numberOfStrata()})(); - } else { - return ko.i18n('ple.spec.options.none', 'None')(); - } - } - }, - { - title: ko.i18n('columns.outcomeModel', 'Outcome Model'), - render: (s, p, d) => { - if (d.fitOutcomeModelArgs != null) { - return d.fitOutcomeModelArgs.modelType(); - } else { - return ''; - } - } - }, - { - title: ko.i18n('columns.copy', 'Copy'), - render: (s, p, d) => { - return options.copyButton; - }, - orderable: false, - searchable: false, - className: 'col-copy', - visible: canEdit - }, - ], - analysisSettingsTableOptions: { - ...commonUtils.getTableOptions('S'), - dom: '<<"row vertical-align"<"col-xs-6"l><"col-xs-6 search"f>><"row vertical-align"> (min: " + d.cohortMethodAnalysis.createStudyPopArgs.minDaysAtRisk() + "d)"); - return getTimeAtRisk(d.cohortMethodAnalysis.createStudyPopArgs); - } - }, - { - title: ko.i18n('columns.outcomeModel', 'Outcome Model'), - data: d => { - return d.cohortMethodAnalysis.fitOutcomeModelArgs.modelType(); - }, - } - ], - fullAnalysisTableOptions: { - ...commonUtils.getTableOptions('S'), - dom: '<<"row vertical-align"<"col-xs-6"<"dt-btn"B>l><"col-xs-6 search"f>><"row vertical-align">
-
-
-
-
-
+
diff --git a/js/pages/incidence-rates/components/iranalysis/components/editor.js b/js/pages/incidence-rates/components/iranalysis/components/editor.js
index 1c46f8c22..d7e960dd4 100644
--- a/js/pages/incidence-rates/components/iranalysis/components/editor.js
+++ b/js/pages/incidence-rates/components/iranalysis/components/editor.js
@@ -49,7 +49,7 @@ define([
// Subscriptions
this.subscriptions.push(this.analysis.subscribe((newVal) => {
//console.log("New analysis set.");
- this.selectedStrataRule(params.analysis().strata()[this.selectedStrataRuleIndex]);
+ this.selectedStrataRule(this.analysis()?.strata()[this.selectedStrataRuleIndex]);
}));
}
diff --git a/js/pages/incidence-rates/ir-browser.html b/js/pages/incidence-rates/ir-browser.html
index 1dd93a2a6..089b811ce 100644
--- a/js/pages/incidence-rates/ir-browser.html
+++ b/js/pages/incidence-rates/ir-browser.html
@@ -18,4 +18,4 @@
-
-
+
@@ -71,7 +71,7 @@
-
@@ -80,7 +80,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/evaluation-settings-editor.js b/js/pages/prediction/components/editors/evaluation-settings-editor.js
deleted file mode 100644
index 1ed3a810e..000000000
--- a/js/pages/prediction/components/editors/evaluation-settings-editor.js
+++ /dev/null
@@ -1,47 +0,0 @@
-define([
- 'knockout',
- 'text!./evaluation-settings-editor.html',
- 'components/Component',
- 'utils/CommonUtils',
- 'utils/DataTypeConverterUtils',
- '../../const',
- 'databindings'
-], function (
- ko,
- view,
- Component,
- commonUtils,
- dataTypeConverterUtils,
- constants,
-) {
- class EvaluationSettingsEditor extends Component {
- constructor(params) {
- super(params);
-
- this.isInteger = RegExp('^[1-9][0-9]*$');
- this.runPlpArgs = params.runPlpArgs();
- this.options = constants.options;
- this.subscriptions = params.subscriptions;
- this.splitSeed = ko.observable(this.runPlpArgs.splitSeed() !== null && this.runPlpArgs.splitSeed() !== 0 ? this.runPlpArgs.splitSeed() : '');
- this.testFraction = ko.observable(dataTypeConverterUtils.convertFromPercent(this.runPlpArgs.testFraction()));
- this.isEditPermitted = params.isEditPermitted;
-
- this.subscriptions.push(this.splitSeed.subscribe(newValue => {
- if (newValue === '' || !this.isInteger.test(newValue)) {
- this.runPlpArgs.splitSeed(null);
- this.splitSeed('');
- } else {
- this.runPlpArgs.splitSeed(newValue);
- }
- }));
-
- this.subscriptions.push(this.testFraction.subscribe(newValue => {
- const val = dataTypeConverterUtils.convertToPercent(newValue);
- this.runPlpArgs.testFraction(val);
- this.testFraction(dataTypeConverterUtils.convertFromPercent(val));
- }));
- }
- }
-
- return commonUtils.build('evaluation-settings-editor', EvaluationSettingsEditor, view);
-});
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/execution-settings-editor.html b/js/pages/prediction/components/editors/execution-settings-editor.html
deleted file mode 100644
index 898c29944..000000000
--- a/js/pages/prediction/components/editors/execution-settings-editor.html
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- patients
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/execution-settings-editor.js b/js/pages/prediction/components/editors/execution-settings-editor.js
deleted file mode 100644
index cca36df7c..000000000
--- a/js/pages/prediction/components/editors/execution-settings-editor.js
+++ /dev/null
@@ -1,37 +0,0 @@
-define([
- 'knockout',
- 'text!./execution-settings-editor.html',
- 'components/Component',
- 'utils/CommonUtils',
- '../../const',
- 'databindings'
-], function (
- ko,
- view,
- Component,
- commonUtils,
- constants,
-) {
- class ExecutionSettingsEditor extends Component {
- constructor(params) {
- super(params);
-
- this.getPlpDataArgs = params.getPlpDataArgs();
- this.runPlpArgs = params.runPlpArgs();
- this.options = constants.options;
- this.subscriptions = params.subscriptions;
- this.isEditPermitted = params.isEditPermitted;
-
- this.maxSampleSizeToggle = ko.observable(this.getPlpDataArgs.maxSampleSize() != null || false);
- this.subscriptions.push(this.maxSampleSizeToggle.subscribe(optionVal => {
- if (optionVal == false) {
- this.getPlpDataArgs.maxSampleSize(null);
- } else {
- this.getPlpDataArgs.maxSampleSize(10000);
- }
- }));
- }
- }
-
- return commonUtils.build('execution-settings-editor', ExecutionSettingsEditor, view);
-});
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/model-settings-editor.html b/js/pages/prediction/components/editors/model-settings-editor.html
deleted file mode 100644
index 4bde4a97b..000000000
--- a/js/pages/prediction/components/editors/model-settings-editor.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/js/pages/prediction/components/editors/model-settings-editor.js b/js/pages/prediction/components/editors/model-settings-editor.js
deleted file mode 100644
index 8a97d78a4..000000000
--- a/js/pages/prediction/components/editors/model-settings-editor.js
+++ /dev/null
@@ -1,30 +0,0 @@
-define([
- 'knockout',
- 'text!./model-settings-editor.html',
- 'components/Component',
- 'utils/CommonUtils',
- './modelSettings/naive-bayes-settings',
- './modelSettings/random-forest-settings',
- './modelSettings/mlp-settings',
- './modelSettings/knn-settings',
- './modelSettings/gradient-boosting-machine-settings',
- './modelSettings/decision-tree-settings',
- './modelSettings/ada-boost-settings',
- './modelSettings/lasso-logistic-regression-settings',
-], function (
- ko,
- view,
- Component,
- commonUtils,
-) {
- class ModelSettingsEditor extends Component {
- constructor(params) {
- super(params);
-
- this.editor = params.editor;
- this.editorSettings = params;
- }
- }
-
- return commonUtils.build('model-settings-editor', ModelSettingsEditor, view);
-});
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/modelSettings/ModelSettingsEditorComponent.js b/js/pages/prediction/components/editors/modelSettings/ModelSettingsEditorComponent.js
deleted file mode 100644
index 004df5cb3..000000000
--- a/js/pages/prediction/components/editors/modelSettings/ModelSettingsEditorComponent.js
+++ /dev/null
@@ -1,48 +0,0 @@
-define([
- 'knockout',
- 'components/Component',
- '../../../utils',
- '../../../const',
- 'components/multi-select',
- 'components/multi-input/multi-input',
-], function (
- ko,
- Component,
- utils,
- constants
-) {
- class ModelSettingsEditorComponent extends Component {
- constructor(params) {
- super(params);
- this.modelSettings = params.modelSettings[this.constructor.name];
- this.defaultModelSettings = utils.getDefaultModelSettings(this.constructor.name);
- this.utils = utils;
- this.constants = constants;
- this.options = constants.options;
- this.trueFalseOptions = ko.observable(this.options.trueFalseOptions);
- this.classWeightOptions = ko.observable(this.options.classWeightOptions);
- this.extenders = constants.extenders;
- this.subscriptions = params.subscriptions;
- }
-
- modelSettingDescription(settingName) {
- return utils.getDefaultModelSettingDescriptionTranslate(this.defaultModelSettings, settingName);
- }
- getModelSettingByName(settingName) {
- if (!Object.keys(this.modelSettings).indexOf(settingName) < 0) {
- console.error("Setting: " + settingName + " not found in modelSettings");
- }
- return Object.values(this.modelSettings)[Object.keys(this.modelSettings).indexOf(settingName)];
- }
- isDefault(settingName) {
- const setting = this.getModelSettingByName(settingName);
- return JSON.stringify(setting()) === JSON.stringify(utils.getDefaultModelSettingValue(this.defaultModelSettings, settingName));
- }
- setToDefault(settingName) {
- const setting = this.getModelSettingByName(settingName);
- setting(utils.getDefaultModelSettingValue(this.defaultModelSettings, settingName));
- }
- }
-
- return ModelSettingsEditorComponent;
-});
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/modelSettings/ada-boost-settings.html b/js/pages/prediction/components/editors/modelSettings/ada-boost-settings.html
deleted file mode 100644
index d806bb47e..000000000
--- a/js/pages/prediction/components/editors/modelSettings/ada-boost-settings.html
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/modelSettings/ada-boost-settings.js b/js/pages/prediction/components/editors/modelSettings/ada-boost-settings.js
deleted file mode 100644
index cb4083746..000000000
--- a/js/pages/prediction/components/editors/modelSettings/ada-boost-settings.js
+++ /dev/null
@@ -1,39 +0,0 @@
-define([
- 'knockout',
- 'text!./ada-boost-settings.html',
- './ModelSettingsEditorComponent',
- 'utils/CommonUtils',
- 'utils/DataTypeConverterUtils',
-], function (
- ko,
- view,
- ModelSettingsEditorComponent,
- commonUtils,
- dataTypeConverterUtils,
-) {
- const settings = {
- learningRate: 'learningRate',
- nEstimators: 'nEstimators'
- };
-
- class AdaBoostSettings extends ModelSettingsEditorComponent {
- constructor(params) {
- super(params);
-
- this.learningRate = {
- name: settings.learningRate,
- value: this.modelSettings.learningRate,
- valueLabel: this.utils.getDefaultModelSettingName(this.defaultModelSettings, settings.learningRate),
- default: this.utils.getDefaultModelSettingValue(this.defaultModelSettings, settings.learningRate),
- };
- this.nEstimators = {
- name: settings.nEstimators,
- value: this.modelSettings.nEstimators,
- valueLabel: this.utils.getDefaultModelSettingName(this.defaultModelSettings, settings.nEstimators),
- default: this.utils.getDefaultModelSettingValue(this.defaultModelSettings, settings.nEstimators),
- };
- }
- }
-
- return commonUtils.build('ada-boost-settings', AdaBoostSettings, view);
-});
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/modelSettings/decision-tree-settings.html b/js/pages/prediction/components/editors/modelSettings/decision-tree-settings.html
deleted file mode 100644
index f543c943a..000000000
--- a/js/pages/prediction/components/editors/modelSettings/decision-tree-settings.html
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/modelSettings/decision-tree-settings.js b/js/pages/prediction/components/editors/modelSettings/decision-tree-settings.js
deleted file mode 100644
index 78ef85ac8..000000000
--- a/js/pages/prediction/components/editors/modelSettings/decision-tree-settings.js
+++ /dev/null
@@ -1,61 +0,0 @@
-define([
- 'knockout',
- 'text!./decision-tree-settings.html',
- './ModelSettingsEditorComponent',
- 'utils/CommonUtils',
- 'utils/DataTypeConverterUtils',
- 'less!./decision-tree-settings.less',
-], function (
- ko,
- view,
- ModelSettingsEditorComponent,
- commonUtils,
- dataTypeConverterUtils
-) {
- const settings = {
- maxDepth: 'maxDepth',
- minSamplesSplit: 'minSamplesSplit',
- minSamplesLeaf: 'minSamplesLeaf',
- minImpurityDecrease: 'minImpurityDecrease',
- classWeight: 'classWeight',
- };
-
- class DecisionTreeSettings extends ModelSettingsEditorComponent {
- constructor(params) {
- super(params);
-
- this.maxDepth = {
- name: settings.maxDepth,
- value: this.modelSettings.maxDepth,
- valueLabel: this.utils.getDefaultModelSettingName(this.defaultModelSettings, settings.maxDepth),
- default: this.utils.getDefaultModelSettingValue(this.defaultModelSettings, settings.maxDepth),
- };
- this.minSamplesSplit = {
- name: settings.minSamplesSplit,
- value: this.modelSettings.minSamplesSplit,
- valueLabel: this.utils.getDefaultModelSettingName(this.defaultModelSettings, settings.minSamplesSplit),
- default: this.utils.getDefaultModelSettingValue(this.defaultModelSettings, settings.minSamplesSplit),
- };
- this.minSamplesLeaf = {
- name: settings.minSamplesLeaf,
- value: this.modelSettings.minSamplesLeaf,
- valueLabel: this.utils.getDefaultModelSettingName(this.defaultModelSettings, settings.minSamplesLeaf),
- default: this.utils.getDefaultModelSettingValue(this.defaultModelSettings, settings.minSamplesLeaf),
- };
- this.minImpurityDecrease = {
- name: settings.minImpurityDecrease,
- value: this.modelSettings.minImpurityDecrease,
- valueLabel: this.utils.getDefaultModelSettingName(this.defaultModelSettings, settings.minImpurityDecrease),
- default: this.utils.getDefaultModelSettingValue(this.defaultModelSettings, settings.minImpurityDecrease),
- };
- this.classWeight = {
- name: settings.classWeight,
- value: this.modelSettings.classWeight,
- valueLabel: this.utils.getDefaultModelSettingName(this.defaultModelSettings, settings.classWeight),
- default: this.utils.getDefaultModelSettingValue(this.defaultModelSettings, settings.classWeight),
- };
- }
- }
-
- return commonUtils.build('decision-tree-settings', DecisionTreeSettings, view);
-});
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/modelSettings/decision-tree-settings.less b/js/pages/prediction/components/editors/modelSettings/decision-tree-settings.less
deleted file mode 100644
index f059dc7e2..000000000
--- a/js/pages/prediction/components/editors/modelSettings/decision-tree-settings.less
+++ /dev/null
@@ -1,5 +0,0 @@
-.decision-tree-settings {
- &__class-weight {
- margin-bottom: 20px;
- }
-}
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/modelSettings/gradient-boosting-machine-settings.html b/js/pages/prediction/components/editors/modelSettings/gradient-boosting-machine-settings.html
deleted file mode 100644
index 1fbc1e850..000000000
--- a/js/pages/prediction/components/editors/modelSettings/gradient-boosting-machine-settings.html
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/js/pages/prediction/components/editors/modelSettings/gradient-boosting-machine-settings.js b/js/pages/prediction/components/editors/modelSettings/gradient-boosting-machine-settings.js
deleted file mode 100644
index 8088dc611..000000000
--- a/js/pages/prediction/components/editors/modelSettings/gradient-boosting-machine-settings.js
+++ /dev/null
@@ -1,60 +0,0 @@
-define([
- 'knockout',
- 'text!./gradient-boosting-machine-settings.html',
- './ModelSettingsEditorComponent',
- 'utils/CommonUtils',
- 'utils/DataTypeConverterUtils',
-], function (
- ko,
- view,
- ModelSettingsEditorComponent,
- commonUtils,
- dataTypeConverterUtils,
-) {
- const settings = {
- ntrees: 'ntrees',
- nthread: 'nthread',
- maxDepth: 'maxDepth',
- minRows: 'minRows',
- learnRate: 'learnRate'
- };
-
- class GradientBoostingMachineSettings extends ModelSettingsEditorComponent {
- constructor(params) {
- super(params);
-
- this.ntrees = {
- name: settings.ntrees,
- value: this.modelSettings.ntrees,
- valueLabel: this.utils.getDefaultModelSettingName(this.defaultModelSettings, settings.ntrees),
- default: this.utils.getDefaultModelSettingValue(this.defaultModelSettings, settings.ntrees),
- };
- this.nthread = {
- name: settings.nthread,
- value: this.modelSettings.nthread,
- valueLabel: this.utils.getDefaultModelSettingName(this.defaultModelSettings, settings.nthread),
- default: this.utils.getDefaultModelSettingValue(this.defaultModelSettings, settings.nthread),
- };
- this.maxDepth = {
- name: settings.maxDepth,
- value: this.modelSettings.maxDepth,
- valueLabel: this.utils.getDefaultModelSettingName(this.defaultModelSettings, settings.maxDepth),
- default: this.utils.getDefaultModelSettingValue(this.defaultModelSettings, settings.maxDepth),
- };
- this.minRows = {
- name: settings.minRows,
- value: this.modelSettings.minRows,
- valueLabel: this.utils.getDefaultModelSettingName(this.defaultModelSettings, settings.minRows),
- default: this.utils.getDefaultModelSettingValue(this.defaultModelSettings, settings.minRows),
- };
- this.learnRate = {
- name: settings.learnRate,
- value: this.modelSettings.learnRate,
- valueLabel: this.utils.getDefaultModelSettingName(this.defaultModelSettings, settings.learnRate),
- default: this.utils.getDefaultModelSettingValue(this.defaultModelSettings, settings.learnRate),
- };
- }
- }
-
- return commonUtils.build('gradient-boosting-machine-settings', GradientBoostingMachineSettings, view);
-});
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/modelSettings/knn-settings.html b/js/pages/prediction/components/editors/modelSettings/knn-settings.html
deleted file mode 100644
index cfe731a28..000000000
--- a/js/pages/prediction/components/editors/modelSettings/knn-settings.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/modelSettings/knn-settings.js b/js/pages/prediction/components/editors/modelSettings/knn-settings.js
deleted file mode 100644
index 252590ec0..000000000
--- a/js/pages/prediction/components/editors/modelSettings/knn-settings.js
+++ /dev/null
@@ -1,25 +0,0 @@
-define([
- 'knockout',
- 'text!./knn-settings.html',
- './ModelSettingsEditorComponent',
- 'utils/CommonUtils',
-], function (
- ko,
- view,
- ModelSettingsEditorComponent,
- commonUtils,
-) {
- class KNNSettings extends ModelSettingsEditorComponent {
- constructor(params) {
- super(params);
-
- this.k = {
- name: 'k',
- value: this.modelSettings.k,
- };
-
- }
- }
-
- return commonUtils.build('knn-settings', KNNSettings, view);
-});
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/modelSettings/lasso-logistic-regression-settings.html b/js/pages/prediction/components/editors/modelSettings/lasso-logistic-regression-settings.html
deleted file mode 100644
index 1af1b79c6..000000000
--- a/js/pages/prediction/components/editors/modelSettings/lasso-logistic-regression-settings.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/modelSettings/lasso-logistic-regression-settings.js b/js/pages/prediction/components/editors/modelSettings/lasso-logistic-regression-settings.js
deleted file mode 100644
index d23146302..000000000
--- a/js/pages/prediction/components/editors/modelSettings/lasso-logistic-regression-settings.js
+++ /dev/null
@@ -1,24 +0,0 @@
-define([
- 'knockout',
- 'text!./lasso-logistic-regression-settings.html',
- './ModelSettingsEditorComponent',
- 'utils/CommonUtils',
-], function (
- ko,
- view,
- ModelSettingsEditorComponent,
- commonUtils,
-) {
- class LassoLogisticRegressionSettings extends ModelSettingsEditorComponent {
- constructor(params) {
- super(params);
-
- this.variance = {
- name: 'variance',
- value: this.modelSettings.variance,
- };
- }
- }
-
- return commonUtils.build('lasso-logistic-regression-settings', LassoLogisticRegressionSettings, view);
-});
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/modelSettings/mlp-settings.html b/js/pages/prediction/components/editors/modelSettings/mlp-settings.html
deleted file mode 100644
index 999f1f8f7..000000000
--- a/js/pages/prediction/components/editors/modelSettings/mlp-settings.html
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/modelSettings/mlp-settings.js b/js/pages/prediction/components/editors/modelSettings/mlp-settings.js
deleted file mode 100644
index cb4905dd6..000000000
--- a/js/pages/prediction/components/editors/modelSettings/mlp-settings.js
+++ /dev/null
@@ -1,40 +0,0 @@
-define([
- 'knockout',
- 'text!./mlp-settings.html',
- './ModelSettingsEditorComponent',
- 'utils/CommonUtils',
- 'utils/DataTypeConverterUtils'
-], function (
- ko,
- view,
- ModelSettingsEditorComponent,
- commonUtils,
- dataTypeConverterUtils,
-) {
- const settings = {
- size: 'size',
- alpha: 'alpha',
- };
-
- class MLPSettings extends ModelSettingsEditorComponent {
- constructor(params) {
- super(params);
-
- this.size = {
- name: settings.size,
- value: this.modelSettings.size,
- valueLabel: this.utils.getDefaultModelSettingName(this.defaultModelSettings, settings.size),
- default: this.utils.getDefaultModelSettingValue(this.defaultModelSettings, settings.size),
- };
-
- this.alpha = {
- name: settings.alpha,
- value: this.modelSettings.alpha,
- valueLabel: this.utils.getDefaultModelSettingName(this.defaultModelSettings, settings.alpha),
- default: this.utils.getDefaultModelSettingValue(this.defaultModelSettings, settings.alpha),
- };
- }
- }
-
- return commonUtils.build('mlp-settings', MLPSettings, view);
-});
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/modelSettings/naive-bayes-settings.html b/js/pages/prediction/components/editors/modelSettings/naive-bayes-settings.html
deleted file mode 100644
index 479310b6c..000000000
--- a/js/pages/prediction/components/editors/modelSettings/naive-bayes-settings.html
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/modelSettings/naive-bayes-settings.js b/js/pages/prediction/components/editors/modelSettings/naive-bayes-settings.js
deleted file mode 100644
index 42a946811..000000000
--- a/js/pages/prediction/components/editors/modelSettings/naive-bayes-settings.js
+++ /dev/null
@@ -1,19 +0,0 @@
-define([
- 'knockout',
- 'text!./naive-bayes-settings.html',
- './ModelSettingsEditorComponent',
- 'utils/CommonUtils',
-], function (
- ko,
- view,
- ModelSettingsEditorComponent,
- commonUtils,
-) {
- class NaiveBayesSettings extends ModelSettingsEditorComponent {
- constructor(params) {
- super(params);
- }
- }
-
- return commonUtils.build('naive-bayes-settings', NaiveBayesSettings, view);
-});
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/modelSettings/random-forest-settings.html b/js/pages/prediction/components/editors/modelSettings/random-forest-settings.html
deleted file mode 100644
index 821d54244..000000000
--- a/js/pages/prediction/components/editors/modelSettings/random-forest-settings.html
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/modelSettings/random-forest-settings.js b/js/pages/prediction/components/editors/modelSettings/random-forest-settings.js
deleted file mode 100644
index 1ed872435..000000000
--- a/js/pages/prediction/components/editors/modelSettings/random-forest-settings.js
+++ /dev/null
@@ -1,54 +0,0 @@
-define([
- 'knockout',
- 'text!./random-forest-settings.html',
- './ModelSettingsEditorComponent',
- 'utils/CommonUtils',
- 'utils/DataTypeConverterUtils',
-], function (
- ko,
- view,
- ModelSettingsEditorComponent,
- commonUtils,
- dataTypeConverterUtils,
-) {
-
- const settings = {
- mtries: 'mtries',
- ntrees: 'ntrees',
- maxDepth: 'maxDepth',
- varImp: 'varImp'
- };
-
- class RandomForestSettings extends ModelSettingsEditorComponent {
- constructor(params) {
- super(params);
-
- this.mtries = {
- name: settings.mtries,
- value: this.modelSettings.mtries,
- valueLabel: this.utils.getDefaultModelSettingName(this.defaultModelSettings, settings.mtries),
- default: this.utils.getDefaultModelSettingValue(this.defaultModelSettings, settings.mtries),
- };
- this.ntrees = {
- name: settings.ntrees,
- value: this.modelSettings.ntrees,
- valueLabel: this.utils.getDefaultModelSettingName(this.defaultModelSettings, settings.ntrees),
- default: this.utils.getDefaultModelSettingValue(this.defaultModelSettings, settings.ntrees),
- };
- this.maxDepth = {
- name: settings.maxDepth,
- value: this.modelSettings.maxDepth,
- valueLabel: this.utils.getDefaultModelSettingName(this.defaultModelSettings, settings.maxDepth),
- default: this.utils.getDefaultModelSettingValue(this.defaultModelSettings, settings.maxDepth),
- };
- this.varImp = {
- name: settings.varImp,
- value: this.modelSettings.varImp,
- valueLabel: this.utils.getDefaultModelSettingName(this.defaultModelSettings, settings.varImp),
- default: this.utils.getDefaultModelSettingValue(this.defaultModelSettings, settings.varImp),
- };
- }
- }
-
- return commonUtils.build('random-forest-settings', RandomForestSettings, view);
-});
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/population-settings-editor.html b/js/pages/prediction/components/editors/population-settings-editor.html
deleted file mode 100644
index d3b62dd20..000000000
--- a/js/pages/prediction/components/editors/population-settings-editor.html
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/js/pages/prediction/components/editors/population-settings-editor.js b/js/pages/prediction/components/editors/population-settings-editor.js
deleted file mode 100644
index f1bd0b988..000000000
--- a/js/pages/prediction/components/editors/population-settings-editor.js
+++ /dev/null
@@ -1,30 +0,0 @@
-define([
- 'knockout',
- 'text!./population-settings-editor.html',
- 'components/Component',
- 'utils/CommonUtils',
- '../../const',
- 'const',
- 'databindings',
- 'less!./population-settings-editor.less',
-], function (
- ko,
- view,
- Component,
- commonUtils,
- predictionConstants,
- constants,
-) {
- class PopulationSettingsEditor extends Component {
- constructor(params) {
- super(params);
-
- this.populationSettings = params.populationSettings;
- this.options = predictionConstants.options;
- this.constants = constants;
- this.isEditPermitted = params.isEditPermitted;
- }
- }
-
- return commonUtils.build('population-settings-editor', PopulationSettingsEditor, view);
-});
\ No newline at end of file
diff --git a/js/pages/prediction/components/editors/population-settings-editor.less b/js/pages/prediction/components/editors/population-settings-editor.less
deleted file mode 100644
index fed987452..000000000
--- a/js/pages/prediction/components/editors/population-settings-editor.less
+++ /dev/null
@@ -1,5 +0,0 @@
-.population-settings-editor {
- &__form-sub-option {
- padding-left: 10px;
- }
-}
diff --git a/js/pages/prediction/components/editors/prediction-covariate-settings-editor.html b/js/pages/prediction/components/editors/prediction-covariate-settings-editor.html
deleted file mode 100644
index 84d8e47da..000000000
--- a/js/pages/prediction/components/editors/prediction-covariate-settings-editor.html
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
- days from
-
-
-
-
-
- days from
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- days
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- days prior to cohort start
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - -
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/js/pages/prediction/components/prediction-utilities.js b/js/pages/prediction/components/prediction-utilities.js
deleted file mode 100644
index 8e21594b1..000000000
--- a/js/pages/prediction/components/prediction-utilities.js
+++ /dev/null
@@ -1,163 +0,0 @@
-define([
- 'knockout',
- 'text!./prediction-utilities.html',
- 'components/Component',
- 'utils/CommonUtils',
- 'services/file',
- 'appConfig',
- '../const',
- 'services/Prediction',
- '../PermissionService',
- '../inputTypes/TargetOutcome',
- '../inputTypes/ModelCovarPopTuple',
- '../inputTypes/FullAnalysis',
- 'utilities/import',
- 'utilities/export',
-], function (
- ko,
- view,
- Component,
- commonUtils,
- fileService,
- config,
- constants,
- PredictionService,
- PermissionService,
- TargetOutcome,
- ModelCovarPopTuple,
- FullAnalysis,
-) {
- class PredictionUtilities extends Component {
- constructor(params) {
- super(params);
- this.utilityPillMode = ko.observable('download');
- this.constants = constants;
- this.options = constants.options;
- this.loading = params.loading;
- this.subscriptions = params.subscriptions;
- this.selectedAnalysisId = params.analysisId;
- this.patientLevelPredictionAnalysis = params.patientLevelPredictionAnalysis;
- this.fullAnalysisList = params.fullAnalysisList;
- this.fullSpecification = params.fullSpecification;
- this.dirtyFlag = params.dirtyFlag;
- this.packageName = params.packageName;
- this.targetCohorts = params.targetCohorts;
- this.outcomeCohorts = params.outcomeCohorts;
- this.criticalCount = params.criticalCount;
- this.covariateSettings = this.patientLevelPredictionAnalysis().covariateSettings;
- this.modelSettings = this.patientLevelPredictionAnalysis().modelSettings;
- this.populationSettings = this.patientLevelPredictionAnalysis().populationSettings;
- this.loadingDownload = ko.observable(false);
- this.downloadTabMode = ko.observable('full');
- this.targetOutcomePairs = ko.observableArray();
- this.modelCovarPopTuple = ko.observableArray();
- this.loadingMessage = ko.observable();
- this.isExporting = ko.observable(false);
- this.exportService = PredictionService.exportPrediction;
- this.importService = PredictionService.importPrediction;
- this.isPermittedExport = PermissionService.isPermittedExport;
- this.isPermittedImport = PermissionService.isPermittedImport;
- this.afterImportSuccess = params.afterImportSuccess;
- this.language = ko.i18n('datatable.language');
-
- this.specificationValid = ko.pureComputed(() => this.criticalCount() <= 0);
-
- this.validPackageName = ko.pureComputed(() => {
- return (this.packageName() && this.packageName().length > 0)
- });
-
- this.subscriptions.push(this.utilityPillMode.subscribe(() => {
- if (this.utilityPillMode() === 'download') {
- this.computeCartesian();
- }
- }));
-
- // Fire the subscription upon load.
- this.utilityPillMode.valueHasMutated();
- }
-
- patientLevelPredictionAnalysisJson() {
- return commonUtils.syntaxHighlight(ko.toJSON(this.patientLevelPredictionAnalysis));
- }
-
- downloadPackage() {
- this.loadingMessage("Starting download...");
- this.loading(true);
- fileService.loadZip(
- config.api.url + constants.apiPaths.downloadPackage(this.selectedAnalysisId(), this.packageName()),
- `prediction_study_${this.selectedAnalysisId()}_export.zip`
- )
- .catch((e) => console.error("error when downloading: " + e))
- .finally(() => this.loading(false));
- }
-
- computeCartesian() {
- // Init
- this.loadingDownload(true);
- this.targetOutcomePairs.removeAll();
- this.modelCovarPopTuple.removeAll();
- this.fullAnalysisList.removeAll();
-
- // T*O Pairs
- const targetOutcomeCartesian = commonUtils.cartesian(this.targetCohorts(), this.outcomeCohorts());
- targetOutcomeCartesian.forEach(element => {
- if (element.length !== 2) {
- console.error("Expecting array with index 0: treatments, 1: outcomes");
- } else {
- this.targetOutcomePairs().push(
- new TargetOutcome({
- targetId: element[0].id,
- targetName: element[0].name,
- outcomeId: element[1].id,
- outcomeName: element[1].name,
- })
- );
- }
- });
- this.targetOutcomePairs.valueHasMutated();
-
- // Analysis Settings
- const modelCovarPopCartesian = commonUtils.cartesian(
- this.patientLevelPredictionAnalysis().modelSettings(),
- this.patientLevelPredictionAnalysis().covariateSettings(),
- this.patientLevelPredictionAnalysis().populationSettings(),
- );
- modelCovarPopCartesian.forEach(element => {
- if (element.length !== 3) {
- console.error("Expecting array with index 0: model, 1: covariate settings, 2: population settings");
- } else {
- this.modelCovarPopTuple().push(
- new ModelCovarPopTuple({
- modelName: Object.keys(element[0])[0],
- modelSettings: ko.toJSON(element[0][Object.keys(element[0])[0]]),
- covariateSettings: ko.toJSON(element[1]),
- popRiskWindowStart: element[2].riskWindowStart(),
- popRiskWindowEnd: element[2].riskWindowEnd(),
- })
- );
- }
- });
- this.modelCovarPopTuple.valueHasMutated();
-
- // Full Analysis
- const fullAnalysisCartesian = commonUtils.cartesian(
- this.targetOutcomePairs(),
- this.modelCovarPopTuple(),
- );
- this.fullAnalysisList.removeAll();
- fullAnalysisCartesian.forEach(element => {
- if (element.length !== 2) {
- console.error("Expecting array with index 0: TargetOutcome, 1: ModelCovarPopTuple");
- } else {
- this.fullAnalysisList().push(
- new FullAnalysis(element[0],element[1])
- );
- }
- });
- this.fullAnalysisList.valueHasMutated();
- this.loadingDownload(false);
- }
- }
-
- return commonUtils.build('prediction-utilities', PredictionUtilities, view);
-});
\ No newline at end of file
diff --git a/js/pages/prediction/const.js b/js/pages/prediction/const.js
deleted file mode 100644
index 0a4896427..000000000
--- a/js/pages/prediction/const.js
+++ /dev/null
@@ -1,404 +0,0 @@
-define(
- (require, exports) => {
- const pageTitle = 'Prediction';
- const ko = require('knockout');
- const config = require('appConfig');
- const commonUtils = require('utils/CommonUtils');
- const _ = require('lodash');
- const consts = require('const');
-
- const apiPaths = {
- downloadPackage: (id, name) => `prediction/${id}/download?packageName=${name}`,
- downloadResults: id => `prediction/generation/${id}/result`,
- };
-
- const paths = {
- root: '/prediction/',
- analysis: id => `#/prediction/${id}`,
- createAnalysis: () => '#/prediction/0',
- browser: () => '#/prediction',
- };
-
- const conceptSetCrossReference = {
- covariateSettings: {
- targetName: "covariateSettings",
- propertyName: {
- includedCovariateConcepts: "includedCovariateConceptIds",
- excludedCovariateConcepts: "excludedCovariateConceptIds",
- },
- },
- };
-
- const predictionGenerationStatus = consts.generationStatuses;
-
- const defaultNontemporalCovariates = {
- "temporal": false,
- "DemographicsGender": true,
- "DemographicsAgeGroup": true,
- "DemographicsRace": true,
- "DemographicsEthnicity": true,
- "DemographicsIndexMonth": true,
- "ConditionGroupEraLongTerm": true,
- "ConditionGroupEraShortTerm": true,
- "DrugGroupEraLongTerm": true,
- "DrugGroupEraShortTerm": true,
- "DrugGroupEraOverlapping": true,
- "ProcedureOccurrenceLongTerm": true,
- "ProcedureOccurrenceShortTerm": true,
- "DeviceExposureLongTerm": true,
- "DeviceExposureShortTerm": true,
- "MeasurementLongTerm": true,
- "MeasurementShortTerm": true,
- "MeasurementRangeGroupLongTerm": true,
- "ObservationLongTerm": true,
- "ObservationShortTerm": true,
- "CharlsonIndex": true,
- "Dcsi": true,
- "Chads2": true,
- "Chads2Vasc": true,
- "includedCovariateConceptIds": [],
- "includedCovariateIds": [],
- "addDescendantsToInclude": false,
- "excludedCovariateConceptIds": [],
- "addDescendantsToExclude": false,
- "shortTermStartDays": -30,
- "mediumTermStartDays": -180,
- "endDays": 0,
- "longTermStartDays": -365
- };
-
- const options = {
- removeButton: ``,
- targetOutcomeTableColumns: [
- {
- title: ko.i18n('columns.targetId', 'Target Id'),
- data: d => d.targetId,
- visible: false,
- },
- {
- title: ko.i18n('columns.targetName', 'Target Cohort Name'),
- data: d => d.targetName,
- },
- {
- title: ko.i18n('columns.outcomeId', 'Outcome Id'),
- data: d => d.outcomeId,
- visible: false,
- },
- {
- title: ko.i18n('columns.outcomeName', 'Outcome Cohort Name'),
- data: d => d.outcomeName,
- },
- ],
- modelCovarPopTupleTableColumns: [
- {
- title: ko.i18n('columns.modelName', 'Model Name'),
- data: d => d.modelName,
- },
- {
- title: ko.i18n('columns.modelSettings', 'Model Settings'),
- data: d => d.modelSettings,
- },
- {
- title: ko.i18n('columns.covariateSettings', 'Covariate Settings'),
- data: d => d.covariateSettings.substring(1,30) + "...",
- },
- {
- title: ko.i18n('columns.riskWindowStart', 'Risk Window Start'),
- data: d => d.popRiskWindowStart,
- },
- {
- title: ko.i18n('columns.riskWindowEnd', 'Risk Window End'),
- data: d => d.popRiskWindowEnd,
- },
- ],
- fullAnalysisTableColumns: [
- {
- title: ko.i18n('columns.targetId', 'Target Id'),
- data: d => d.targetOutcome.targetId,
- visible: false,
- },
- {
- title: ko.i18n('columns.targetName', 'Target Cohort Name'),
- data: d => d.targetOutcome.targetName,
- },
- {
- title: ko.i18n('columns.outcomeId', 'Outcome Id'),
- data: d => d.targetOutcome.outcomeId,
- visible: false,
- },
- {
- title: ko.i18n('columns.outcomeName', 'Outcome Cohort Name'),
- data: d => d.targetOutcome.outcomeName,
- },
- {
- title: ko.i18n('columns.modelName', 'Model Name'),
- data: d => d.modelCovarPopTuple.modelName,
- },
- {
- title: ko.i18n('columns.modelSettings', 'Model Settings'),
- data: d => d.modelCovarPopTuple.modelSettings,
- },
- {
- title: ko.i18n('columns.covariateSettings', 'Covariate Settings'),
- data: d => d.modelCovarPopTuple.covariateSettings.substring(1,30) + "...",
- },
- {
- title: ko.i18n('columns.riskWindowStart', 'Risk Window Start'),
- data: d => d.modelCovarPopTuple.popRiskWindowStart,
- },
- {
- title: ko.i18n('columns.riskWindowEnd', 'Risk Window End'),
- data: d => d.modelCovarPopTuple.popRiskWindowEnd,
- },
- ],
- fullAnalysisTableOptions: {
- ...commonUtils.getTableOptions('S'),
- dom: '<<"row vertical-align"<"col-xs-6"<"dt-btn"B>l><"col-xs-6 search"f>><"row vertical-align">
-
-
-
-
-
-
-
- Your study has invalid design that prevent you from reviewing the full specification details and downloading the study package. Please check "Messages" tab
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- " + - ko.unwrap(consts.timeAtRiskCohortDate.find(f => f.id === d.addExposureDaysToStart()).name); - }, - }, - { - title: ko.i18n('columns.riskWindowEnd', 'Risk Window End'), - render: (s, p, d) => { - return d.riskWindowEnd().toString() + - " " + - " " + - ko.unwrap(consts.timeAtRiskCohortDate.find(f => f.id === d.addExposureDaysToEnd()).name); - }, - }, - { - title: ko.i18n('columns.washoutPeriod', 'Washout Period'), - data: d => d.washoutPeriod().toString() + 'd', - }, - { - title: ko.i18n('columns.includeAllOutcomes', 'Include All Outcomes'), - data: d => d.includeAllOutcomes().toString(), - }, - { - title: ko.i18n('columns.removeSubjectsWithPriorOutcome', 'Remove Subjects With Prior Outcome'), - data: d => d.removeSubjectsWithPriorOutcome().toString(), - }, - { - title: ko.i18n('columns.priorOutcomeLookback', 'Prior Outcome Lookback'), - data: d => d.priorOutcomeLookback().toString() + 'd', - visible: false, - }, - { - title: ko.i18n('columns.requireTimeAtRisk', 'Require Time At Risk'), - data: d => d.requireTimeAtRisk().toString(), - visible: false, - }, - { - title: ko.i18n('columns.minimumTimeAtRisk', 'Minimum Time At Risk'), - data: d => d.minTimeAtRisk().toString() + 'd', - }, - ]; - - const getModelSettingsTableColumns = (canEdit) => [ - { - title: ko.i18n('columns.remove', 'Remove'), - render: (s, p, d) => { - return options.removeButton; - }, - orderable: false, - searchable: false, - className: 'col-remove', - visible: canEdit, - }, - { - title: ko.i18n('columns.model', 'Model'), - data: d => Object.keys(d)[0], - }, - { - title: ko.i18n('columns.options', 'Options'), - data: d => { - const key = Object.keys(d)[0]; - return ko.toJSON(d[key]); - }, - }, - ]; - - const getCovariateSettingsTableColumns = (canEdit) => [ - { - title: ko.i18n('columns.remove', 'Remove'), - render: (s, p, d) => { - return options.removeButton; - }, - orderable: false, - searchable: false, - className: 'col-remove', - visible: canEdit, - }, - { - title: ko.i18n('columns.temporal', 'Temporal'), - render: (s, p, d) => { - return Object.keys(d)[0] === 'temporal' ? 'Yes': 'No' - }, - visible: false, - }, - { - title: ko.i18n('columns.options', 'Options'), - render: (s, p, d, a, b, c) => { - const keys = Object.keys(d); - const vals = Object.values(d); - var settings = []; - const defaultDisplayLength = 5; - for (let i = 0; i < keys.length; i++) { - const currentVal = ko.isObservable(vals[i]) ? vals[i]() : vals[i]; - if (currentVal === true) { - settings.push(keys[i]); - } - } - if (settings.length > 1) { - let displayVal = ""; - settings.forEach((element, index) => { - if (index < defaultDisplayLength) { - if (index < settings.length - 1) { - displayVal += (element + ", "); - } else { - displayVal += element; - } - } else if (index === defaultDisplayLength) { - displayVal = displayVal + element + " (+" + (settings.length - defaultDisplayLength - 1) + " more covariate settings";
- } else if (index > defaultDisplayLength) {
- displayVal += ("" + element + "");
- }
- });
- if (settings.length > defaultDisplayLength) {
- displayVal += ") ";
- }
- return displayVal;
- } else if (settings.length === 1) {
- return settings[0];
- } else {
- return 'No covariate settings selected';
- }
- }
- },
- ];
-
- return {
- apiPaths,
- pageTitle,
- paths: paths,
- conceptSetCrossReference,
- defaultNontemporalCovariates,
- options,
- predictionGenerationStatus,
- getCohortTableColumns,
- getPopulationSettingsTableColumns,
- getModelSettingsTableColumns,
- getCovariateSettingsTableColumns,
- };
- }
-);
\ No newline at end of file
diff --git a/js/pages/prediction/index.js b/js/pages/prediction/index.js
deleted file mode 100644
index 9068e336c..000000000
--- a/js/pages/prediction/index.js
+++ /dev/null
@@ -1,35 +0,0 @@
-define(
- (require, exports) => {
- const ko = require('knockout');
- const buildRoutes = require('./routes');
- const appState = require('atlas-state');
- const constants = require('./const');
-
- const statusCss = ko.pureComputed(function () {
- if (appState.predictionAnalysis.current()) {
- return appState.predictionAnalysis.dirtyFlag().isDirty() ? "unsaved" : "open";
- }
- return "";
- });
-
- const navUrl = ko.pureComputed(function () {
- let url = constants.paths.browser();
- if (appState.predictionAnalysis.current()) {
- if (appState.predictionAnalysis.current().id() != null && appState.predictionAnalysis.current().id() > 0) {
- url = appState.predictionAnalysis.analysisPath(appState.predictionAnalysis.current().id());
- } else {
- url = constants.paths.createAnalysis();
- }
- }
- return url;
- });
-
- return {
- title: ko.i18n('navigation.prediction', 'Prediction'),
- buildRoutes,
- navUrl: navUrl,
- icon: 'heartbeat',
- statusCss: statusCss,
- };
- }
-);
\ No newline at end of file
diff --git a/js/pages/prediction/inputTypes/CreateStudyPopulationArgs.js b/js/pages/prediction/inputTypes/CreateStudyPopulationArgs.js
deleted file mode 100644
index c0812d1cd..000000000
--- a/js/pages/prediction/inputTypes/CreateStudyPopulationArgs.js
+++ /dev/null
@@ -1,28 +0,0 @@
-define([
- 'knockout',
- 'services/analysis/RLangClass',
- 'databindings',
-], function (
- ko,
- RLangClass
-) {
- class CreateStudyPopulationArgs extends RLangClass {
- constructor(data = {}) {
- super({"attr_class": "populationSettings"});
- this.binary = ko.observable(data.binary === undefined ? true : data.binary);
- this.includeAllOutcomes = ko.observable(data.includeAllOutcomes === undefined ? true : data.includeAllOutcomes);
- this.firstExposureOnly = ko.observable(data.firstExposureOnly === undefined ? false : data.firstExposureOnly);
- this.washoutPeriod = ko.observable(data.washoutPeriod === 0 ? 0 : data.washoutPeriod || 365).extend({ numeric: 0});
- this.removeSubjectsWithPriorOutcome = ko.observable(data.removeSubjectsWithPriorOutcome === undefined ? false : data.removeSubjectsWithPriorOutcome);
- this.priorOutcomeLookback = ko.observable(data.priorOutcomeLookback === 0 ? 0 : data.priorOutcomeLookback || 99999);
- this.requireTimeAtRisk = ko.observable(data.requireTimeAtRisk === undefined ? true : data.requireTimeAtRisk);
- this.minTimeAtRisk = ko.observable(data.minTimeAtRisk === 0 ? 0 : data.minTimeAtRisk || 364).extend({ numeric: 0});
- this.riskWindowStart = ko.observable(data.riskWindowStart === 0 ? 0 : data.riskWindowStart || 1).extend({ numeric: 0});
- this.addExposureDaysToStart = ko.observable(data.addExposureDaysToStart === undefined ? false : data.addExposureDaysToStart);
- this.riskWindowEnd = ko.observable(data.riskWindowEnd === 0 ? 0 : data.riskWindowEnd || 365).extend({ numeric: 0});
- this.addExposureDaysToEnd = ko.observable(data.addExposureDaysToEnd === undefined ? false : data.addExposureDaysToEnd);
- }
- }
-
- return CreateStudyPopulationArgs;
-});
\ No newline at end of file
diff --git a/js/pages/prediction/inputTypes/FullAnalysis.js b/js/pages/prediction/inputTypes/FullAnalysis.js
deleted file mode 100644
index 384d88424..000000000
--- a/js/pages/prediction/inputTypes/FullAnalysis.js
+++ /dev/null
@@ -1,23 +0,0 @@
-define([
- './TargetOutcome',
- './ModelCovarPopTuple'
-], function (
- TargetOutcome,
- ModelCovarPopTuple
-) {
- class FullAnalysis {
- constructor(targetOutcome, modelCovarPopTuple) {
- if (typeof targetOutcome !== TargetOutcome) {
- targetOutcome = new TargetOutcome(targetOutcome);
- }
- if (typeof modelCovarPopTuple !== ModelCovarPopTuple) {
- modelCovarPopTuple = new ModelCovarPopTuple(modelCovarPopTuple);
- }
-
- this.targetOutcome = targetOutcome || null;
- this.modelCovarPopTuple = modelCovarPopTuple || null;
- }
- }
-
- return FullAnalysis;
-});
\ No newline at end of file
diff --git a/js/pages/prediction/inputTypes/GetDbPlpDataArgs.js b/js/pages/prediction/inputTypes/GetDbPlpDataArgs.js
deleted file mode 100644
index 503c6eb71..000000000
--- a/js/pages/prediction/inputTypes/GetDbPlpDataArgs.js
+++ /dev/null
@@ -1,15 +0,0 @@
-define([
- 'knockout',
- 'databindings',
-], function (
- ko
-) {
- class GetDbPLPDataArgs {
- constructor(data = {}) {
- this.washoutPeriod = ko.observable(data.washoutPeriod === 0 ? 0 : data.washoutPeriod || 0).extend({numeric: 0});
- this.maxSampleSize = ko.observable(data.maxSampleSize || null);
- }
- }
-
- return GetDbPLPDataArgs;
-});
\ No newline at end of file
diff --git a/js/pages/prediction/inputTypes/ModelCovarPopTuple.js b/js/pages/prediction/inputTypes/ModelCovarPopTuple.js
deleted file mode 100644
index cd61f625f..000000000
--- a/js/pages/prediction/inputTypes/ModelCovarPopTuple.js
+++ /dev/null
@@ -1,17 +0,0 @@
-define([
- 'knockout',
-], function (
- ko
-) {
- class ModelCovarPopTuple {
- constructor(data = {}) {
- this.modelName = data.modelName || null;
- this.modelSettings = data.modelSettings || null;
- this.covariateSettings = data.covariateSettings ||null;
- this.popRiskWindowStart = data.popRiskWindowStart || null;
- this.popRiskWindowEnd = data.popRiskWindowEnd || null;
- }
- }
-
- return ModelCovarPopTuple;
-});
\ No newline at end of file
diff --git a/js/pages/prediction/inputTypes/ModelSettings.js b/js/pages/prediction/inputTypes/ModelSettings.js
deleted file mode 100644
index 5ea174ff8..000000000
--- a/js/pages/prediction/inputTypes/ModelSettings.js
+++ /dev/null
@@ -1,396 +0,0 @@
-define(function (require, exports) {
- var NaiveBayesSettings = require("./modelSettings/NaiveBayesSettings");
- var RandomForestSettings = require("./modelSettings/RandomForestSettings");
- var MLPSettings = require("./modelSettings/MLPSettings");
- var KNNSettings = require("./modelSettings/KNNSettings");
- var GradientBoostingMachineSettings = require("./modelSettings/GradientBoostingMachineSettings");
- var DecisionTreeSettings = require("./modelSettings/DecisionTreeSettings");
- var AdaBoostSettings = require("./modelSettings/AdaBoostSettings");
- var LassoLogisticRegressionSettings = require("./modelSettings/LassoLogisticRegressionSettings");
- var utils = require("../utils");
- var ko = require("knockout");
-
- function GetSettingNameFromObject(data) {
- if (data.hasOwnProperty("NaiveBayesSettings")) {
- return "NaiveBayesSettings";
- } else if (data.hasOwnProperty("RandomForestSettings")) {
- return "RandomForestSettings";
- } else if (data.hasOwnProperty("MLPSettings")) {
- return "MLPSettings";
- } else if (data.hasOwnProperty("KNNSettings")) {
- return "KNNSettings";
- } else if (data.hasOwnProperty("GradientBoostingMachineSettings")) {
- return "GradientBoostingMachineSettings";
- } else if (data.hasOwnProperty("DecisionTreeSettings")) {
- return "DecisionTreeSettings";
- } else if (data.hasOwnProperty("AdaBoostSettings")) {
- return "AdaBoostSettings";
- } else if (data.hasOwnProperty("LassoLogisticRegressionSettings")) {
- return "LassoLogisticRegressionSettings";
- }
- }
-
- function GetSettingsFromObject(data) {
- switch (this.GetSettingNameFromObject(data)) {
- case "NaiveBayesSettings":
- return {
- NaiveBayesSettings: new exports.NaiveBayesSettings(
- data.NaiveBayesSettings
- ),
- };
- break;
- case "RandomForestSettings":
- return {
- RandomForestSettings: new exports.RandomForestSettings(
- data.RandomForestSettings
- ),
- };
- break;
- case "MLPSettings":
- return {
- MLPSettings: new exports.MLPSettings(data.MLPSettings),
- };
- break;
- case "KNNSettings":
- return {
- KNNSettings: new exports.KNNSettings(data.KNNSettings),
- };
- break;
- case "GradientBoostingMachineSettings":
- return {
- GradientBoostingMachineSettings: new exports.GradientBoostingMachineSettings(
- data.GradientBoostingMachineSettings
- ),
- };
- break;
- case "DecisionTreeSettings":
- return {
- DecisionTreeSettings: new exports.DecisionTreeSettings(
- data.DecisionTreeSettings
- ),
- };
- break;
- case "AdaBoostSettings":
- return {
- AdaBoostSettings: new exports.AdaBoostSettings(data.AdaBoostSettings),
- };
- break;
- case "LassoLogisticRegressionSettings":
- return {
- LassoLogisticRegressionSettings: new exports.LassoLogisticRegressionSettings(
- data.LassoLogisticRegressionSettings
- ),
- };
- break;
- default:
- console.error("Model Settings not found!");
- break;
- }
- }
-
- function GetOptionsFromObject(data) {
- const settingName = this.GetSettingNameFromObject(data);
- return exports.options.find((f) => f.key === settingName);
- }
-
- exports.NaiveBayesSettings = NaiveBayesSettings;
- exports.RandomForestSettings = RandomForestSettings;
- exports.MLPSettings = MLPSettings;
- exports.KNNSettings = KNNSettings;
- exports.GradientBoostingMachineSettings = GradientBoostingMachineSettings;
- exports.DecisionTreeSettings = DecisionTreeSettings;
- exports.AdaBoostSettings = AdaBoostSettings;
- exports.LassoLogisticRegressionSettings = LassoLogisticRegressionSettings;
-
- exports.GetSettingNameFromObject = GetSettingNameFromObject;
- exports.GetSettingsFromObject = GetSettingsFromObject;
- exports.GetOptionsFromObject = GetOptionsFromObject;
-
- exports.options = [
- {
- key: "LassoLogisticRegressionSettings",
- name: "predictions.inputTypes.lassoLogisticRegression",
- defaultName: "Lasso Logistic Regression",
- editor: "lasso-logistic-regression-settings",
- action: () => {
- const defaultValues = utils.getDefaultModelSettingsValueList(
- "LassoLogisticRegressionSettings"
- );
- return {
- LassoLogisticRegressionSettings: new LassoLogisticRegressionSettings(
- defaultValues
- ),
- };
- },
- },
- {
- key: "RandomForestSettings",
- name: "predictions.inputTypes.randomForest",
- defaultName: "Random Forest",
- editor: "random-forest-settings",
- action: () => {
- const defaultValues = utils.getDefaultModelSettingsValueList(
- "RandomForestSettings"
- );
- return {
- RandomForestSettings: new RandomForestSettings(defaultValues),
- };
- },
- },
- {
- key: "GradientBoostingMachineSettings",
- name: "predictions.inputTypes.gradientBoostingMachine",
- defaultName: "Gradient Boosting Machine",
- editor: "gradient-boosting-machine-settings",
- action: () => {
- const defaultValues = utils.getDefaultModelSettingsValueList(
- "GradientBoostingMachineSettings"
- );
- return {
- GradientBoostingMachineSettings: new GradientBoostingMachineSettings(
- defaultValues
- ),
- };
- },
- },
- {
- key: "AdaBoostSettings",
- name: "predictions.inputTypes.adaBoost",
- defaultName: "Ada Boost",
- editor: "ada-boost-settings",
- action: () => {
- const defaultValues = utils.getDefaultModelSettingsValueList(
- "AdaBoostSettings"
- );
- return {
- AdaBoostSettings: new AdaBoostSettings(defaultValues),
- };
- },
- },
- {
- key: "DecisionTreeSettings",
- name: "predictions.inputTypes.decisionTree",
- defaultName: "Decision Tree",
- editor: "decision-tree-settings",
- action: () => {
- const defaultValues = utils.getDefaultModelSettingsValueList(
- "DecisionTreeSettings"
- );
- return {
- DecisionTreeSettings: new DecisionTreeSettings(defaultValues),
- };
- },
- },
- {
- key: "NaiveBayesSettings",
- name: "predictions.inputTypes.naiveBayes",
- defaultName: "Naive Bayes",
- editor: "naive-bayes-settings",
- action: () => {
- var defaultValues = utils.getDefaultModelSettingsValueList(
- "NaiveBayesSettings"
- );
- return {
- NaiveBayesSettings: new NaiveBayesSettings(defaultValues),
- };
- },
- },
- {
- key: "MLPSettings",
- name: "predictions.inputTypes.multilayerPerceptionModel",
- defaultName: "Multilayer Perception Model",
- editor: "mlp-settings",
- action: () => {
- const defaultValues = utils.getDefaultModelSettingsValueList(
- "MLPSettings"
- );
- return {
- MLPSettings: new MLPSettings(defaultValues),
- };
- },
- },
- {
- key: "KNNSettings",
- name: "predictions.inputTypes.nearestNeighbors",
- defaultName: "K Nearest Neighbors",
- editor: "knn-settings",
- action: () => {
- const defaultValues = utils.getDefaultModelSettingsValueList(
- "KNNSettings"
- );
- return {
- KNNSettings: new KNNSettings(defaultValues),
- };
- },
- },
- ];
-
- exports.defaultModelSettings = [
- {
- name: 'RandomForestSettings',
- modelSettings: [
- {
- setting: 'maxDepth',
- name: ko.i18n('predictions.inputTypes.randomForestSettings.name_maxDepth', 'Max depth'),
- description: ko.i18n('predictions.inputTypes.randomForestSettings.desc_maxDepth', 'Maximum number of interactions - a large value will lead to slow model training'),
- defaultValue: [4, 10, 17],
- },
- {
- setting: 'mtries',
- name: ko.i18n('predictions.inputTypes.randomForestSettings.name_mtries', 'Number of tree features'),
- description: ko.i18n('predictions.inputTypes.randomForestSettings.desc_mtries', 'The number of features to include in each tree (-1 defaults to square root of total features)'),
- defaultValue: [-1],
- },
- {
- setting: 'ntrees',
- name: ko.i18n('predictions.inputTypes.randomForestSettings.name_ntrees', 'Number of tress to build'),
- description: ko.i18n('predictions.inputTypes.randomForestSettings.desc_ntrees', 'The number of trees to build'),
- defaultValue: [500],
- },
- {
- setting: 'varImp',
- name: ko.i18n('predictions.inputTypes.randomForestSettings.name_varImp', 'Perform an initial variable selection'),
- description: ko.i18n('predictions.inputTypes.randomForestSettings.desc_varImp', 'Perform an initial variable selection prior to fitting the model to select the useful variables'),
- defaultValue: [true],
- },
- ],
- },
- {
- name: 'NaiveBayesSettings',
- modelSettings: [],
- },
- {
- name: 'MLPSettings',
- modelSettings: [
- {
- setting: 'alpha',
- name: ko.i18n('predictions.inputTypes.mlpSettings.name_alpha','Alpha'),
- description: ko.i18n('predictions.inputTypes.mlpSettings.desc_alpha', 'The l2 regularisation'),
- defaultValue: [0.00001],
- },
- {
- setting: 'size',
- name: ko.i18n('predictions.inputTypes.mlpSettings.name_size', 'Number of hidden nodes'),
- description: ko.i18n('predictions.inputTypes.mlpSettings.desc_size', 'The number of hidden nodes'),
- defaultValue: [4],
- },
- ],
- },
- {
- name: 'KNNSettings',
- id: 4,
- modelSettings: [
- {
- setting: 'k',
- name: ko.i18n('predictions.inputTypes.knnSettings.name_k', 'Number of neighbors'),
- description: ko.i18n('predictions.inputTypes.knnSettings.desc_k', 'The number of neighbors to consider'),
- defaultValue: 1000,
- },
- ],
- },
- {
- name: 'GradientBoostingMachineSettings',
- modelSettings: [
- {
- setting: 'learnRate',
- name: ko.i18n('predictions.inputTypes.gradientBoostingMachineSettings.name_learnRate', 'Boosting learn rate'),
- description: ko.i18n('predictions.inputTypes.gradientBoostingMachineSettings.desc_learnRate', 'The boosting learn rate'),
- defaultValue: [0.01, 0.1],
- },
- {
- setting: 'maxDepth',
- name: ko.i18n('predictions.inputTypes.gradientBoostingMachineSettings.name_maxDepth', 'Maximum number of interactions'),
- description: ko.i18n('predictions.inputTypes.gradientBoostingMachineSettings.desc_maxDepth', 'Maximum number of interactions - a large value will lead to slow model training'),
- defaultValue: [4, 6, 17],
- },
- {
- setting: 'minRows',
- name: ko.i18n('predictions.inputTypes.gradientBoostingMachineSettings.name_minRows', 'Minimum number of rows'),
- description: ko.i18n('predictions.inputTypes.gradientBoostingMachineSettings.desc_minRows', 'The minimum number of rows required at each end node of the tree'),
- defaultValue: [20],
- },
- {
- setting: 'nthread',
- name: ko.i18n('predictions.inputTypes.gradientBoostingMachineSettings.name_nthread', 'Computer threads for computation'),
- description: ko.i18n('predictions.inputTypes.gradientBoostingMachineSettings.desc_nthread', 'The number of computer threads to use (how many cores do you have?)'),
- defaultValue: 20,
- },
- {
- setting: 'ntrees',
- name: ko.i18n('predictions.inputTypes.gradientBoostingMachineSettings.name_ntrees', 'Trees to build'),
- description: ko.i18n('predictions.inputTypes.gradientBoostingMachineSettings.desc_ntrees', 'The number of trees to build'),
- defaultValue: [10, 100],
- },
- ],
- },
- {
- name: 'DecisionTreeSettings',
- modelSettings: [
- {
- setting: 'classWeight',
- name: ko.i18n('predictions.inputTypes.decisionTreeSettings.name_classWeight', 'Class weight'),
- description: ko.i18n('predictions.inputTypes.decisionTreeSettings.desc_classWeight', 'Class weight'),
- defaultValue: ['None'],
- },
- {
- setting: 'maxDepth',
- name: ko.i18n('predictions.inputTypes.decisionTreeSettings.name_maxDepth', 'Max depth'),
- description: ko.i18n('predictions.inputTypes.decisionTreeSettings.desc_maxDepth', 'Maximum number of interactions - a large value will lead to slow model training'),
- defaultValue: [10],
- },
- {
- setting: 'minImpurityDecrease',
- name: ko.i18n('predictions.inputTypes.decisionTreeSettings.name_minImpurityDecrease', 'Minimum impurity split'),
- description: ko.i18n('predictions.inputTypes.decisionTreeSettings.desc_minImpurityDecrease', 'Threshold for early stopping in tree growth. A node will split if its impurity is above the threshold, otherwise it is a leaf.'),
- defaultValue: [0.0000001],
- },
- {
- setting: 'minSamplesLeaf',
- name: ko.i18n('predictions.inputTypes.decisionTreeSettings.name_minSamplesLeaf', 'Minimum samples per leaf'),
- description: ko.i18n('predictions.inputTypes.decisionTreeSettings.desc_minSamplesLeaf', 'The minimum number of samples per leaf'),
- defaultValue: [10],
- },
- {
- setting: 'minSamplesSplit',
- name: ko.i18n('predictions.inputTypes.decisionTreeSettings.name_minSamplesSplit', 'Minimum samples per split'),
- description: ko.i18n('predictions.inputTypes.decisionTreeSettings.desc_minSamplesSplit', 'The minimum samples per split'),
- defaultValue: [2],
- },
- {
- setting: 'plot',
- name: ko.i18n('predictions.inputTypes.decisionTreeSettings.name_plot', 'Minimum samples per split'),
- description: ko.i18n('predictions.inputTypes.decisionTreeSettings.desc_plot', 'The minimum samples per split'),
- defaultValue: false,
- },
- ],
- },
- {
- name: 'AdaBoostSettings',
- modelSettings: [
- {
- setting: 'learningRate',
- name: ko.i18n('predictions.inputTypes.adaBoostSettings.name_learningRate', 'Learning rate'),
- description: ko.i18n('predictions.inputTypes.adaBoostSettings.desc_learningRate', 'Learning rate shrinks the contribution of each classifier. There is a trade-off between learning rate and nEstimators.'),
- defaultValue: [1],
- },
- {
- setting: 'nEstimators',
- name: ko.i18n('predictions.inputTypes.adaBoostSettings.name_nEstimators', 'Maximum number of estimators'),
- description: ko.i18n('predictions.inputTypes.adaBoostSettings.desc_nEstimators', 'The maximum number of estimators at which boosting is terminated'),
- defaultValue: [50],
- },
- ],
- },
- {
- name: 'LassoLogisticRegressionSettings',
- modelSettings: [
- {
- setting: 'variance',
- name: ko.i18n('predictions.inputTypes.lassoLogisticRegressionSettings.name', 'Starting value for the automatic lambda search'),
- description: ko.i18n('predictions.inputTypes.lassoLogisticRegressionSettings.desc', 'A single value used as the starting value for the automatic lambda search'),
- defaultValue: 0.01,
- },
- ],
- },
- ];
-});
diff --git a/js/pages/prediction/inputTypes/PatientLevelPredictionAnalysis.js b/js/pages/prediction/inputTypes/PatientLevelPredictionAnalysis.js
deleted file mode 100644
index 8e26a8656..000000000
--- a/js/pages/prediction/inputTypes/PatientLevelPredictionAnalysis.js
+++ /dev/null
@@ -1,52 +0,0 @@
-define([
- 'knockout',
- '../../../components/cohortbuilder/CohortDefinition',
- 'components/conceptset/InputTypes/ConceptSet',
- 'services/analysis/ConceptSetCrossReference',
- './PredictionCovariateSettings',
- "./CreateStudyPopulationArgs",
- './GetDbPlpDataArgs',
- './ModelSettings',
- './RunPlpArgs',
-], function (
- ko,
- CohortDefinition,
- ConceptSet,
- ConceptSetCrossReference,
- CovariateSettings,
- CreateStudyPopulationArgs,
- GetDbPlpDataArgs,
- ModelSettings,
- RunPlpArgs
-) {
- class PatientLevelPrediction {
- constructor(data = {}) {
- this.id = ko.observable(data.id || null);
- this.name = ko.observable(data.name || null);
- this.description = ko.observable(data.description || null);
- this.version = ko.observable(data.version || "v2.7.0");
- this.description = ko.observable(data.description || null);
- this.packageName = ko.observable(data.packageName || null);
- this.skeletonType = data.skeletonType || "PatientLevelPredictionStudy";
- this.skeletonVersion = data.skeletonVersion || "v0.0.1";
- this.createdBy = data.createdBy || null;
- this.createdDate = data.createdDate || null;
- this.modifiedBy = data.modifiedBy || null;
- this.modifiedDate = data.modifiedDate || null;
- this.cohortDefinitions = ko.observableArray(data.cohortDefinitions && data.cohortDefinitions.map(function(d) { return new CohortDefinition(d) }));
- this.conceptSets = ko.observableArray(data.conceptSets && data.conceptSets.map(function(d) { return new ConceptSet(d) }));
- this.conceptSetCrossReference = ko.observableArray(data.conceptSetCrossReference && data.conceptSetCrossReference.map(function(d) { return new ConceptSetCrossReference(d) }));
- this.targetIds = ko.observableArray(data.targetIds && data.targetIds.map(function(d) { return d }));
- this.outcomeIds = ko.observableArray(data.outcomeIds && data.outcomeIds.map(function(d) { return d }));
- this.covariateSettings = ko.observableArray(data.covariateSettings && data.covariateSettings.map(function(d) { return new CovariateSettings(d) }));
- this.populationSettings = ko.observableArray(data.populationSettings && data.populationSettings.map(function(d) { return new CreateStudyPopulationArgs(d)}));
- this.modelSettings = ko.observableArray(data.modelSettings && data.modelSettings.map(function (d) {
- return ModelSettings.GetSettingsFromObject(d)
- }));
- this.getPlpDataArgs = new GetDbPlpDataArgs(data.getPlpDataArgs);
- this.runPlpArgs = new RunPlpArgs(data.runPlpArgs);
- }
- }
-
- return PatientLevelPrediction;
-});
\ No newline at end of file
diff --git a/js/pages/prediction/inputTypes/PredictionCovariateSettings.js b/js/pages/prediction/inputTypes/PredictionCovariateSettings.js
deleted file mode 100644
index ac562d5e8..000000000
--- a/js/pages/prediction/inputTypes/PredictionCovariateSettings.js
+++ /dev/null
@@ -1,18 +0,0 @@
-define([
- 'knockout',
- 'featureextraction/InputTypes/CovariateSettings',
- 'services/analysis/ConceptSet',
-], function (
- ko,
- CovariateSettings,
- ConceptSet
-){
- class PredictionCovariateSettings extends CovariateSettings {
- constructor(data) {
- super(data);
- this.includedCovariateConceptSet = ko.observable(data.includedCovariateConceptSet !== null ? new ConceptSet(data.includedCovariateConceptSet) : new ConceptSet());
- this.excludedCovariateConceptSet = ko.observable(data.excludedCovariateConceptSet !== null ? new ConceptSet(data.excludedCovariateConceptSet) : new ConceptSet());
- }
- }
- return PredictionCovariateSettings;
-});
\ No newline at end of file
diff --git a/js/pages/prediction/inputTypes/RunPlpArgs.js b/js/pages/prediction/inputTypes/RunPlpArgs.js
deleted file mode 100644
index d970c5116..000000000
--- a/js/pages/prediction/inputTypes/RunPlpArgs.js
+++ /dev/null
@@ -1,19 +0,0 @@
-define([
- 'knockout',
- 'databindings',
-], function (
- ko
-) {
- class RunPlpArgs {
- constructor(data = {}) {
- this.minCovariateFraction = ko.observable(data.minCovariateFraction === 0 ? 0 : data.minCovariateFraction || 0.001).extend({numeric: 5});
- this.normalizeData = ko.observable(data.normalizeData === undefined ? true : data.normalizeData);
- this.testSplit = ko.observable(data.testSplit || "person");
- this.testFraction = ko.observable(data.testFraction === 0 ? 0 : data.testFraction || 0.25).extend({numeric: 2});
- this.splitSeed = ko.observable(data.splitSeed || null).extend({numeric: 0});
- this.nfold = ko.observable(data.nfold || 3);
- }
- }
-
- return RunPlpArgs;
-});
\ No newline at end of file
diff --git a/js/pages/prediction/inputTypes/TargetOutcome.js b/js/pages/prediction/inputTypes/TargetOutcome.js
deleted file mode 100644
index f3cb2ab0b..000000000
--- a/js/pages/prediction/inputTypes/TargetOutcome.js
+++ /dev/null
@@ -1,16 +0,0 @@
-define([
- 'knockout',
-], function (
- ko
-) {
- class TargetOutcome {
- constructor(data = {}) {
- this.targetId = data.targetId || null;
- this.targetName = data.targetName || null;
- this.outcomeId = data.outcomeId ||null;
- this.outcomeName = data.outcomeName || null;
- }
- }
-
- return TargetOutcome;
-});
\ No newline at end of file
diff --git a/js/pages/prediction/inputTypes/modelSettings/AdaBoostSettings.js b/js/pages/prediction/inputTypes/modelSettings/AdaBoostSettings.js
deleted file mode 100644
index f0ec59134..000000000
--- a/js/pages/prediction/inputTypes/modelSettings/AdaBoostSettings.js
+++ /dev/null
@@ -1,16 +0,0 @@
-define([
- 'knockout',
- 'databindings',
-], function (
- ko
-) {
- class AdaBoostSettings {
- constructor(data = {}) {
- this.nEstimators = ko.observableArray((data.nEstimators && Array.isArray(data.nEstimators)) ? data.nEstimators.slice() : [50]);
- this.learningRate = ko.observableArray((data.learningRate && Array.isArray(data.learningRate)) ? data.learningRate.slice() : [1]);
- this.seed = ko.observable(data.seed || null);
- }
- }
-
- return AdaBoostSettings;
-});
\ No newline at end of file
diff --git a/js/pages/prediction/inputTypes/modelSettings/DecisionTreeSettings.js b/js/pages/prediction/inputTypes/modelSettings/DecisionTreeSettings.js
deleted file mode 100644
index 57af790f0..000000000
--- a/js/pages/prediction/inputTypes/modelSettings/DecisionTreeSettings.js
+++ /dev/null
@@ -1,19 +0,0 @@
-define([
- 'knockout',
- 'databindings',
-], function (
- ko
-) {
- class DecisionTreeSettings {
- constructor(data = {}) {
- this.maxDepth = ko.observableArray((data.maxDepth && Array.isArray(data.maxDepth)) ? data.maxDepth.slice() : [10]);
- this.minSamplesSplit = ko.observableArray((data.minSamplesSplit && Array.isArray(data.minSamplesSplit)) ? data.minSamplesSplit.slice() : [2]);
- this.minSamplesLeaf = ko.observableArray((data.minSamplesLeaf && Array.isArray(data.minSamplesLeaf)) ? data.minSamplesLeaf.slice() : [10]);
- this.minImpurityDecrease = ko.observableArray((data.minImpurityDecrease && Array.isArray(data.minImpurityDecrease)) ? data.minImpurityDecrease.slice() : [0.0000001]);
- this.classWeight = ko.observableArray((data.classWeight && Array.isArray(data.classWeight)) ? data.classWeight.slice() : ["None"]);
- this.plot = ko.observable(data.plot === undefined ? false : data.plot);
- }
- }
-
- return DecisionTreeSettings;
-});
\ No newline at end of file
diff --git a/js/pages/prediction/inputTypes/modelSettings/GradientBoostingMachineSettings.js b/js/pages/prediction/inputTypes/modelSettings/GradientBoostingMachineSettings.js
deleted file mode 100644
index 1545f9910..000000000
--- a/js/pages/prediction/inputTypes/modelSettings/GradientBoostingMachineSettings.js
+++ /dev/null
@@ -1,19 +0,0 @@
-define([
- 'knockout',
- 'databindings',
-], function (
- ko
-) {
- class GradientBoostingMachineSettings {
- constructor(data = {}) {
- this.ntrees = ko.observableArray((data.ntrees && Array.isArray(data.ntrees)) ? data.ntrees.slice() : []);
- this.nthread = ko.observable(data.nthread === 0 ? 0 : data.nthread || 20);
- this.maxDepth = ko.observableArray((data.maxDepth && Array.isArray(data.maxDepth)) ? data.maxDepth.slice() : []);
- this.minRows = ko.observableArray(data.minRows && Array.isArray(data.minRows) ? data.minRows.slice() : [20]);
- this.learnRate = ko.observableArray((data.learnRate && Array.isArray(data.learnRate)) ? data.learnRate.slice() : []);
- this.seed = ko.observable(data.seed || null);
- }
- }
-
- return GradientBoostingMachineSettings;
-});
\ No newline at end of file
diff --git a/js/pages/prediction/inputTypes/modelSettings/KNNSettings.js b/js/pages/prediction/inputTypes/modelSettings/KNNSettings.js
deleted file mode 100644
index 285e2c7cc..000000000
--- a/js/pages/prediction/inputTypes/modelSettings/KNNSettings.js
+++ /dev/null
@@ -1,14 +0,0 @@
-define([
- 'knockout',
- 'databindings',
-], function (
- ko
-) {
- class KNNSettings {
- constructor(data = {}) {
- this.k = ko.observable(data.k === 0 ? 0 : data.k || 1000).extend({numeric: 0});
- }
- }
-
- return KNNSettings;
-});
\ No newline at end of file
diff --git a/js/pages/prediction/inputTypes/modelSettings/LassoLogisticRegressionSettings.js b/js/pages/prediction/inputTypes/modelSettings/LassoLogisticRegressionSettings.js
deleted file mode 100644
index df678bcfb..000000000
--- a/js/pages/prediction/inputTypes/modelSettings/LassoLogisticRegressionSettings.js
+++ /dev/null
@@ -1,15 +0,0 @@
-define([
- 'knockout',
- 'databindings',
-], function (
- ko
-) {
- class LassoLogisticRegressionSettings {
- constructor(data = {}) {
- this.variance = ko.observable(data.variance === 0 ? 0 : data.variance || 0.01).extend({numeric: 9});
- this.seed = ko.observable(data.seed || null);
- }
- }
-
- return LassoLogisticRegressionSettings;
-});
\ No newline at end of file
diff --git a/js/pages/prediction/inputTypes/modelSettings/MLPSettings.js b/js/pages/prediction/inputTypes/modelSettings/MLPSettings.js
deleted file mode 100644
index 6698a7b85..000000000
--- a/js/pages/prediction/inputTypes/modelSettings/MLPSettings.js
+++ /dev/null
@@ -1,16 +0,0 @@
-define([
- 'knockout',
- 'databindings',
-], function (
- ko
-) {
- class MLPSettings {
- constructor(data = {}) {
- this.size = ko.observableArray((data.size && Array.isArray(data.size)) ? data.size.slice() : [4]);
- this.alpha = ko.observableArray((data.alpha && Array.isArray(data.alpha)) ? data.alpha.slice() : [0.00001]);
- this.seed = ko.observable(data.seed || null);
- }
- }
-
- return MLPSettings;
-});
\ No newline at end of file
diff --git a/js/pages/prediction/inputTypes/modelSettings/NaiveBayesSettings.js b/js/pages/prediction/inputTypes/modelSettings/NaiveBayesSettings.js
deleted file mode 100644
index ad4f8e9da..000000000
--- a/js/pages/prediction/inputTypes/modelSettings/NaiveBayesSettings.js
+++ /dev/null
@@ -1,12 +0,0 @@
-define([
- 'knockout',
-], function (
- ko
-) {
- class NaiveBayesSettings {
- constructor(data = {}) {
- }
- }
-
- return NaiveBayesSettings;
-});
\ No newline at end of file
diff --git a/js/pages/prediction/inputTypes/modelSettings/RandomForestSettings.js b/js/pages/prediction/inputTypes/modelSettings/RandomForestSettings.js
deleted file mode 100644
index 6f7c4406f..000000000
--- a/js/pages/prediction/inputTypes/modelSettings/RandomForestSettings.js
+++ /dev/null
@@ -1,18 +0,0 @@
-define([
- 'knockout',
- 'databindings',
-], function (
- ko
-) {
- class RandomForestSettings {
- constructor(data = {}) {
- this.mtries = ko.observableArray((data.mtries && Array.isArray(data.mtries)) ? data.mtries.slice() : [-1]);
- this.ntrees = ko.observableArray((data.ntrees && Array.isArray(data.ntrees)) ? data.ntrees.slice() : [500]);
- this.maxDepth = ko.observableArray((data.maxDepth && Array.isArray(data.maxDepth)) ? data.maxDepth.slice() : []);
- this.varImp = ko.observableArray((data.varImp && Array.isArray(data.varImp)) ? data.varImp.slice() : [true]);
- this.seed = ko.observable(data.seed || null);
- }
- }
-
- return RandomForestSettings;
-});
\ No newline at end of file
diff --git a/js/pages/prediction/prediction-browser.html b/js/pages/prediction/prediction-browser.html
deleted file mode 100644
index a85cdf631..000000000
--- a/js/pages/prediction/prediction-browser.html
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- |