diff --git a/build/dev/lib/js/analysis/analysis.js b/build/dev/lib/js/analysis/analysis.js index b187be4..1200a79 100644 --- a/build/dev/lib/js/analysis/analysis.js +++ b/build/dev/lib/js/analysis/analysis.js @@ -1,2 +1,2 @@ -"use strict";define([],function(){return{analysisCategories:[{id:0,name:"Simple linear regression analysis"},{id:1,name:"Multiple linear regression analysis"},{id:2,name:"Statistical hypothesis testing"},{id:7,name:"Variance analysis"},{id:6,name:"Principal Component Analysis (PCA)"},{id:3,name:"Time series analysis"},{id:4,name:"Clustering"},{id:8,name:"Classification"},{id:5,name:"Text mining"}],analysisTypes:[{id:0,category:0,name:"Line chart with linear regression line",file:"simple_linear_line",minDims:1,minMeas:1,sortId:2,allowAddMea:!1,setCustomButtonLabel:!1},{id:1,category:0,name:"Scatter plot with linear regression line",file:"simple_linear_bubble",minDims:1,minMeas:2,sortId:3,allowAddMea:!1,setCustomButtonLabel:!1},{id:2,category:2,name:"F-Test",file:"f_test",minDims:1,minMeas:2,sortId:1,allowAddMea:!1,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Dataset A","Add measure - Dataset B"],meaButtonLabelOthers:""},{id:3,category:2,name:"T-Test - Two sample T-Test",file:"t_test",minDims:1,minMeas:2,sortId:2,allowAddMea:!1,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Dataset A","Add measure - Dataset B"],meaButtonLabelOthers:""},{id:4,category:2,name:"T-Test - Welch two sample T-Test",file:"t_test",minDims:1,minMeas:2,sortId:3,allowAddMea:!1,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Dataset A","Add measure - Dataset B"],meaButtonLabelOthers:""},{id:5,category:2,name:"T-Test - Paired T-Test",file:"t_test",minDims:1,minMeas:2,sortId:4,allowAddMea:!1,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Dataset A","Add measure - Dataset B"],meaButtonLabelOthers:""},{id:6,category:3,name:"Autocorrelation",file:"autocorrelation",minDims:1,minMeas:1,sortId:1,allowAddMea:!1,setCustomButtonLabel:!1},{id:7,category:3,name:"Ljung-Box Test",file:"ljung_box_test",minDims:1,minMeas:1,sortId:2,allowAddMea:!1,setCustomButtonLabel:!1},{id:8,category:3,name:"Decomposing time series",file:"timeseries_decomposition",minDims:1,minMeas:1,sortId:3,allowAddMea:!1,setCustomButtonLabel:!1},{id:9,category:3,name:"ARIMA forecast",file:"timeseries_forecast",minDims:1,minMeas:1,sortId:6,setCustomButtonLabel:!1},{id:10,category:4,name:"k-means clustering",file:"kmeans",minDims:1,minMeas:2,sortId:1,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Dataset: X-axis","Add measure - Dataset: Y-axis"],meaButtonLabelOthers:"Add measure - Dataset"},{id:11,category:1,name:"Multiple regression analysis",file:"regression_analysis",minDims:1,minMeas:2,sortId:1,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"},{id:12,category:3,name:"Augmented Dickey-Fuller Test",file:"augmented_dickey_fuller_test",minDims:1,minMeas:1,sortId:4,allowAddMea:!1},{id:13,category:5,name:"Text mining / Wordcloud",file:"textmining_wordcloud",minDims:2,minMeas:0,sortId:1,allowAddMea:!1},{id:14,category:1,name:"Correlation matrix heatmap",file:"correlation_heatmap",minDims:1,minMeas:2,sortId:4,allowAddMea:!0},{id:15,category:1,name:"Plot regression coefficients",file:"coefplot",minDims:1,minMeas:2,sortId:3,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"},{id:16,category:4,name:"k-means clustering (3D)",file:"kmeans_3d",minDims:1,minMeas:3,sortId:2,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Dataset: X-axis","Add measure - Dataset: Y-axis","Add measure - Dataset: Z-axis"],meaButtonLabelOthers:"Add measure - Dataset"},{id:17,category:1,name:"Line chart with multiple regression line",file:"regression_analysis_line_chart",minDims:1,minMeas:2,sortId:2,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"},{id:18,category:6,name:"Principal Component Analysis (PCA)",file:"pca",minDims:1,minMeas:2,sortId:1,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Variable field","Add measure - Variable field"],meaButtonLabelOthers:"Add measure - Variable field"},{id:19,category:6,name:"PCA - Biplot",file:"pca_biplot",minDims:1,minMeas:2,sortId:3,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Variable field","Add measure - Variable field"],meaButtonLabelOthers:"Add measure - Variable field"},{id:20,category:6,name:"PCA - Variance plot",file:"pca_variance",minDims:1,minMeas:2,sortId:2,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Variable field","Add measure - Variable field"],meaButtonLabelOthers:"Add measure - Variable field"},{id:21,category:7,name:"ANOVA - Single factor",file:"anova",minDims:2,minMeas:1,sortId:1},{id:22,category:7,name:"Tukey - Single factor",file:"tukey",minDims:2,minMeas:1,sortId:2},{id:23,category:4,name:"Find optimal number of clusters",file:"kmeans_optimize",minDims:1,minMeas:2,sortId:4,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Dataset","Add measure - Dataset"],meaButtonLabelOthers:"Add measure - Dataset"},{id:24,category:4,name:"k-means - Cluster means/centers",file:"kmeans_means",minDims:1,minMeas:2,sortId:3,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Dataset: X-axis","Add measure - Dataset: Y-axis"],meaButtonLabelOthers:"Add measure - Dataset"},{id:25,category:8,name:"Decision tree",file:"decision_tree",minDims:1,minMeas:2,sortId:0,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"},{id:26,category:8,name:"Decision tree - Evaluate model",file:"decision_tree_predict",minDims:1,minMeas:2,sortId:1,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"},{id:27,category:8,name:"Logistic regression analysis",file:"logistic_regression",minDims:1,minMeas:2,sortId:2,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"},{id:28,category:8,name:"Logistic regression - Evaluate model",file:"logistic_regression_predict",minDims:1,minMeas:2,sortId:3,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"},{id:29,category:8,name:"Logistic regression - Plot coefficients",file:"logistic_regression_coefplot",minDims:1,minMeas:2,sortId:4,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"},{id:14,category:8,name:"Correlation matrix heatmap",file:"correlation_heatmap",minDims:1,minMeas:2,sortId:5,allowAddMea:!0},{id:30,category:3,name:"Holt-Winters",file:"holt_winters",minDims:1,minMeas:1,sortId:5,setCustomButtonLabel:!1}].sort(function(e,a){return e.sortId-a.sortId})}}); +"use strict";define([],function(){return{analysisCategories:[{id:0,name:"Simple linear regression analysis"},{id:1,name:"Multiple linear regression analysis"},{id:2,name:"Statistical hypothesis testing"},{id:7,name:"Variance analysis"},{id:6,name:"Principal Component Analysis (PCA)"},{id:3,name:"Time series analysis"},{id:4,name:"Clustering"},{id:8,name:"Classification"},{id:5,name:"Text mining"}],analysisTypes:[{id:0,category:0,name:"Line chart with linear regression line",file:"simple_linear_line",minDims:1,minMeas:1,sortId:2,allowAddMea:!1,setCustomButtonLabel:!1},{id:1,category:0,name:"Scatter plot with linear regression line",file:"simple_linear_bubble",minDims:1,minMeas:2,sortId:3,allowAddMea:!1,setCustomButtonLabel:!1},{id:2,category:2,name:"F-Test",file:"f_test",minDims:1,minMeas:2,sortId:1,allowAddMea:!1,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Dataset A","Add measure - Dataset B"],meaButtonLabelOthers:""},{id:3,category:2,name:"T-Test - Two sample T-Test",file:"t_test",minDims:1,minMeas:2,sortId:2,allowAddMea:!1,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Dataset A","Add measure - Dataset B"],meaButtonLabelOthers:""},{id:4,category:2,name:"T-Test - Welch two sample T-Test",file:"t_test",minDims:1,minMeas:2,sortId:3,allowAddMea:!1,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Dataset A","Add measure - Dataset B"],meaButtonLabelOthers:""},{id:5,category:2,name:"T-Test - Paired T-Test",file:"t_test",minDims:1,minMeas:2,sortId:4,allowAddMea:!1,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Dataset A","Add measure - Dataset B"],meaButtonLabelOthers:""},{id:6,category:3,name:"Autocorrelation",file:"autocorrelation",minDims:1,minMeas:1,sortId:1,allowAddMea:!1,setCustomButtonLabel:!1},{id:7,category:3,name:"Ljung-Box Test",file:"ljung_box_test",minDims:1,minMeas:1,sortId:2,allowAddMea:!1,setCustomButtonLabel:!1},{id:8,category:3,name:"Decomposing time series",file:"timeseries_decomposition",minDims:1,minMeas:1,sortId:3,allowAddMea:!1,setCustomButtonLabel:!1},{id:9,category:3,name:"ARIMA forecast",file:"timeseries_forecast",minDims:1,minMeas:1,sortId:6,setCustomButtonLabel:!1},{id:10,category:4,name:"k-means clustering",file:"kmeans",minDims:1,minMeas:2,sortId:1,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Dataset: X-axis","Add measure - Dataset: Y-axis"],meaButtonLabelOthers:"Add measure - Dataset"},{id:11,category:1,name:"Multiple regression analysis",file:"regression_analysis",minDims:1,minMeas:2,sortId:1,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"},{id:12,category:3,name:"Augmented Dickey-Fuller Test",file:"augmented_dickey_fuller_test",minDims:1,minMeas:1,sortId:4,allowAddMea:!1},{id:13,category:5,name:"Text mining / Wordcloud",file:"textmining_wordcloud",minDims:2,minMeas:0,sortId:1,allowAddMea:!1},{id:14,category:1,name:"Correlation matrix heatmap",file:"correlation_heatmap",minDims:1,minMeas:2,sortId:4,allowAddMea:!0},{id:15,category:1,name:"Plot regression coefficients",file:"coefplot",minDims:1,minMeas:2,sortId:3,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"},{id:16,category:4,name:"k-means clustering (3D)",file:"kmeans_3d",minDims:1,minMeas:3,sortId:2,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Dataset: X-axis","Add measure - Dataset: Y-axis","Add measure - Dataset: Z-axis"],meaButtonLabelOthers:"Add measure - Dataset"},{id:17,category:1,name:"Line chart with multiple regression line",file:"regression_analysis_line_chart",minDims:1,minMeas:2,sortId:2,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"},{id:18,category:6,name:"Principal Component Analysis (PCA)",file:"pca",minDims:1,minMeas:2,sortId:1,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Variable field","Add measure - Variable field"],meaButtonLabelOthers:"Add measure - Variable field"},{id:19,category:6,name:"PCA - Biplot",file:"pca_biplot",minDims:1,minMeas:2,sortId:3,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Variable field","Add measure - Variable field"],meaButtonLabelOthers:"Add measure - Variable field"},{id:20,category:6,name:"PCA - Variance plot",file:"pca_variance",minDims:1,minMeas:2,sortId:2,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Variable field","Add measure - Variable field"],meaButtonLabelOthers:"Add measure - Variable field"},{id:21,category:7,name:"ANOVA - Single factor",file:"anova",minDims:2,minMeas:1,sortId:1},{id:22,category:7,name:"Tukey - Single factor",file:"tukey",minDims:2,minMeas:1,sortId:2},{id:23,category:4,name:"Find optimal number of clusters",file:"kmeans_optimize",minDims:1,minMeas:2,sortId:4,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Dataset","Add measure - Dataset"],meaButtonLabelOthers:"Add measure - Dataset"},{id:24,category:4,name:"k-means - Cluster means/centers",file:"kmeans_means",minDims:1,minMeas:2,sortId:3,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Dataset: X-axis","Add measure - Dataset: Y-axis"],meaButtonLabelOthers:"Add measure - Dataset"},{id:25,category:8,name:"Decision tree",file:"decision_tree",minDims:1,minMeas:2,sortId:0,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"},{id:26,category:8,name:"Decision tree - Evaluate model",file:"decision_tree_predict",minDims:1,minMeas:2,sortId:1,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"},{id:27,category:8,name:"Logistic regression analysis",file:"logistic_regression",minDims:1,minMeas:2,sortId:2,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"},{id:28,category:8,name:"Logistic regression - Evaluate model",file:"logistic_regression_predict",minDims:1,minMeas:2,sortId:3,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"},{id:29,category:8,name:"Logistic regression - Plot coefficients",file:"logistic_regression_coefplot",minDims:1,minMeas:2,sortId:4,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"},{id:14,category:8,name:"Correlation matrix heatmap",file:"correlation_heatmap",minDims:1,minMeas:2,sortId:5,allowAddMea:!0},{id:30,category:3,name:"Holt-Winters",file:"holt_winters",minDims:1,minMeas:1,sortId:5,setCustomButtonLabel:!1},{id:31,category:1,name:"Multiple regression prediction",file:"regression_predict",minDims:1,minMeas:2,sortId:2,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"},{id:32,category:1,name:"Multiple regression prediction table",file:"regression_predict_table",minDims:1,minMeas:2,sortId:2,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"},{id:33,category:1,name:"Multiple regression model",file:"regression_model",minDims:1,minMeas:2,sortId:1,allowAddMea:!0,setCustomButtonLabel:!0,dimButtonLabel:["Add dimension"],meaButtonLabel:["Add measure - Response variable","Add measure - Predictor variable"],meaButtonLabelOthers:"Add measure - Predictor variable"}].sort(function(e,a){return e.sortId-a.sortId})}}); //# sourceMappingURL=../../maps/analysis/analysis.js.map diff --git a/build/dev/lib/js/analysis/regression_model.js b/build/dev/lib/js/analysis/regression_model.js new file mode 100644 index 0000000..dd92301 --- /dev/null +++ b/build/dev/lib/js/analysis/regression_model.js @@ -0,0 +1,2 @@ +"use strict";define(["../util/utils","ng!$q"],function(e,t){return{createCube:function(t,a){var s=a.layout,r=e.validateDimension(s.props.dimensions[0]),n=[{qNullSuppression:!0,qDef:{qFieldDefs:[r]}}],l=s.props.measures.length;a.rowsLabel=["(Intercept)",""!=s.props.measures[1].label?s.props.measures[1].label:e.validateMeasure(s.props.measures[0])];for(var d=e.validateMeasure(s.props.measures[0])+" as mea0, "+e.validateMeasure(s.props.measures[1])+" as mea1",i="q$mea0 ~ q$mea1",o="NN",u=2;u0){var p=","+m+" as mea"+u;d+=p,i+=" + q$mea"+u,o+="N",a.rowsLabel.push(e.validateMeasure(s.props.measures[u]))}}var q=.3,h="q$mea0 > 0.0",c="library(caret);target <- q$mea0; preParams <- preProcess(q[,1:"+l+'], method=c("range"));q <- predict(preParams, q[,1:'+l+"]); q$mea0 <- target",f='m = abs(cor(subset(q,q$mea0 != 0),q$mea0[q$mea0 != 0], method = "pearson"))',b='f="";for(j in 2:'+l+") if(!is.na(m[j]) && m[j]>="+q+'){l=paste("q$mea",j-1,sep=""); f=paste(f,l,sep=" + ")} ;f=paste("q$mea0 ~ ",substring(f,3));str(f)';e.displayDebugModeMessage(s.props.debugMode);var y=e.getDebugSaveDatasetScript(s.props.debugMode,"debug_regression_analysis.rda"),g="R.ScriptEvalExStr('"+o+"','"+y+" library(jsonlite);"+c+";"+f+"; "+b+"; lm_result <- lm(as.formula(f), q, "+h+');lm_summary <- summary(lm_result);\n json <- toJSON(list(coef(lm_summary)[,"Estimate"], coef(lm_summary)[,"Std. Error"], coef(lm_summary)[,"t value"], coef(lm_summary)[,"Pr(>|t|)"],\n as.double(summary(lm_result$residuals)), summary(lm_result)$sigma, summary(lm_result)$df, lm_summary$r.squared, lm_summary$adj.r.squared,\n summary(lm_result)$fstatistic, extractAIC(lm_result)[2])); json;\','+d+")";e.displayRScriptsToConsole(s.props.debugMode,[g]);var v=[{qDef:{qDef:g}},{qDef:{qLabel:"-",qDef:""}},{qDef:{qLabel:"-",qDef:""}},{qDef:{qLabel:"-",qDef:""}},{qDef:{qLabel:"-",qDef:""}}];return a.backendApi.applyPatches([{qPath:"/qHyperCubeDef/qDimensions",qOp:"replace",qValue:JSON.stringify(n)},{qPath:"/qHyperCubeDef/qMeasures",qOp:"replace",qValue:JSON.stringify(v)}],!1),a.patchApplied=!0,null},drawChart:function(a){var s=t.defer(),r=a.layout,n=(e.validateDimension(r.props.dimensions[0]),[{qTop:0,qLeft:0,qWidth:2,qHeight:1}]);return a.backendApi.getData(n).then(function(t){a.layout.qHyperCube.qMeasureInfo;if(0===t[0].qMatrix[0][1].qText.length||"-"==t[0].qMatrix[0][1].qText)e.displayConnectionError(a.extId);else{e.displayReturnedDatasetToConsole(r.props.debugMode,t[0]);for(var n=JSON.parse(t[0].qMatrix[0][1].qText),l=n[0],d=n[1],i=n[2],o=n[3],u=Math.max.apply(null,o),m=n[4],p=n[5],q=n[6],h=n[7],c=n[8],f=n[9],b=n[10],y='\n

Residuals:

\n \n \n \n \n \n \n \n \n \n \n \n
Min1QMedian3QMax
'+m[0]+""+m[1]+""+m[2]+""+m[4]+""+m[5]+'
\n\n

Coefficients:

\n \n \n \n \n \n \n \n ',g=0;g\n \n ";y+='\n \n
EstimateStd.Errort valuePr(>|t|)Signif
"+a.rowsLabel[g]+""+l[g]+""+d[g]+""+i[g]+""+o[g]+""+(o[g]<.001?'':o[g]<.01?'':o[g]<.05?'':o[g]<.1?".":"")+"
\n
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
\n\n

Others:

\n \n \n \n \n \n \n \n \n \n \n \n \n \n
ItemValue
Residual standard error'+p[0]+" on "+q[1]+" degrees of freedom
Multiple R-squared"+h[0]+"
Adjusted R-squared"+c[0]+"
F-statistic "+f[0]+" on "+f[1]+" and "+f[2]+" DF, p-value: < "+u+"
AIC"+b[0]+"
\n ",$(".advanced-analytics-toolsets-"+a.extId).html(y)}return s.resolve()}),s.promise}}}); +//# sourceMappingURL=../../maps/analysis/regression_model.js.map diff --git a/build/dev/lib/js/analysis/regression_predict.js b/build/dev/lib/js/analysis/regression_predict.js new file mode 100644 index 0000000..8a324df --- /dev/null +++ b/build/dev/lib/js/analysis/regression_predict.js @@ -0,0 +1,2 @@ +"use strict";define(["../chart/line_chart","../util/utils","ng!$q"],function(e,r,a){return{createCube:function(e,a){var s=a.layout,t=r.validateDimension(s.props.dimensions[0]),p=[{qNullSuppression:!0,qDef:{qFieldDefs:[t],qSortCriterias:[{qSortByExpression:s.props.dimSort||!s.props.dimSortByExpression?0:s.props.dimSortByExpressionAsc,qSortByNumeric:s.props.dimSort?1:s.props.dimSortByNum?s.props.dimSortByNumAsc:0,qSortByAscii:s.props.dimSort||!s.props.dimSortByAlph?0:s.props.dimSortByAlphAsc,qExpression:{qv:s.props.dimSortByExpressionString}}]}}],l=s.props.measures.length;a.rowsLabel=["(Intercept)",r.validateMeasure(s.props.measures[1])];for(var i=r.validateMeasure(s.props.measures[0])+" as mea0, "+r.validateMeasure(s.props.measures[1])+" as mea1",o="q$mea0 ~ q$mea1",n=2;n0){var u=","+m+" as mea"+n;i+=u,o+=" + q$mea"+n,a.rowsLabel.push(r.validateMeasure(s.props.measures[n]))}}var q=.3,d="library(caret);target <- q$mea0; preParams <- preProcess(q[,1:"+l+'], method=c("range"));q <- predict(preParams, q[,1:'+l+"]); q$mea0 <- target",c='m = abs(cor(subset(q,q$mea0 != 0),q$mea0[q$mea0 != 0], method = "pearson"))',v='f="";for(j in 2:'+l+") if(!is.na(m[j]) && m[j]>="+q+'){l=paste("q$mea",j-1,sep=""); f=paste(f,l,sep=" + ")} ;f=paste("q$mea0 ~ ",substring(f,3));str(f)',f="q$mea0 > 0",h="q = subset(q,q$mea0 == 0); q$mea0[q$mea0 == 0] <- NA;";r.displayDebugModeMessage(s.props.debugMode);var y=r.getDebugSaveDatasetScript(s.props.debugMode,"debug_regression_analysis_line_chart.rda"),b="R.ScriptEval('"+y+" "+d+"; if(sum(q$mea0)> 0 && min(q$mea0) == 0){"+c+"; "+v+"; lm_result <- lm(as.formula(f), q, "+f+");"+h+' predict(lm_result, q, interval="'+s.props.interval+'", level='+s.props.confidenceLevel+");} else{lm_result <- lm("+o+');predict(lm_result, interval="'+s.props.interval+'", level='+s.props.confidenceLevel+"); }[,1]',"+i+")",g="R.ScriptEval('"+d+"; if(sum(q$mea0)> 0 && min(q$mea0) == 0){"+c+"; "+v+"; lm_result <- lm(as.formula(f), q, "+f+");"+h+' predict(lm_result, q, interval="'+s.props.interval+'", level='+s.props.confidenceLevel+");} else{lm_result <- lm("+o+');predict(lm_result, interval="'+s.props.interval+'", level='+s.props.confidenceLevel+"); }[,2]',"+i+")",N="R.ScriptEval('"+d+"; if(sum(q$mea0)> 0 && min(q$mea0) == 0){"+c+"; "+v+"; lm_result <- lm(as.formula(f), q, "+f+");"+h+' predict(lm_result, q, interval="'+s.props.interval+'", level='+s.props.confidenceLevel+");} else{lm_result <- lm("+o+');predict(lm_result, interval="'+s.props.interval+'", level='+s.props.confidenceLevel+"); }[,3]',"+i+")";r.displayRScriptsToConsole(s.props.debugMode,[b,g,N]);var S=r.validateMeasure(s.props.measures[0]),$=[{qDef:{qDef:S}},{qDef:{qDef:b}},{qDef:{qDef:g}},{qDef:{qDef:N}},{qDef:{qLabel:"-",qDef:""}}];return a.backendApi.applyPatches([{qPath:"/qHyperCubeDef/qDimensions",qOp:"replace",qValue:JSON.stringify(p)},{qPath:"/qHyperCubeDef/qMeasures",qOp:"replace",qValue:JSON.stringify($)}],!1),a.patchApplied=!0,null},drawChart:function(s,t){var p=a.defer(),l=s.layout,i=[{qTop:0,qLeft:0,qWidth:6,qHeight:1500}];return s.backendApi.getData(i).then(function(a){var i=s.layout.qHyperCube.qMeasureInfo;if(isNaN(i[1].qMin)&&isNaN(i[1].qMax)&&isNaN(i[2].qMin)&&isNaN(i[2].qMax)&&isNaN(i[3].qMin)&&isNaN(i[3].qMax))r.displayConnectionError(s.extId);else{r.displayReturnedDatasetToConsole(l.props.debugMode,a[0]);var o=r.getDefaultPaletteColor(),n=[],m=[],u=[],q=[],d=[],c=[];$.each(a[0].qMatrix,function(e,r){n.push(r[0].qElemNumber),0==r[1].qNum&&m.push(r[0].qText),u.push(r[1].qNum),q.push(r[2].qNum),d.push(r[3].qNum),c.push(r[4].qNum)});var v=[{x:m,y:q,name:"Fit",mode:"none",type:"bar",line:{color:"rgba("+o[l.props.colorForSub]+",1)"}}];$(".advanced-analytics-toolsets-"+s.extId).html('
');var f=e.draw(s,v,"aat-chart-"+s.extId,null);e.setEvents(f,s,t)}return p.resolve()}),p.promise}}}); +//# sourceMappingURL=../../maps/analysis/regression_predict.js.map diff --git a/build/dev/lib/js/analysis/regression_predict_table.js b/build/dev/lib/js/analysis/regression_predict_table.js new file mode 100644 index 0000000..266d882 --- /dev/null +++ b/build/dev/lib/js/analysis/regression_predict_table.js @@ -0,0 +1,2 @@ +"use strict";define(["../chart/line_chart","../util/utils","ng!$q"],function(e,r,s){return{createCube:function(e,s){var a=s.layout,t=r.validateDimension(a.props.dimensions[0]),p=[{qNullSuppression:!0,qDef:{qFieldDefs:[t],qSortCriterias:[{qSortByExpression:a.props.dimSort||!a.props.dimSortByExpression?0:a.props.dimSortByExpressionAsc,qSortByNumeric:a.props.dimSort?1:a.props.dimSortByNum?a.props.dimSortByNumAsc:0,qSortByAscii:a.props.dimSort||!a.props.dimSortByAlph?0:a.props.dimSortByAlphAsc,qExpression:{qv:a.props.dimSortByExpressionString}}]}}],l=a.props.measures.length;s.rowsLabel=["(Intercept)",r.validateMeasure(a.props.measures[1])];for(var i=r.validateMeasure(a.props.measures[0])+" as mea0, "+r.validateMeasure(a.props.measures[1])+" as mea1",o="q$mea0 ~ q$mea1",n=2;n0){var u=","+m+" as mea"+n;i+=u,o+=" + q$mea"+n,s.rowsLabel.push(r.validateMeasure(a.props.measures[n]))}}var q=.3,d="library(caret);target <- q$mea0; preParams <- preProcess(q[,1:"+l+'], method=c("range"));q <- predict(preParams, q[,1:'+l+"]); q$mea0 <- target",c='m = abs(cor(subset(q,q$mea0 != 0),q$mea0[q$mea0 != 0], method = "pearson"))',f='f="";for(j in 2:'+l+") if(!is.na(m[j]) && m[j]>="+q+'){l=paste("q$mea",j-1,sep=""); f=paste(f,l,sep=" + ")} ;f=paste("q$mea0 ~ ",substring(f,3));str(f)',v="q$mea0 > 0",h="q = subset(q,q$mea0 == 0); q$mea0[q$mea0 == 0] <- NA;";r.displayDebugModeMessage(a.props.debugMode);var y=r.getDebugSaveDatasetScript(a.props.debugMode,"debug_regression_analysis_line_chart.rda"),b="R.ScriptEval('"+y+" "+d+"; if(sum(q$mea0)> 0 && min(q$mea0) == 0){"+c+"; "+f+"; lm_result <- lm(as.formula(f), q, "+v+");"+h+' predict(lm_result, q, interval="'+a.props.interval+'", level='+a.props.confidenceLevel+");} else{lm_result <- lm("+o+');predict(lm_result, interval="'+a.props.interval+'", level='+a.props.confidenceLevel+"); }[,1]',"+i+")",g="R.ScriptEval('"+d+"; if(sum(q$mea0)> 0 && min(q$mea0) == 0){"+c+"; "+f+"; lm_result <- lm(as.formula(f), q, "+v+");"+h+' predict(lm_result, q, interval="'+a.props.interval+'", level='+a.props.confidenceLevel+");} else{lm_result <- lm("+o+');predict(lm_result, interval="'+a.props.interval+'", level='+a.props.confidenceLevel+"); }[,2]',"+i+")",N="R.ScriptEval('"+d+"; if(sum(q$mea0)> 0 && min(q$mea0) == 0){"+c+"; "+f+"; lm_result <- lm(as.formula(f), q, "+v+");"+h+' predict(lm_result, q, interval="'+a.props.interval+'", level='+a.props.confidenceLevel+");} else{lm_result <- lm("+o+');predict(lm_result, interval="'+a.props.interval+'", level='+a.props.confidenceLevel+"); }[,3]',"+i+")";r.displayRScriptsToConsole(a.props.debugMode,[b,g,N]);var S=r.validateMeasure(a.props.measures[0]),$=[{qDef:{qDef:S}},{qDef:{qDef:b}},{qDef:{qDef:g}},{qDef:{qDef:N}},{qDef:{qLabel:"-",qDef:""}}];return s.backendApi.applyPatches([{qPath:"/qHyperCubeDef/qDimensions",qOp:"replace",qValue:JSON.stringify(p)},{qPath:"/qHyperCubeDef/qMeasures",qOp:"replace",qValue:JSON.stringify($)}],!1),s.patchApplied=!0,null},drawChart:function(e,a){var t=s.defer(),p=e.layout,l=[{qTop:0,qLeft:0,qWidth:6,qHeight:1500}];return e.backendApi.getData(l).then(function(s){var a=e.layout.qHyperCube.qMeasureInfo;if(isNaN(a[1].qMin)&&isNaN(a[1].qMax)&&isNaN(a[2].qMin)&&isNaN(a[2].qMax)&&isNaN(a[3].qMin)&&isNaN(a[3].qMax))r.displayConnectionError(e.extId);else{r.displayReturnedDatasetToConsole(p.props.debugMode,s[0]);var l=(r.getDefaultPaletteColor(),[]),i=[],o=[],n=[],m=[],u=[];$.each(s[0].qMatrix,function(e,r){l.push(r[0].qElemNumber),0==r[1].qNum&&i.push(r[0].qText),o.push(r[1].qNum),n.push(r[2].qNum),m.push(r[3].qNum),u.push(r[4].qNum)});for(var q='\n

Predicted:

\n \n \n \n \n \n \n \n ',d=0;d\n ";q+="\n \n
CodeRemaining Life
"+i[d]+""+Math.ceil(n[d])+"
\n\t\t ",$(".advanced-analytics-toolsets-"+e.extId).html(q)}return t.resolve()}),t.promise}}}); +//# sourceMappingURL=../../maps/analysis/regression_predict_table.js.map diff --git a/build/dev/lib/maps/analysis/analysis.js.map b/build/dev/lib/maps/analysis/analysis.js.map index 1ba9724..225e255 100644 --- a/build/dev/lib/maps/analysis/analysis.js.map +++ b/build/dev/lib/maps/analysis/analysis.js.map @@ -1 +1 @@ -{"version":3,"sources":["analysis/analysis.js"],"names":["define","analysisCategories","id","name","analysisTypes","category","file","minDims","minMeas","sortId","allowAddMea","setCustomButtonLabel","dimButtonLabel","meaButtonLabel","meaButtonLabelOthers","sort","a","b"],"mappings":"AAAA,YAAAA,WAAW,WACT,OACEC,qBAEIC,GAAI,EACJC,KAAM,sCAGND,GAAI,EACJC,KAAM,wCAGND,GAAI,EACJC,KAAM,mCAGND,GAAI,EACJC,KAAM,sBAGND,GAAI,EACJC,KAAM,uCAGND,GAAI,EACJC,KAAM,yBAGND,GAAI,EACJC,KAAM,eAGND,GAAI,EACJC,KAAM,mBAGND,GAAI,EACJC,KAAM,gBAGVC,gBAEIF,GAAI,EACJG,SAAU,EACVF,KAAM,yCACNG,KAAM,qBACNC,QAAS,EACTC,QAAS,EACTC,OAAQ,EACRC,aAAa,EACbC,sBAAsB,IAGtBT,GAAI,EACJG,SAAU,EACVF,KAAM,2CACNG,KAAM,uBACNC,QAAS,EACTC,QAAS,EACTC,OAAQ,EACRC,aAAa,EACbC,sBAAsB,IAGtBT,GAAI,EACJG,SAAU,EACVF,KAAM,SACNG,KAAM,SACNC,QAAS,EACTC,QAAS,EACTC,OAAQ,EACRC,aAAa,EACbC,sBAAsB,EACtBC,gBAAiB,iBACjBC,gBAAiB,0BAA2B,2BAC5CC,qBAAsB,KAGtBZ,GAAI,EACJG,SAAU,EACVF,KAAM,6BACNG,KAAM,SACNC,QAAS,EACTC,QAAS,EACTC,OAAQ,EACRC,aAAa,EACbC,sBAAsB,EACtBC,gBAAiB,iBACjBC,gBAAiB,0BAA2B,2BAC5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Aa,EACbC,sBAAsB,EACtBC,gBAAiB,iBACjBC,gBAAiB,kCAAmC,oCACpDC,qBAAsB,qCAGtBZ,GAAI,GACJG,SAAU,EACVF,KAAM,0CACNG,KAAM,+BACNC,QAAS,EACTC,QAAS,EACTC,OAAQ,EACRC,aAAa,EACbC,sBAAsB,EACtBC,gBAAiB,iBACjBC,gBAAiB,kCAAmC,oCACpDC,qBAAsB,qCAGtBZ,GAAI,GACJG,SAAU,EACVF,KAAM,6BACNG,KAAM,sBACNC,QAAS,EACTC,QAAS,EACTC,OAAQ,EACRC,aAAa,IAGbR,GAAI,GACJG,SAAU,EACVF,KAAM,eACNG,KAAM,eACNC,QAAS,EACTC,QAAS,EACTC,OAAQ,EACRE,sBAAsB,IAExBI,KAAK,SAACC,EAAGC,GACT,MAAOD,GAAEP,OAASQ,EAAER","file":"../../js/analysis/analysis.js","sourcesContent":["define([], () => {\r\n return {\r\n analysisCategories: [\r\n {\r\n id: 0,\r\n name: 'Simple linear regression analysis',\r\n },\r\n {\r\n id: 1,\r\n name: 'Multiple linear regression analysis',\r\n },\r\n {\r\n id: 2,\r\n name: 'Statistical hypothesis testing',\r\n },\r\n {\r\n id: 7,\r\n name: 'Variance analysis',\r\n },\r\n {\r\n id: 6,\r\n name: 'Principal Component Analysis (PCA)',\r\n },\r\n {\r\n id: 3,\r\n name: 'Time series analysis',\r\n },\r\n {\r\n id: 4,\r\n name: 'Clustering',\r\n },\r\n {\r\n id: 8,\r\n name: 'Classification',\r\n },\r\n {\r\n id: 5,\r\n name: 'Text mining',\r\n },\r\n ],\r\n analysisTypes: [\r\n {\r\n id: 0,\r\n category: 0,\r\n name: 'Line chart with linear regression line',\r\n file: 'simple_linear_line',\r\n minDims: 1,\r\n minMeas: 1,\r\n sortId: 2,\r\n allowAddMea: false,\r\n setCustomButtonLabel: false,\r\n },\r\n {\r\n id: 1,\r\n category: 0,\r\n name: 'Scatter plot with linear regression line',\r\n file: 'simple_linear_bubble',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 3,\r\n allowAddMea: false,\r\n setCustomButtonLabel: false,\r\n },\r\n {\r\n id: 2,\r\n category: 2,\r\n name: 'F-Test',\r\n file: 'f_test',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 1,\r\n allowAddMea: false,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Dataset A', 'Add measure - Dataset B'],\r\n meaButtonLabelOthers: '',\r\n },\r\n {\r\n id: 3,\r\n category: 2,\r\n name: 'T-Test - Two sample T-Test',\r\n file: 't_test',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 2,\r\n allowAddMea: false,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Dataset A', 'Add measure - Dataset B'],\r\n meaButtonLabelOthers: '',\r\n },\r\n {\r\n id: 4,\r\n category: 2,\r\n name: 'T-Test - Welch two sample T-Test',\r\n file: 't_test',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 3,\r\n allowAddMea: false,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Dataset A', 'Add measure - Dataset B'],\r\n meaButtonLabelOthers: '',\r\n },\r\n {\r\n id: 5,\r\n category: 2,\r\n name: 'T-Test - Paired T-Test',\r\n file: 't_test',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 4,\r\n allowAddMea: false,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Dataset A', 'Add measure - Dataset B'],\r\n meaButtonLabelOthers: '',\r\n },\r\n {\r\n id: 6,\r\n category: 3,\r\n name: 'Autocorrelation',\r\n file: 'autocorrelation',\r\n minDims: 1,\r\n minMeas: 1,\r\n sortId: 1,\r\n allowAddMea: false,\r\n setCustomButtonLabel: false,\r\n },\r\n {\r\n id: 7,\r\n category: 3,\r\n name: 'Ljung-Box Test',\r\n file: 'ljung_box_test',\r\n minDims: 1,\r\n minMeas: 1,\r\n sortId: 2,\r\n allowAddMea: false,\r\n setCustomButtonLabel: false,\r\n },\r\n {\r\n id: 8,\r\n category: 3,\r\n name: 'Decomposing time series',\r\n file: 'timeseries_decomposition',\r\n minDims: 1,\r\n minMeas: 1,\r\n sortId: 3,\r\n allowAddMea: false,\r\n setCustomButtonLabel: false,\r\n },\r\n {\r\n id: 9,\r\n category: 3,\r\n name: 'ARIMA forecast',\r\n file: 'timeseries_forecast',\r\n minDims: 1,\r\n minMeas: 1,\r\n sortId: 6,\r\n setCustomButtonLabel: false,\r\n },\r\n {\r\n id: 10,\r\n category: 4,\r\n name: 'k-means clustering',\r\n file: 'kmeans',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 1,\r\n allowAddMea: true,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Dataset: X-axis', 'Add measure - Dataset: Y-axis'],\r\n meaButtonLabelOthers: 'Add measure - Dataset',\r\n },\r\n {\r\n id: 11,\r\n category: 1,\r\n name: 'Multiple regression analysis',\r\n file: 'regression_analysis',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 1,\r\n allowAddMea: true,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\r\n meaButtonLabelOthers: 'Add measure - Predictor variable',\r\n },\r\n {\r\n id: 12,\r\n category: 3,\r\n name: 'Augmented Dickey-Fuller Test',\r\n file: 'augmented_dickey_fuller_test',\r\n minDims: 1,\r\n minMeas: 1,\r\n sortId: 4,\r\n allowAddMea: false,\r\n },\r\n {\r\n id: 13,\r\n category: 5,\r\n name: 'Text mining / Wordcloud',\r\n file: 'textmining_wordcloud',\r\n minDims: 2,\r\n minMeas: 0,\r\n sortId: 1,\r\n allowAddMea: false,\r\n },\r\n {\r\n id: 14,\r\n category: 1,\r\n name: 'Correlation matrix heatmap',\r\n file: 'correlation_heatmap',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 4,\r\n allowAddMea: true,\r\n },\r\n {\r\n id: 15,\r\n category: 1,\r\n name: 'Plot regression coefficients',\r\n file: 'coefplot',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 3,\r\n allowAddMea: true,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\r\n meaButtonLabelOthers: 'Add measure - Predictor variable',\r\n },\r\n {\r\n id: 16,\r\n category: 4,\r\n name: 'k-means clustering (3D)',\r\n file: 'kmeans_3d',\r\n minDims: 1,\r\n minMeas: 3,\r\n sortId: 2,\r\n allowAddMea: true,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Dataset: X-axis', 'Add measure - Dataset: Y-axis', 'Add measure - Dataset: Z-axis'],\r\n meaButtonLabelOthers: 'Add measure - Dataset',\r\n },\r\n {\r\n id: 17,\r\n category: 1,\r\n name: 'Line chart with multiple regression line',\r\n file: 'regression_analysis_line_chart',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 2,\r\n allowAddMea: true,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\r\n meaButtonLabelOthers: 'Add measure - Predictor variable',\r\n },\r\n {\r\n id: 18,\r\n category: 6,\r\n name: 'Principal Component Analysis (PCA)',\r\n file: 'pca',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 1,\r\n allowAddMea: true,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Variable field', 'Add measure - Variable field'],\r\n meaButtonLabelOthers: 'Add measure - Variable field',\r\n },\r\n {\r\n id: 19,\r\n category: 6,\r\n name: 'PCA - Biplot',\r\n file: 'pca_biplot',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 3,\r\n allowAddMea: true,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Variable field', 'Add measure - Variable field'],\r\n meaButtonLabelOthers: 'Add measure - Variable field',\r\n },\r\n {\r\n id: 20,\r\n category: 6,\r\n name: 'PCA - Variance plot',\r\n file: 'pca_variance',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 2,\r\n allowAddMea: true,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Variable field', 'Add measure - Variable field'],\r\n meaButtonLabelOthers: 'Add measure - Variable field',\r\n },\r\n {\r\n id: 21,\r\n category: 7,\r\n name: 'ANOVA - Single factor',\r\n file: 'anova',\r\n minDims: 2,\r\n minMeas: 1,\r\n sortId: 1,\r\n },\r\n {\r\n id: 22,\r\n category: 7,\r\n name: 'Tukey - Single factor',\r\n file: 'tukey',\r\n minDims: 2,\r\n minMeas: 1,\r\n sortId: 2,\r\n },\r\n {\r\n id: 23,\r\n category: 4,\r\n name: 'Find optimal number of clusters',\r\n file: 'kmeans_optimize',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 4,\r\n allowAddMea: true,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Dataset', 'Add measure - Dataset'],\r\n meaButtonLabelOthers: 'Add measure - Dataset',\r\n },\r\n {\r\n id: 24,\r\n category: 4,\r\n name: 'k-means - Cluster means/centers',\r\n file: 'kmeans_means',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 3,\r\n allowAddMea: true,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Dataset: X-axis', 'Add measure - Dataset: Y-axis'],\r\n meaButtonLabelOthers: 'Add measure - Dataset',\r\n },\r\n {\r\n id: 25,\r\n category: 8,\r\n name: 'Decision tree',\r\n file: 'decision_tree',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 0,\r\n allowAddMea: true,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\r\n meaButtonLabelOthers: 'Add measure - Predictor variable',\r\n },\r\n {\r\n id: 26,\r\n category: 8,\r\n name: 'Decision tree - Evaluate model',\r\n file: 'decision_tree_predict',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 1,\r\n allowAddMea: true,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\r\n meaButtonLabelOthers: 'Add measure - Predictor variable',\r\n },\r\n {\r\n id: 27,\r\n category: 8,\r\n name: 'Logistic regression analysis',\r\n file: 'logistic_regression',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 2,\r\n allowAddMea: true,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\r\n meaButtonLabelOthers: 'Add measure - Predictor variable',\r\n },\r\n {\r\n id: 28,\r\n category: 8,\r\n name: 'Logistic regression - Evaluate model',\r\n file: 'logistic_regression_predict',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 3,\r\n allowAddMea: true,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\r\n meaButtonLabelOthers: 'Add measure - Predictor variable',\r\n },\r\n {\r\n id: 29,\r\n category: 8,\r\n name: 'Logistic regression - Plot coefficients',\r\n file: 'logistic_regression_coefplot',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 4,\r\n allowAddMea: true,\r\n setCustomButtonLabel: true,\r\n dimButtonLabel: ['Add dimension'],\r\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\r\n meaButtonLabelOthers: 'Add measure - Predictor variable',\r\n },\r\n {\r\n id: 14,\r\n category: 8,\r\n name: 'Correlation matrix heatmap',\r\n file: 'correlation_heatmap',\r\n minDims: 1,\r\n minMeas: 2,\r\n sortId: 5,\r\n allowAddMea: true,\r\n },\r\n {\r\n id: 30,\r\n category: 3,\r\n name: 'Holt-Winters',\r\n file: 'holt_winters',\r\n minDims: 1,\r\n minMeas: 1,\r\n sortId: 5,\r\n setCustomButtonLabel: false,\r\n },\r\n ].sort((a, b) => {\r\n return a.sortId - b.sortId;\r\n }),\r\n };\r\n});\r\n"]} \ No newline at end of file +{"version":3,"sources":["analysis/analysis.js"],"names":["define","analysisCategories","id","name","analysisTypes","category","file","minDims","minMeas","sortId","allowAddMea","setCustomButtonLabel","dimButtonLabel","meaButtonLabel","meaButtonLabelOthers","sort","a","b"],"mappings":"AAAA,YAAAA,WAAW,WACT,OACEC,qBAEIC,GAAI,EACJC,KAAM,sCAGND,GAAI,EACJC,KAAM,wCAGND,GAAI,EACJC,KAAM,mCAGND,GAAI,EACJC,KAAM,sBAGND,GAAI,EACJC,KAAM,uCAGND,GAAI,EACJC,KAAM,yBAGND,GAAI,EACJC,KAAM,eAGND,GAAI,EACJC,KAAM,mBAGND,GAAI,EACJC,KAAM,gBAGVC,gBAEIF,GAAI,EACJG,SAAU,EACVF,KAAM,yCACNG,KAAM,qBACNC,QAAS,EACTC,QAAS,EACTC,OAAQ,EACRC,aAAa,EACbC,sBAAsB,IAGtBT,GAAI,EACJG,SAAU,EACVF,KAAM,2CACNG,KAAM,uBACNC,QAAS,EACTC,QAAS,EACTC,OAAQ,EACRC,aAAa,EACbC,sBAAsB,IAGtBT,GAAI,EACJG,SAAU,EACVF,KAAM,SACNG,KAAM,SACNC,QAAS,EACTC,QAAS,EACTC,OAAQ,EACRC,aAAa,EACbC,sBAAsB,EACtBC,gBAAiB,iBACjBC,gBAAiB,0BAA2B,2BAC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analysis/analysis.js","sourcesContent":["define([], () => {\n return {\n analysisCategories: [\n {\n id: 0,\n name: 'Simple linear regression analysis',\n },\n {\n id: 1,\n name: 'Multiple linear regression analysis',\n },\n {\n id: 2,\n name: 'Statistical hypothesis testing',\n },\n {\n id: 7,\n name: 'Variance analysis',\n },\n {\n id: 6,\n name: 'Principal Component Analysis (PCA)',\n },\n {\n id: 3,\n name: 'Time series analysis',\n },\n {\n id: 4,\n name: 'Clustering',\n },\n {\n id: 8,\n name: 'Classification',\n },\n {\n id: 5,\n name: 'Text mining',\n },\n ],\n analysisTypes: [\n {\n id: 0,\n category: 0,\n name: 'Line chart with linear regression line',\n file: 'simple_linear_line',\n minDims: 1,\n minMeas: 1,\n sortId: 2,\n allowAddMea: false,\n setCustomButtonLabel: false,\n },\n {\n id: 1,\n category: 0,\n name: 'Scatter plot with linear regression line',\n file: 'simple_linear_bubble',\n minDims: 1,\n minMeas: 2,\n sortId: 3,\n allowAddMea: false,\n setCustomButtonLabel: false,\n },\n {\n id: 2,\n category: 2,\n name: 'F-Test',\n file: 'f_test',\n minDims: 1,\n minMeas: 2,\n sortId: 1,\n allowAddMea: false,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Dataset A', 'Add measure - Dataset B'],\n meaButtonLabelOthers: '',\n },\n {\n id: 3,\n category: 2,\n name: 'T-Test - Two sample T-Test',\n file: 't_test',\n minDims: 1,\n minMeas: 2,\n sortId: 2,\n allowAddMea: false,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Dataset A', 'Add measure - Dataset B'],\n meaButtonLabelOthers: '',\n },\n {\n id: 4,\n category: 2,\n name: 'T-Test - Welch two sample T-Test',\n file: 't_test',\n minDims: 1,\n minMeas: 2,\n sortId: 3,\n allowAddMea: false,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Dataset A', 'Add measure - Dataset B'],\n meaButtonLabelOthers: '',\n },\n {\n id: 5,\n category: 2,\n name: 'T-Test - Paired T-Test',\n file: 't_test',\n minDims: 1,\n minMeas: 2,\n sortId: 4,\n allowAddMea: false,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Dataset A', 'Add measure - Dataset B'],\n meaButtonLabelOthers: '',\n },\n {\n id: 6,\n category: 3,\n name: 'Autocorrelation',\n file: 'autocorrelation',\n minDims: 1,\n minMeas: 1,\n sortId: 1,\n allowAddMea: false,\n setCustomButtonLabel: false,\n },\n {\n id: 7,\n category: 3,\n name: 'Ljung-Box Test',\n file: 'ljung_box_test',\n minDims: 1,\n minMeas: 1,\n sortId: 2,\n allowAddMea: false,\n setCustomButtonLabel: false,\n },\n {\n id: 8,\n category: 3,\n name: 'Decomposing time series',\n file: 'timeseries_decomposition',\n minDims: 1,\n minMeas: 1,\n sortId: 3,\n allowAddMea: false,\n setCustomButtonLabel: false,\n },\n {\n id: 9,\n category: 3,\n name: 'ARIMA forecast',\n file: 'timeseries_forecast',\n minDims: 1,\n minMeas: 1,\n sortId: 6,\n setCustomButtonLabel: false,\n },\n {\n id: 10,\n category: 4,\n name: 'k-means clustering',\n file: 'kmeans',\n minDims: 1,\n minMeas: 2,\n sortId: 1,\n allowAddMea: true,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Dataset: X-axis', 'Add measure - Dataset: Y-axis'],\n meaButtonLabelOthers: 'Add measure - Dataset',\n },\n {\n id: 11,\n category: 1,\n name: 'Multiple regression analysis',\n file: 'regression_analysis',\n minDims: 1,\n minMeas: 2,\n sortId: 1,\n allowAddMea: true,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\n meaButtonLabelOthers: 'Add measure - Predictor variable',\n },\n {\n id: 12,\n category: 3,\n name: 'Augmented Dickey-Fuller Test',\n file: 'augmented_dickey_fuller_test',\n minDims: 1,\n minMeas: 1,\n sortId: 4,\n allowAddMea: false,\n },\n {\n id: 13,\n category: 5,\n name: 'Text mining / Wordcloud',\n file: 'textmining_wordcloud',\n minDims: 2,\n minMeas: 0,\n sortId: 1,\n allowAddMea: false,\n },\n {\n id: 14,\n category: 1,\n name: 'Correlation matrix heatmap',\n file: 'correlation_heatmap',\n minDims: 1,\n minMeas: 2,\n sortId: 4,\n allowAddMea: true,\n },\n {\n id: 15,\n category: 1,\n name: 'Plot regression coefficients',\n file: 'coefplot',\n minDims: 1,\n minMeas: 2,\n sortId: 3,\n allowAddMea: true,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\n meaButtonLabelOthers: 'Add measure - Predictor variable',\n },\n {\n id: 16,\n category: 4,\n name: 'k-means clustering (3D)',\n file: 'kmeans_3d',\n minDims: 1,\n minMeas: 3,\n sortId: 2,\n allowAddMea: true,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Dataset: X-axis', 'Add measure - Dataset: Y-axis', 'Add measure - Dataset: Z-axis'],\n meaButtonLabelOthers: 'Add measure - Dataset',\n },\n {\n id: 17,\n category: 1,\n name: 'Line chart with multiple regression line',\n file: 'regression_analysis_line_chart',\n minDims: 1,\n minMeas: 2,\n sortId: 2,\n allowAddMea: true,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\n meaButtonLabelOthers: 'Add measure - Predictor variable',\n },\n {\n id: 18,\n category: 6,\n name: 'Principal Component Analysis (PCA)',\n file: 'pca',\n minDims: 1,\n minMeas: 2,\n sortId: 1,\n allowAddMea: true,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Variable field', 'Add measure - Variable field'],\n meaButtonLabelOthers: 'Add measure - Variable field',\n },\n {\n id: 19,\n category: 6,\n name: 'PCA - Biplot',\n file: 'pca_biplot',\n minDims: 1,\n minMeas: 2,\n sortId: 3,\n allowAddMea: true,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Variable field', 'Add measure - Variable field'],\n meaButtonLabelOthers: 'Add measure - Variable field',\n },\n {\n id: 20,\n category: 6,\n name: 'PCA - Variance plot',\n file: 'pca_variance',\n minDims: 1,\n minMeas: 2,\n sortId: 2,\n allowAddMea: true,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Variable field', 'Add measure - Variable field'],\n meaButtonLabelOthers: 'Add measure - Variable field',\n },\n {\n id: 21,\n category: 7,\n name: 'ANOVA - Single factor',\n file: 'anova',\n minDims: 2,\n minMeas: 1,\n sortId: 1,\n },\n {\n id: 22,\n category: 7,\n name: 'Tukey - Single factor',\n file: 'tukey',\n minDims: 2,\n minMeas: 1,\n sortId: 2,\n },\n {\n id: 23,\n category: 4,\n name: 'Find optimal number of clusters',\n file: 'kmeans_optimize',\n minDims: 1,\n minMeas: 2,\n sortId: 4,\n allowAddMea: true,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Dataset', 'Add measure - Dataset'],\n meaButtonLabelOthers: 'Add measure - Dataset',\n },\n {\n id: 24,\n category: 4,\n name: 'k-means - Cluster means/centers',\n file: 'kmeans_means',\n minDims: 1,\n minMeas: 2,\n sortId: 3,\n allowAddMea: true,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Dataset: X-axis', 'Add measure - Dataset: Y-axis'],\n meaButtonLabelOthers: 'Add measure - Dataset',\n },\n {\n id: 25,\n category: 8,\n name: 'Decision tree',\n file: 'decision_tree',\n minDims: 1,\n minMeas: 2,\n sortId: 0,\n allowAddMea: true,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\n meaButtonLabelOthers: 'Add measure - Predictor variable',\n },\n {\n id: 26,\n category: 8,\n name: 'Decision tree - Evaluate model',\n file: 'decision_tree_predict',\n minDims: 1,\n minMeas: 2,\n sortId: 1,\n allowAddMea: true,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\n meaButtonLabelOthers: 'Add measure - Predictor variable',\n },\n {\n id: 27,\n category: 8,\n name: 'Logistic regression analysis',\n file: 'logistic_regression',\n minDims: 1,\n minMeas: 2,\n sortId: 2,\n allowAddMea: true,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\n meaButtonLabelOthers: 'Add measure - Predictor variable',\n },\n {\n id: 28,\n category: 8,\n name: 'Logistic regression - Evaluate model',\n file: 'logistic_regression_predict',\n minDims: 1,\n minMeas: 2,\n sortId: 3,\n allowAddMea: true,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\n meaButtonLabelOthers: 'Add measure - Predictor variable',\n },\n {\n id: 29,\n category: 8,\n name: 'Logistic regression - Plot coefficients',\n file: 'logistic_regression_coefplot',\n minDims: 1,\n minMeas: 2,\n sortId: 4,\n allowAddMea: true,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\n meaButtonLabelOthers: 'Add measure - Predictor variable',\n },\n {\n id: 14,\n category: 8,\n name: 'Correlation matrix heatmap',\n file: 'correlation_heatmap',\n minDims: 1,\n minMeas: 2,\n sortId: 5,\n allowAddMea: true,\n },\n {\n id: 30,\n category: 3,\n name: 'Holt-Winters',\n file: 'holt_winters',\n minDims: 1,\n minMeas: 1,\n sortId: 5,\n setCustomButtonLabel: false,\n },\n\t {\n id: 31,\n category: 1,\n name: 'Multiple regression prediction',\n file: 'regression_predict',\n minDims: 1,\n minMeas: 2,\n sortId: 2,\n allowAddMea: true,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\n meaButtonLabelOthers: 'Add measure - Predictor variable',\n },\n\t {\n id: 32,\n category: 1,\n name: 'Multiple regression prediction table',\n file: 'regression_predict_table',\n minDims: 1,\n minMeas: 2,\n sortId: 2,\n allowAddMea: true,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\n meaButtonLabelOthers: 'Add measure - Predictor variable',\n },\n\t {\n id: 33,\n category: 1,\n name: 'Multiple regression model',\n file: 'regression_model',\n minDims: 1,\n minMeas: 2,\n sortId: 1,\n allowAddMea: true,\n setCustomButtonLabel: true,\n dimButtonLabel: ['Add dimension'],\n meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'],\n meaButtonLabelOthers: 'Add measure - Predictor variable',\n },\n ].sort((a, b) => {\n return a.sortId - b.sortId;\n }),\n };\n});\n"]} \ No newline at end of file diff --git a/build/dev/lib/maps/analysis/regression_model.js.map b/build/dev/lib/maps/analysis/regression_model.js.map new file mode 100644 index 0000000..009ab12 --- /dev/null +++ b/build/dev/lib/maps/analysis/regression_model.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["analysis/regression_model.js"],"names":["define","utils","$q","createCube","app","$scope","layout","dimension","validateDimension","props","dimensions","qNullSuppression","qDef","qFieldDefs","meaLen","measures","length","rowsLabel","label","validateMeasure","params","meaList","dataType","i","mea","param","push","soglia","split","norm","cor","fo","displayDebugModeMessage","debugMode","saveRDataset","getDebugSaveDatasetScript","defMea1","displayRScriptsToConsole","qLabel","backendApi","applyPatches","qPath","qOp","qValue","JSON","stringify","patchApplied","drawChart","defer","requestPage","qTop","qLeft","qWidth","qHeight","getData","then","dataPages","qHyperCube","qMeasureInfo","qMatrix","qText","displayConnectionError","extId","displayReturnedDatasetToConsole","result","parse","estimate","stdError","tValue","pr","minPr","Math","max","apply","residuals","sigma","df","rSquared","adjRSquared","fstatistic","aic","html","$","resolve","promise"],"mappings":"AAAA,YAAAA,SACE,gBACA,SACC,SAACC,EAAOC,GACT,OASEC,WATK,SASMC,EAAKC,GACd,GAAMC,GAASD,EAAOC,OAGhBC,EAAYN,EAAMO,kBAAkBF,EAAOG,MAAMC,WAAW,IAC5DA,IACJC,kBAAkB,EAClBC,MACEC,YAAaN,MAIXO,EAASR,EAAOG,MAAMM,SAASC,MACrCX,GAAOY,WAAa,cAAkD,IAAlCX,EAAOG,MAAMM,SAAS,GAAGG,MAAeZ,EAAOG,MAAMM,SAAS,GAAGG,MAAQjB,EAAMkB,gBAAgBb,EAAOG,MAAMM,SAAS,IAKzJ,KAAK,GAJDK,GAAYnB,EAAMkB,gBAAgBb,EAAOG,MAAMM,SAAS,IAAxD,aAAwEd,EAAMkB,gBAAgBb,EAAOG,MAAMM,SAAS,IAApH,WACAM,EAAU,kBACVC,EAAW,KAENC,EAAI,EAAGA,EAAIT,EAAQS,IAAK,CAC/B,GAAMC,GAAMvB,EAAMkB,gBAAgBb,EAAOG,MAAMM,SAASQ,GACxD,IAAIC,EAAIR,OAAS,EAAG,CAClB,GAAMS,GAAAA,IAAYD,EAAZ,UAAyBD,CAC/BH,IAAUK,EACVJ,GAAAA,WAAsBE,EACtBD,GAAY,IAEZjB,EAAOY,UAAUS,KAAKzB,EAAMkB,gBAAgBb,EAAOG,MAAMM,SAASQ,MAIzE,GAAMI,GAAS,GACTC,EAAAA,eACAC,EAAAA,iEAAwEf,EAAxE,sDAAoIA,EAApI,uBACAgB,EAAAA,8EACAC,EAAAA,mBAAwBjB,EAAxB,8BAA4Da,EAA5D,oGAGH1B,GAAM+B,wBAAwB1B,EAAOG,MAAMwB,UAC3C,IAAMC,GAAejC,EAAMkC,0BAA0B7B,EAAOG,MAAMwB,U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J,GAE7BK,EAAYV,EAAO,GAEnBW,EAAQX,EAAO,GACfY,EAAKZ,EAAO,GAEZa,EAAWb,EAAO,GAClBc,EAAcd,EAAO,GAErBe,EAAaf,EAAO,GACpBgB,EAAMhB,EAAO,IAGfiB,EAAAA,0TAUUP,EAAU,GAVpB,YAUkCA,EAAU,GAV5C,YAU0DA,EAAU,GAVpE,YAUkFA,EAAU,GAV5F,YAU0GA,EAAU,GAVpH,qYA0BKnD,EAAI,EAAGA,EAAIlB,EAAOY,UAAUD,OAAQO,IAC3C0D,GAAAA,WAAmB5E,EAAOY,UAAUM,GAApC,YAAkD2C,EAAS3C,GAA3D,YAAyE4C,EAAS5C,GAAlF,YAAgG6C,EAAO7C,GAAvG,YAAqH8C,EAAG9C,GAAxH,qCACiB8C,EAAG9C,GAAK,KAAS,6IAAgJ8C,EAAG9C,GAAK,IAAQ,+FAAkG8C,EAAG9C,GAAK,IAAQ,iDAAoD8C,EAAG9C,GAAK,GAAO,IAAM,IAD7X,kCAMF0D,IAAAA,uaAagDN,EAAM,GAbtD,OAa+DC,EAAG,GAblE,qFAc2CC,EAAS,GAdpD,kEAe2CC,EAAY,GAfvD,4DAgBqCC,EAAW,GAhBhD,OAgByDA,EAAW,GAhBpE,QAgB8EA,EAAW,GAhBzF,oBAgB+GT,EAhB/G,mDAiB4BU,EAAI,GAjBhC,sEAuBAE,EAAAA,gCAAkC7E,EAAOyD,OAASmB,KAAKA,GAEzD,MAAOjC,GAAMmC,YAERnC,EAAMoC","file":"../../js/analysis/regression_model.js","sourcesContent":["define([\n '../util/utils',\n 'ng!$q',\n], (utils, $q) => {\n return {\n /**\n * createCube - create HyperCubes\n *\n * @param {Object} app reference to app\n * @param {Object} $scope angular $scope\n *\n * @return {Null} null\n */\n createCube(app, $scope) {\n const layout = $scope.layout;\n\n // Set definitions for dimensions and measures\n const dimension = utils.validateDimension(layout.props.dimensions[0]);\n const dimensions = [{\n qNullSuppression: true,\n qDef: {\n qFieldDefs: [dimension]\n },\n }];\n\n const meaLen = layout.props.measures.length;\n $scope.rowsLabel = ['(Intercept)', (layout.props.measures[1].label != '') ? layout.props.measures[1].label : utils.validateMeasure(layout.props.measures[0]) ]; // Label for dimension values\n let params = `${utils.validateMeasure(layout.props.measures[0])} as mea0, ${utils.validateMeasure(layout.props.measures[1])} as mea1`;\n let meaList = 'q$mea0 ~ q$mea1';\n let dataType = 'NN';\n\n for (let i = 2; i < meaLen; i++) {\n const mea = utils.validateMeasure(layout.props.measures[i]);\n if (mea.length > 0) {\n const param = `,${mea} as mea${i}`;\n params += param;\n meaList += ` + q$mea${i}`;\n dataType += 'N';\n\n $scope.rowsLabel.push(utils.validateMeasure(layout.props.measures[i]));\n }\n }\n\t // Normalize data - Find Correlation - Split condition - set training data for fit model using most correlated features.\n\t const soglia = 0.3;\n\t const split = `q$mea0 > 0.0`;\n\t const norm = `library(caret);target <- q$mea0; preParams <- preProcess(q[,1:${meaLen}], method=c(\"range\"));q <- predict(preParams, q[,1:${meaLen}]); q$mea0 <- target`;\n\t const cor = `m = abs(cor(subset(q,q$mea0 != 0),q$mea0[q$mea0 != 0], method = \"pearson\"))`;\n\t const fo = `f=\"\";for(j in 2:${meaLen}) if(!is.na(m[j]) && m[j]>=${soglia}){l=paste(\"q$mea\",j-1,sep=\"\"); f=paste(f,l,sep=\" + \")} ;f=paste(\"q$mea0 ~ \",substring(f,3));str(f)`;\n\t \n // Debug mode - set R dataset name to store the q data. \n utils.displayDebugModeMessage(layout.props.debugMode);\n const saveRDataset = utils.getDebugSaveDatasetScript(layout.props.debugMode, 'debug_regression_analysis.rda');\n\n const defMea1 = `R.ScriptEvalExStr('${dataType}','${saveRDataset} library(jsonlite);${norm};${cor}; ${fo}; lm_result <- lm(as.formula(f), q, ${split});lm_summary <- summary(lm_result);\n json <- toJSON(list(coef(lm_summary)[,\"Estimate\"], coef(lm_summary)[,\"Std. Error\"], coef(lm_summary)[,\"t value\"], coef(lm_summary)[,\"Pr(>|t|)\"],\n as.double(summary(lm_result$residuals)), summary(lm_result)$sigma, summary(lm_result)$df, lm_summary$r.squared, lm_summary$adj.r.squared,\n summary(lm_result)$fstatistic, extractAIC(lm_result)[2])); json;',${params})`;\n\n // Debug mode - display R Scripts to console\n utils.displayRScriptsToConsole(layout.props.debugMode, [defMea1]);\n\n const measures = [\n {\n qDef: {\n qDef: defMea1,\n },\n },\n {\n qDef: {\n qLabel: '-',\n qDef: '', // Dummy\n },\n },\n {\n qDef: {\n qLabel: '-',\n qDef: '', // Dummy\n },\n },\n {\n qDef: {\n qLabel: '-',\n qDef: '', // Dummy\n },\n },\n {\n qDef: {\n qLabel: '-',\n qDef: '', // Dummy\n },\n },\n ];\n\n $scope.backendApi.applyPatches([\n {\n qPath: '/qHyperCubeDef/qDimensions',\n qOp: 'replace',\n qValue: JSON.stringify(dimensions),\n },\n {\n qPath: '/qHyperCubeDef/qMeasures',\n qOp: 'replace',\n qValue: JSON.stringify(measures),\n },\n ], false);\n\n $scope.patchApplied = true;\n return null;\n },\n /**\n * drawChart - draw chart with updated data\n *\n * @param {Object} $scope angular $scope\n *\n * @return {Object} Promise object\n */\n drawChart($scope) {\n const defer = $q.defer();\n const layout = $scope.layout;\n\n const dimension = utils.validateDimension(layout.props.dimensions[0]);\n const requestPage = [{\n qTop: 0,\n qLeft: 0,\n qWidth: 2,\n qHeight: 1,\n }];\n\n $scope.backendApi.getData(requestPage).then((dataPages) => {\n const measureInfo = $scope.layout.qHyperCube.qMeasureInfo;\n\n // Display error when all measures' grand total return NaN.\n if (dataPages[0].qMatrix[0][1].qText.length === 0 || dataPages[0].qMatrix[0][1].qText == '-') {\n utils.displayConnectionError($scope.extId);\n } else {\n // Debug mode - display returned dataset to console\n utils.displayReturnedDatasetToConsole(layout.props.debugMode, dataPages[0]);\n\n const result = JSON.parse(dataPages[0].qMatrix[0][1].qText);\n\n const estimate = result[0];\n const stdError = result[1];\n const tValue = result[2];\n const pr = result[3];\n const minPr = Math.max.apply(null, pr);\n\n const residuals = result[4];\n\n const sigma = result[5];\n const df = result[6];\n\n const rSquared = result[7];\n const adjRSquared = result[8];\n\n const fstatistic = result[9];\n const aic = result[10];\n\n // Set table header\n let html = `\n

Residuals:

\n \n \n \n \n \n \n \n \n \n \n \n
Min1QMedian3QMax
${residuals[0]}${residuals[1]}${residuals[2]}${residuals[4]}${residuals[5]}
\n\n

Coefficients:

\n \n \n \n \n \n \n \n `;\n\n // Set regression analysis results to table\n for (let i = 0; i < $scope.rowsLabel.length; i++) {\n html += `\n \n `;\n }\n\n // Set table footer and other results\n html += `\n \n
EstimateStd.Errort valuePr(>|t|)Signif
${$scope.rowsLabel[i]}${estimate[i]}${stdError[i]}${tValue[i]}${pr[i]}${(pr[i] < 0.001) ? '' : (pr[i] < 0.01) ? '' : (pr[i] < 0.05) ? '' : (pr[i] < 0.1) ? '.' : ''}
\n
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
\n\n

Others:

\n \n \n \n \n \n \n \n \n \n \n \n \n \n
ItemValue
Residual standard error${sigma[0]} on ${df[1]} degrees of freedom
Multiple R-squared${rSquared[0]}
Adjusted R-squared${adjRSquared[0]}
F-statistic ${fstatistic[0]} on ${fstatistic[1]} and ${fstatistic[2]} DF, p-value: < ${minPr}
AIC${aic[0]}
\n `;\n\n // Set HTML element for chart\n $(`.advanced-analytics-toolsets-${$scope.extId}`).html(html);\n }\n return defer.resolve();\n });\n return defer.promise;\n },\n };\n});\n"]} \ No newline at end of file diff --git a/build/dev/lib/maps/analysis/regression_predict.js.map b/build/dev/lib/maps/analysis/regression_predict.js.map new file mode 100644 index 0000000..caf9c17 --- /dev/null +++ b/build/dev/lib/maps/analysis/regression_predict.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["analysis/regression_predict.js"],"names":["define","lineChart","utils","$q","createCube","app","$scope","layout","dimension","validateDimension","props","dimensions","qNullSuppression","qDef","qFieldDefs","qSortCriterias","qSortByExpression","dimSort","dimSortByExpression","dimSortByExpressionAsc","qSortByNumeric","dimSortByNum","dimSortByNumAsc","qSortByAscii","dimSortByAlph","dimSortByAlphAsc","qExpression","qv","dimSortByExpressionString","meaLen","measures","length","rowsLabel","validateMeasure","params","meaList","i","mea","param","push","soglia","norm","cor","fo","split","s","displayDebugModeMessage","debugMode","saveRDataset","getDebugSaveDatasetScript","defMea1","interval","confidenceLevel","defMea2","defMea3","displayRScriptsToConsole","measure","qLabel","backendApi","applyPatches","qPath","qOp","qValue","JSON","stringify","patchApplied","drawChart","defer","requestPage","qTop","qLeft","qWidth","qHeight","getData","then","dataPages","measureInfo","qHyperCube","qMeasureInfo","isNaN","qMin","qMax","displayConnectionError","extId","displayReturnedDatasetToConsole","palette","getDefaultPaletteColor","elemNum","dim1","mea1","mea2","mea3","mea4","$","each","qMatrix","key","value","qElemNumber","qNum","qText","chartData","x","y","name","mode","type","line","color","colorForSub","html","chart","draw","setEvents","resolve","promise"],"mappings":"AAAA,YAAAA,SACE,sBACA,gBACA,SACC,SAACC,EAAWC,EAAOC,GACpB,OASEC,WATK,SASMC,EAAKC,GACd,GAAMC,GAASD,EAAOC,OAChBC,EAAYN,EAAMO,kBAAkBF,EAAOG,MAAMC,WAAW,IAC5DA,IAEFC,kBAAkB,EAClBC,MACEC,YAAaN,GACbO,iBACEC,kBAAmBT,EAAOG,MAAMO,UAAYV,EAAOG,MAAMQ,oBAAsB,EAAIX,EAAOG,MAAMS,uBAChGC,eAAiBb,EAAOG,MAAMO,QAAW,EAAMV,EAAOG,MAAMW,aAAoBd,EAAOG,MAAMY,gBAAjB,EAC5EC,aAAchB,EAAOG,MAAMO,UAAYV,EAAOG,MAAMc,cAAgB,EAAIjB,EAAOG,MAAMe,iBACrFC,aACEC,GAAIpB,EAAOG,MAAMkB,gCAOrBC,EAAStB,EAAOG,MAAMoB,SAASC,MACrCzB,GAAO0B,WAAa,cAAe9B,EAAM+B,gBAAgB1B,EAAOG,MAAMoB,SAAS,IAI/E,KAAK,GAHDI,GAAYhC,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EAAMoF,yBAChBC,KACAC,KACAC,KACAC,KACAC,KACAC,IAGNC,GAAEC,KAAKnB,EAAU,GAAGoB,QAAS,SAACC,EAAKC,GACjCV,EAAQhD,KAAK0D,EAAM,GAAGC,aACR,GAAjBD,EAAM,GAAGE,MACNX,EAAKjD,KAAK0D,EAAM,GAAGG,OACnBX,EAAKlD,KAAK0D,EAAM,GAAGE,MACnBT,EAAKnD,KAAK0D,EAAM,GAAGE,MACnBR,EAAKpD,KAAK0D,EAAM,GAAGE,MACnBP,EAAKrD,KAAK0D,EAAM,GAAGE,OAGrB,IAAME,KAEFC,EAAGd,EACHe,EAAGb,EACHc,KAAM,MACfC,KAAM,OACNC,KAAM,MACGC,MACEC,MAAAA,QAAevB,EAAQ9E,EAAOG,MAAMmG,aAApC,QAMNhB,GAAAA,gCAAkCvF,EAAO6E,OAAS2B,KAAlD,sBAA6ExG,EAAO6E,MAApF,2CAEA,IAAM4B,GAAQ9G,EAAU+G,KAAK1G,EAAQ+F,EAAvB,aAA+C/F,EAAO6E,MAAS,KAC7ElF,GAAUgH,UAAUF,EAAOzG,EAAQD,GAErC,MAAO8D,GAAM+C,YAER/C,EAAMgD","file":"../../js/analysis/regression_predict.js","sourcesContent":["define([\n '../chart/line_chart',\n '../util/utils',\n 'ng!$q',\n], (lineChart, utils, $q) => {\n return {\n /**\n * createCube - create HyperCubes\n *\n * @param {Object} app reference to app\n * @param {Object} $scope angular $scope\n *\n * @return {Null} null\n */\n createCube(app, $scope) {\n const layout = $scope.layout;\n const dimension = utils.validateDimension(layout.props.dimensions[0]);\n const dimensions = [\n {\n qNullSuppression: true,\n qDef: {\n qFieldDefs: [dimension],\n qSortCriterias: [{\n qSortByExpression: layout.props.dimSort || !layout.props.dimSortByExpression ? 0 : layout.props.dimSortByExpressionAsc,\n qSortByNumeric: (layout.props.dimSort) ? 1 : (!layout.props.dimSortByNum) ? 0 : layout.props.dimSortByNumAsc,\n qSortByAscii: layout.props.dimSort || !layout.props.dimSortByAlph ? 0 : layout.props.dimSortByAlphAsc,\n qExpression: {\n qv: layout.props.dimSortByExpressionString,\n },\n }],\n },\n },\n ];\n\n const meaLen = layout.props.measures.length;\n $scope.rowsLabel = ['(Intercept)', utils.validateMeasure(layout.props.measures[1])]; // Label for dimension values\n let params = `${utils.validateMeasure(layout.props.measures[0])} as mea0, ${utils.validateMeasure(layout.props.measures[1])} as mea1`;\n let meaList = 'q$mea0 ~ q$mea1';\n\n for (let i = 2; i < meaLen; i++) {\n const mea = utils.validateMeasure(layout.props.measures[i]);\n if (mea.length > 0) {\n const param = `,${mea} as mea${i}`;\n params += param;\n meaList += ` + q$mea${i}`;\n\n $scope.rowsLabel.push(utils.validateMeasure(layout.props.measures[i]));\n } \n }\n\t \n\t // Normalize data - Find Correlation - Split condition - set training data for fit model and predict only NA values, using most correlated features. \n\t const soglia = 0.3;\n\t const norm = `library(caret);target <- q$mea0; preParams <- preProcess(q[,1:${meaLen}], method=c(\"range\"));q <- predict(preParams, q[,1:${meaLen}]); q$mea0 <- target`;\n\t const cor = `m = abs(cor(subset(q,q$mea0 != 0),q$mea0[q$mea0 != 0], method = \"pearson\"))`;\n\t const fo = `f=\"\";for(j in 2:${meaLen}) if(!is.na(m[j]) && m[j]>=${soglia}){l=paste(\"q$mea\",j-1,sep=\"\"); f=paste(f,l,sep=\" + \")} ;f=paste(\"q$mea0 ~ \",substring(f,3));str(f)`; \n\t const split = `q$mea0 > 0`;\t\n\t const s = `q = subset(q,q$mea0 == 0); q$mea0[q$mea0 == 0] <- NA;`;\n\t \n // Debug mode - set R dataset name to store the q data.\n utils.displayDebugModeMessage(layout.props.debugMode);\n const saveRDataset = utils.getDebugSaveDatasetScript(layout.props.debugMode, 'debug_regression_analysis_line_chart.rda');\n\t\t \n const defMea1 = `R.ScriptEval('${saveRDataset} ${norm}; if(sum(q$mea0)> 0 && min(q$mea0) == 0){${cor}; ${fo}; lm_result <- lm(as.formula(f), q, ${split});${s} predict(lm_result, q, interval=\"${layout.props.interval}\", level=${layout.props.confidenceLevel});} else{lm_result <- lm(${meaList});predict(lm_result, interval=\"${layout.props.interval}\", level=${layout.props.confidenceLevel}); }[,1]',${params})`;\n const defMea2 = `R.ScriptEval('${norm}; if(sum(q$mea0)> 0 && min(q$mea0) == 0){${cor}; ${fo}; lm_result <- lm(as.formula(f), q, ${split});${s} predict(lm_result, q, interval=\"${layout.props.interval}\", level=${layout.props.confidenceLevel});} else{lm_result <- lm(${meaList});predict(lm_result, interval=\"${layout.props.interval}\", level=${layout.props.confidenceLevel}); }[,2]',${params})`;\n const defMea3 = `R.ScriptEval('${norm}; if(sum(q$mea0)> 0 && min(q$mea0) == 0){${cor}; ${fo}; lm_result <- lm(as.formula(f), q, ${split});${s} predict(lm_result, q, interval=\"${layout.props.interval}\", level=${layout.props.confidenceLevel});} else{lm_result <- lm(${meaList});predict(lm_result, interval=\"${layout.props.interval}\", level=${layout.props.confidenceLevel}); }[,3]',${params})`;\n\n // Debug mode - display R Scripts to console\n utils.displayRScriptsToConsole(layout.props.debugMode, [defMea1, defMea2, defMea3]);\n\n const measure = utils.validateMeasure(layout.props.measures[0]);\n const measures = [\n {\n qDef: {\n qDef: measure,\n },\n },\n {\n qDef: {\n qDef: defMea1,\n },\n },\n {\n qDef: {\n qDef: defMea2,\n },\n },\n {\n qDef: {\n qDef: defMea3,\n },\n },\n {\n qDef: {\n qLabel: '-',\n qDef: '', // Dummy\n },\n },\n ];\n\n $scope.backendApi.applyPatches([\n {\n qPath: '/qHyperCubeDef/qDimensions',\n qOp: 'replace',\n qValue: JSON.stringify(dimensions),\n },\n {\n qPath: '/qHyperCubeDef/qMeasures',\n qOp: 'replace',\n qValue: JSON.stringify(measures),\n },\n ], false);\n\n $scope.patchApplied = true;\n return null;\n },\n /**\n * drawChart - draw chart with updated data\n *\n * @param {Object} $scope angular $scope\n *\n * @return {Object} Promise object\n */\n drawChart($scope, app) {\n const defer = $q.defer();\n const layout = $scope.layout;\n\n const requestPage = [{\n qTop: 0,\n qLeft: 0,\n qWidth: 6,\n qHeight: 1500,\n }];\n\n $scope.backendApi.getData(requestPage).then((dataPages) => {\n const measureInfo = $scope.layout.qHyperCube.qMeasureInfo;\n\n // Display error when all measures' grand total return NaN.\n if (isNaN(measureInfo[1].qMin) && isNaN(measureInfo[1].qMax)\n && isNaN(measureInfo[2].qMin) && isNaN(measureInfo[2].qMax)\n && isNaN(measureInfo[3].qMin) && isNaN(measureInfo[3].qMax)\n ) {\n utils.displayConnectionError($scope.extId);\n } else {\n // Debug mode - display returned dataset to console\n utils.displayReturnedDatasetToConsole(layout.props.debugMode, dataPages[0]);\n\t \n const palette = utils.getDefaultPaletteColor();\n const elemNum = [];\n const dim1 = []; // Dimension\n const mea1 = [];\n const mea2 = [];\n const mea3 = [];\n const mea4 = [];\n\t\t \n\t\t \n $.each(dataPages[0].qMatrix, (key, value) => { \n elemNum.push(value[0].qElemNumber);\n\t\t if(value[1].qNum == 0) \n dim1.push(value[0].qText);\t\t\n mea1.push(value[1].qNum);\n mea2.push(value[2].qNum);\n mea3.push(value[3].qNum);\n mea4.push(value[4].qNum);\n\t\t });\n\n const chartData = [ \n {\n x: dim1,\n y: mea2,\n name: 'Fit',\n\t\t\t mode: 'none',\n\t\t\t type: 'bar',\n line: {\n color: `rgba(${palette[layout.props.colorForSub]},1)`,\n },\n },\n ];\n\n // Set HTML element for chart\n $(`.advanced-analytics-toolsets-${$scope.extId}`).html(`
`);\n\n const chart = lineChart.draw($scope, chartData, `aat-chart-${$scope.extId}`, null);\n lineChart.setEvents(chart, $scope, app);\n }\n return defer.resolve();\n });\n return defer.promise;\n },\n };\n});\n"]} \ No newline at end of file diff --git a/build/dev/lib/maps/analysis/regression_predict_table.js.map b/build/dev/lib/maps/analysis/regression_predict_table.js.map new file mode 100644 index 0000000..42a3b16 --- /dev/null +++ b/build/dev/lib/maps/analysis/regression_predict_table.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["analysis/regression_predict_table.js"],"names":["define","lineChart","utils","$q","createCube","app","$scope","layout","dimension","validateDimension","props","dimensions","qNullSuppression","qDef","qFieldDefs","qSortCriterias","qSortByExpression","dimSort","dimSortByExpression","dimSortByExpressionAsc","qSortByNumeric","dimSortByNum","dimSortByNumAsc","qSortByAscii","dimSortByAlph","dimSortByAlphAsc","qExpression","qv","dimSortByExpressionString","meaLen","measures","length","rowsLabel","validateMeasure","params","meaList","i","mea","param","push","soglia","norm","cor","fo","split","s","displayDebugModeMessage","debugMode","saveRDataset","getDebugSaveDatasetScript","defMea1","interval","confidenceLevel","defMea2","defMea3","displayRScriptsToConsole","measure","qLabel","backendApi","applyPatches","qPath","qOp","qValue","JSON","stringify","patchApplied","drawChart","defer","requestPage","qTop","qLeft","qWidth","qHeight","getData","then","dataPages","measureInfo","qHyperCube","qMeasureInfo","isNaN","qMin","qMax","displayConnectionError","extId","displayReturnedDatasetToConsole","elemNum","getDefaultPaletteColor","dim1","mea1","mea2","mea3","mea4","$","each","qMatrix","key","value","qElemNumber","qNum","qText","html","Math","ceil","resolve","promise"],"mappings":"AAAA,YAAAA,SACE,sBACA,gBACA,SACC,SAACC,EAAWC,EAAOC,GACpB,OASEC,WATK,SASMC,EAAKC,GACd,GAAMC,GAASD,EAAOC,OAChBC,EAAYN,EAAMO,kBAAkBF,EAAOG,MAAMC,WAAW,IAC5DA,IAEFC,kBAAkB,EAClBC,MACEC,YAAaN,GACbO,iBACEC,kBAAmBT,EAAOG,MAAMO,UAAYV,EAAOG,MAAMQ,oBAAsB,EAAIX,EAAOG,MAAMS,uBAChGC,eAAiBb,EAAOG,MAAMO,QAAW,EAAMV,EAAOG,MAAMW,aAAoBd,EAAOG,MAAMY,gBAAjB,EAC5EC,aAAchB,EAAOG,MAAMO,UAAYV,EAAOG,MAAMc,cAAgB,EAAIjB,EAAOG,MAAMe,iBACrFC,aACEC,GAAIpB,EAAOG,MAAMkB,gCAOrBC,EAAStB,EAAOG,MAAMoB,SAASC,MACrCzB,GAAO0B,WAAa,cAAe9B,EAAM+B,gBAAgB1B,E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AAOG,MAAMqC,UAAW4B,EAAU,GAExE,IACMU,IADUnF,EAAMoF,6BAEhBC,KACAC,KACAC,KACAC,KACAC,IAGNC,GAAEC,KAAKlB,EAAU,GAAGmB,QAAS,SAACC,EAAKC,GACjCX,EAAQ9C,KAAKyD,EAAM,GAAGC,aACR,GAAjBD,EAAM,GAAGE,MACNX,EAAKhD,KAAKyD,EAAM,GAAGG,OACnBX,EAAKjD,KAAKyD,EAAM,GAAGE,MACnBT,EAAKlD,KAAKyD,EAAM,GAAGE,MACnBR,EAAKnD,KAAKyD,EAAM,GAAGE,MACnBP,EAAKpD,KAAKyD,EAAM,GAAGE,OAiBrB,KAAK,GAZDE,GAAAA,+PAYKhE,EAAI,EAAGA,EAAImD,EAAKxD,OAAQK,IAC/BgE,GAAAA,WAAmBb,EAAKnD,GAAxB,YAAsCiE,KAAKC,KAAKb,EAAKrD,IAArD,kCAKFgE,IAAAA,0DAMAR,EAAAA,gCAAkCtF,EAAO6E,OAASiB,KAAKA,GAGzD,MAAOjC,GAAMoC,YAERpC,EAAMqC","file":"../../js/analysis/regression_predict_table.js","sourcesContent":["define([\n '../chart/line_chart',\n '../util/utils',\n 'ng!$q',\n], (lineChart, utils, $q) => {\n return {\n /**\n * createCube - create HyperCubes\n *\n * @param {Object} app reference to app\n * @param {Object} $scope angular $scope\n *\n * @return {Null} null\n */\n createCube(app, $scope) {\n const layout = $scope.layout;\n const dimension = utils.validateDimension(layout.props.dimensions[0]);\n const dimensions = [\n {\n qNullSuppression: true,\n qDef: {\n qFieldDefs: [dimension],\n qSortCriterias: [{\n qSortByExpression: layout.props.dimSort || !layout.props.dimSortByExpression ? 0 : layout.props.dimSortByExpressionAsc,\n qSortByNumeric: (layout.props.dimSort) ? 1 : (!layout.props.dimSortByNum) ? 0 : layout.props.dimSortByNumAsc,\n qSortByAscii: layout.props.dimSort || !layout.props.dimSortByAlph ? 0 : layout.props.dimSortByAlphAsc,\n qExpression: {\n qv: layout.props.dimSortByExpressionString,\n },\n }],\n },\n },\n ];\n\n const meaLen = layout.props.measures.length;\n $scope.rowsLabel = ['(Intercept)', utils.validateMeasure(layout.props.measures[1])]; // Label for dimension values\n let params = `${utils.validateMeasure(layout.props.measures[0])} as mea0, ${utils.validateMeasure(layout.props.measures[1])} as mea1`;\n let meaList = 'q$mea0 ~ q$mea1';\n\n for (let i = 2; i < meaLen; i++) {\n const mea = utils.validateMeasure(layout.props.measures[i]);\n if (mea.length > 0) {\n const param = `,${mea} as mea${i}`;\n params += param;\n meaList += ` + q$mea${i}`;\n\n $scope.rowsLabel.push(utils.validateMeasure(layout.props.measures[i]));\n } \n }\n\t \n\t // Normalize data - Find Correlation - Split condition - set training data for fit model and predict only NA values, using most correlated features. \n\t const soglia = 0.3;\n\t const norm = `library(caret);target <- q$mea0; preParams <- preProcess(q[,1:${meaLen}], method=c(\"range\"));q <- predict(preParams, q[,1:${meaLen}]); q$mea0 <- target`;\n\t const cor = `m = abs(cor(subset(q,q$mea0 != 0),q$mea0[q$mea0 != 0], method = \"pearson\"))`;\n\t const fo = `f=\"\";for(j in 2:${meaLen}) if(!is.na(m[j]) && m[j]>=${soglia}){l=paste(\"q$mea\",j-1,sep=\"\"); f=paste(f,l,sep=\" + \")} ;f=paste(\"q$mea0 ~ \",substring(f,3));str(f)`; \n\t const split = `q$mea0 > 0`;\t\n\t const s = `q = subset(q,q$mea0 == 0); q$mea0[q$mea0 == 0] <- NA;`;\n\t \n // Debug mode - set R dataset name to store the q data.\n utils.displayDebugModeMessage(layout.props.debugMode);\n const saveRDataset = utils.getDebugSaveDatasetScript(layout.props.debugMode, 'debug_regression_analysis_line_chart.rda');\n\t\t \n const defMea1 = `R.ScriptEval('${saveRDataset} ${norm}; if(sum(q$mea0)> 0 && min(q$mea0) == 0){${cor}; ${fo}; lm_result <- lm(as.formula(f), q, ${split});${s} predict(lm_result, q, interval=\"${layout.props.interval}\", level=${layout.props.confidenceLevel});} else{lm_result <- lm(${meaList});predict(lm_result, interval=\"${layout.props.interval}\", level=${layout.props.confidenceLevel}); }[,1]',${params})`;\n const defMea2 = `R.ScriptEval('${norm}; if(sum(q$mea0)> 0 && min(q$mea0) == 0){${cor}; ${fo}; lm_result <- lm(as.formula(f), q, ${split});${s} predict(lm_result, q, interval=\"${layout.props.interval}\", level=${layout.props.confidenceLevel});} else{lm_result <- lm(${meaList});predict(lm_result, interval=\"${layout.props.interval}\", level=${layout.props.confidenceLevel}); }[,2]',${params})`;\n const defMea3 = `R.ScriptEval('${norm}; if(sum(q$mea0)> 0 && min(q$mea0) == 0){${cor}; ${fo}; lm_result <- lm(as.formula(f), q, ${split});${s} predict(lm_result, q, interval=\"${layout.props.interval}\", level=${layout.props.confidenceLevel});} else{lm_result <- lm(${meaList});predict(lm_result, interval=\"${layout.props.interval}\", level=${layout.props.confidenceLevel}); }[,3]',${params})`;\n\n // Debug mode - display R Scripts to console\n utils.displayRScriptsToConsole(layout.props.debugMode, [defMea1, defMea2, defMea3]);\n\n const measure = utils.validateMeasure(layout.props.measures[0]);\n const measures = [\n {\n qDef: {\n qDef: measure,\n },\n },\n {\n qDef: {\n qDef: defMea1,\n },\n },\n {\n qDef: {\n qDef: defMea2,\n },\n },\n {\n qDef: {\n qDef: defMea3,\n },\n },\n {\n qDef: {\n qLabel: '-',\n qDef: '', // Dummy\n },\n },\n ];\n\n $scope.backendApi.applyPatches([\n {\n qPath: '/qHyperCubeDef/qDimensions',\n qOp: 'replace',\n qValue: JSON.stringify(dimensions),\n },\n {\n qPath: '/qHyperCubeDef/qMeasures',\n qOp: 'replace',\n qValue: JSON.stringify(measures),\n },\n ], false);\n\n $scope.patchApplied = true;\n return null;\n },\n /**\n * drawChart - draw chart with updated data\n *\n * @param {Object} $scope angular $scope\n *\n * @return {Object} Promise object\n */\n drawChart($scope, app) {\n const defer = $q.defer();\n const layout = $scope.layout;\n\n const requestPage = [{\n qTop: 0,\n qLeft: 0,\n qWidth: 6,\n qHeight: 1500,\n }];\n\n $scope.backendApi.getData(requestPage).then((dataPages) => {\n const measureInfo = $scope.layout.qHyperCube.qMeasureInfo;\n\n // Display error when all measures' grand total return NaN.\n if (isNaN(measureInfo[1].qMin) && isNaN(measureInfo[1].qMax)\n && isNaN(measureInfo[2].qMin) && isNaN(measureInfo[2].qMax)\n && isNaN(measureInfo[3].qMin) && isNaN(measureInfo[3].qMax)\n ) {\n utils.displayConnectionError($scope.extId);\n } else {\n // Debug mode - display returned dataset to console\n utils.displayReturnedDatasetToConsole(layout.props.debugMode, dataPages[0]);\n\t \n const palette = utils.getDefaultPaletteColor();\n const elemNum = [];\n const dim1 = []; // Dimension\n const mea1 = [];\n const mea2 = [];\n const mea3 = [];\n const mea4 = [];\n\t\t \n\t\t \n $.each(dataPages[0].qMatrix, (key, value) => { \n elemNum.push(value[0].qElemNumber);\n\t\t if(value[1].qNum == 0) \n dim1.push(value[0].qText);\t\t\n mea1.push(value[1].qNum);\n mea2.push(value[2].qNum);\n mea3.push(value[3].qNum);\n mea4.push(value[4].qNum);\n\t\t });\n\n\t\t \n // Set table header\n let html = `\n

Predicted:

\n \n \n \n \n \n \n \n `;\n\t\t \n\t\t // Set regression analysis results to table\n for (let i = 0; i < dim1.length; i++) {\n html += `\n `;\n }\n\n // Set table footer and other results\n html += `\n \n
CodeRemaining Life
${dim1[i]}${Math.ceil(mea2[i])}
\n\t\t `;\n\t\t \n\t \t // Set HTML element for chart\n $(`.advanced-analytics-toolsets-${$scope.extId}`).html(html); \n\t\t \n }\n return defer.resolve();\n });\n return defer.promise;\n },\n };\n});\n"]} \ No newline at end of file diff --git a/build/dev/lib/maps/properties.js.map b/build/dev/lib/maps/properties.js.map index fe337c5..527f43c 100644 --- a/build/dev/lib/maps/properties.js.map +++ b/build/dev/lib/maps/properties.js.map @@ -1 +1 @@ -{"version":3,"sources":["properties.js"],"names":["define","analysis","qlik","$q","enableDebugMode","getNumberFormatSimple","app","currApp","undefined","defer","getAppLayout","layout","thousandSep","qLocaleInfo","qThousandSep","decimalSep","qDecimalSep","resolve","value","label","promise","type","component","items","dims","Dimensions","ref","itemTitleRef","allowAdd","allowRemove","addTranslation","expression","maxlength","meas","Measures","numberFormatting","options","defaultValue","formatting","show","data","numberFormattingSimple","then","customCurrency","prefixSuffix","numberFormatPattern","moneyFormatPattern","customFormatPattern","sorting","indexOf","props","analysisTypeId","sortDim","dimSort","dimSortByExpression","dimSortByExpressionAsc","dimSortByExpressionString","dimSortByNum","dimSortByNumAsc","dimSortByAlph","dimSortByAlphAsc","addons","uses","dataHandling","ReferenceLine","fixlimit","fixlimitlabel","fixlimitstyle","fixlimitwidth","fixlimitcolor","analysisCategoryDropDown","analysisCategories","map","d","id","name","analysisTypeDropDown","res","analysisTypes","filter","category","analysisCategoryId","displayTable","displayFormula","extendLine","extendDurations","interval","confidenceLevel","frequency","numberOfClusters","optimizationMethod","clusterMax","bootstrap","scaleData","dividedBy","differencing","seasonalDifferences","firstDifferences","lagMax","lagMaxValue","lag","lagValue","decomposeInFourCharts","forecastingPeriods","displayARIMAParams","autoARIMA","AROrder","DegreeOfDifferencing","MAOrder","SeasonalAROrder","SeasonalDegreeOfDifferencing","SeasonalMAOrder","displayHoltWintersParams","autoHoltWinters","holtWintersAlpha","holtWintersBeta","holtWintersGamma","seasonal","numOfFrequentTerms","tolower","removeNumbers","stopwords","removePunctuation","stemming","rpartMethod","minSplit","minBucket","cp","maxDepth","defaultCollapseLevel","displayResultsOnAllNodes","calcOddsRatio","splitDataset","splitPercentage","min","max","debugMode","debugModeLink","url","settings","presentation","line","datapoints","borderWidth","step","pointRadius","bubbleSize","marginTop","marginBottom","marginRight","marginLeft","defineScreenSize","screenWidth","screenHeight","colorsAndLegend","colors","colorForMain","colorForSub","showLegend","xAxis","xLabelsAndTitle","xAxisPosition","xScale","xAxisType","yAxis","yLabelsAndTitle","yAxisPosition","yScale","zAxis","zLabelsAndTitle"],"mappings":"AAAA,YAAAA,SAAQ,6BAA8B,OAAQ,SAAU,SAACC,EAAUC,EAAMC,GAEvE,GAAMC,IAAkB,EAElBC,E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AO,QACPO,IAAK,eACLU,UACElB,OAAO,EACPC,MAAO,OAEPD,OAAO,EACPC,MAAO,QAETkB,cAAc,EACdE,KAAM,SAACC,GACL,OAAQ,EAAG,EAAG,EAAG,EAAG,EAAG,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,IAAIS,QAAQT,EAAKU,MAAMC,iBAAmB,MAKjGqH,OACEnJ,KAAM,QACNF,MAAO,SACPoB,KAAM,SAACC,GACL,OAAQ,IAAIS,QAAQT,EAAKU,MAAMC,iBAAmB,GAEpD5B,OACEkJ,iBACEpJ,KAAM,UACNF,MAAO,aACPG,UAAW,SACXI,IAAK,wBACLU,UACElB,OAAO,EACPC,MAAO,OAEPD,OAAO,EACPC,MAAO,QAETkB,cAAc,EACdE,KAAM,SAACC,GACL,OAAQ,IAAIS,QAAQT,EAAKU,MAAMC,iBAAmB","file":"../../properties.js","sourcesContent":["define(['./lib/js/analysis/analysis', 'qlik', 'ng!$q'], (analysis, qlik, $q) => {\r\n // Control on debug mode\r\n const enableDebugMode = true;\r\n\r\n const getNumberFormatSimple = () => {\r\n const app = qlik.currApp(this);\r\n const defer = $q.defer();\r\n\r\n app.getAppLayout((layout) => {\r\n const thousandSep = layout.qLocaleInfo.qThousandSep;\r\n const decimalSep = layout.qLocaleInfo.qDecimalSep;\r\n return defer.resolve(\r\n [\r\n {\r\n value: 0,\r\n label: `1${thousandSep}000`,\r\n },\r\n {\r\n value: 1,\r\n label: `1${thousandSep}000${decimalSep}1`,\r\n },\r\n {\r\n value: 2,\r\n label: `1${thousandSep}000${decimalSep}12`,\r\n },\r\n {\r\n value: 3,\r\n label: '12%',\r\n },\r\n {\r\n value: 4,\r\n label: `12${decimalSep}3%`,\r\n },\r\n {\r\n value: 5,\r\n label: `12${decimalSep}34%`,\r\n },\r\n ]);\r\n });\r\n return defer.promise;\r\n };\r\n\r\n return {\r\n type: 'items',\r\n component: 'accordion',\r\n items: {\r\n // dimensions: {\r\n // uses: \"dimensions\",\r\n // show: false,\r\n // },\r\n // measures: {\r\n // uses: \"measures\",\r\n // show: false,\r\n // },\r\n dims: {\r\n label: 'Dimensions',\r\n items: {\r\n Dimensions: {\r\n type: 'array',\r\n ref: 'props.dimensions',\r\n label: 'Dimensions',\r\n itemTitleRef: 'label',\r\n allowAdd: true,\r\n allowRemove: true,\r\n addTranslation: 'Add dimension',\r\n items: {\r\n expression: {\r\n label: 'Field',\r\n type: 'string',\r\n ref: 'expression',\r\n expression: 'optional',\r\n },\r\n label: {\r\n label: 'Label',\r\n type: 'string',\r\n maxlength: 100,\r\n ref: 'label',\r\n },\r\n },\r\n },\r\n },\r\n },\r\n meas: {\r\n label: 'Measures',\r\n items: {\r\n Measures: {\r\n type: 'array',\r\n ref: 'props.measures',\r\n label: 'Measures',\r\n itemTitleRef: 'label',\r\n allowAdd: true,\r\n allowRemove: true,\r\n addTranslation: 'Add measure',\r\n items: {\r\n expression: {\r\n label: 'Expression',\r\n type: 'string',\r\n ref: 'expression',\r\n expression: 'optional',\r\n },\r\n label: {\r\n label: 'Label',\r\n type: 'string',\r\n maxlength: 100,\r\n ref: 'label',\r\n },\r\n numberFormatting: {\r\n type: 'string',\r\n component: 'dropdown',\r\n label: 'Number formatting',\r\n ref: 'numberFormatting',\r\n options: [\r\n {\r\n value: 0,\r\n label: 'Auto',\r\n },\r\n {\r\n value: 1,\r\n label: 'Number',\r\n },\r\n {\r\n value: 2,\r\n label: 'Money',\r\n },\r\n {\r\n value: 5,\r\n label: 'Custom',\r\n },\r\n ],\r\n defaultValue: 0,\r\n },\r\n formatting: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Formatting',\r\n ref: 'formatting',\r\n options: [{\r\n value: true,\r\n label: 'Simple',\r\n }, {\r\n value: false,\r\n label: 'Custom',\r\n }],\r\n defaultValue: true,\r\n show: (data) => {\r\n return data.numberFormatting === 1;\r\n },\r\n },\r\n numberFormattingSimple: {\r\n type: 'string',\r\n component: 'dropdown',\r\n ref: 'numberFormattingSimple',\r\n options: getNumberFormatSimple().then((items) => {\r\n return items;\r\n }),\r\n defaultValue: 2,\r\n show: (data) => {\r\n return data.numberFormatting === 1 && (data.formatting === true || typeof data.formatting == 'undefined');\r\n },\r\n },\r\n customCurrency: {\r\n label: 'Currency',\r\n type: 'string',\r\n maxlength: 100,\r\n ref: 'customCurrency',\r\n defaultValue: '$',\r\n show: (data) => {\r\n return data.numberFormatting === 2;\r\n },\r\n },\r\n prefixSuffix: {\r\n type: 'string',\r\n component: 'dropdown',\r\n ref: 'prefixSuffix',\r\n options: [{\r\n value: 'prefix',\r\n label: 'Prefix',\r\n }, {\r\n value: 'suffix',\r\n label: 'Suffix',\r\n }],\r\n defaultValue: 'prefix',\r\n show: (data) => {\r\n return data.numberFormatting === 2;\r\n },\r\n },\r\n numberFormatPattern: {\r\n label: 'Format pattern',\r\n type: 'string',\r\n maxlength: 100,\r\n ref: 'numberFormatPattern',\r\n defaultValue: ',.2f',\r\n show: (data) => {\r\n return data.numberFormatting === 1 && data.formatting === false;\r\n },\r\n },\r\n moneyFormatPattern: {\r\n label: 'Format pattern',\r\n type: 'string',\r\n maxlength: 100,\r\n ref: 'moneyFormatPattern',\r\n defaultValue: ',.2f',\r\n show: (data) => {\r\n return data.numberFormatting === 2;\r\n },\r\n },\r\n customFormatPattern: {\r\n label: 'Format pattern',\r\n type: 'string',\r\n maxlength: 100,\r\n ref: 'customFormatPattern',\r\n defaultValue: ',.2f',\r\n show: (data) => {\r\n return data.numberFormatting === 5;\r\n },\r\n },\r\n },\r\n },\r\n },\r\n },\r\n sorting: {\r\n type: 'items',\r\n label: 'Sorting',\r\n show: (data) => {\r\n return [0, 17].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n items: {\r\n sortDim: {\r\n type: 'items',\r\n label: 'Dimension',\r\n items: {\r\n dimSort: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Sorting',\r\n ref: 'props.dimSort',\r\n options: [{\r\n value: true,\r\n label: 'Auto',\r\n }, {\r\n value: false,\r\n label: 'Custom',\r\n }],\r\n defaultValue: true,\r\n },\r\n dimSortByExpression: {\r\n type: 'boolean',\r\n label: 'Sort by expression',\r\n ref: 'props.dimSortByExpression',\r\n defaultValue: false,\r\n show: (data) => {\r\n return !data.props.dimSort;\r\n },\r\n },\r\n dimSortByExpressionAsc: {\r\n type: 'integer',\r\n component: 'dropdown',\r\n ref: 'props.dimSortByExpressionAsc',\r\n options: [{\r\n value: 1,\r\n label: 'Ascending',\r\n }, {\r\n value: -1,\r\n label: 'Descending',\r\n }],\r\n defaultValue: 1,\r\n show: (data) => {\r\n return !data.props.dimSort && data.props.dimSortByExpression;\r\n },\r\n },\r\n dimSortByExpressionString: {\r\n label: 'Expression',\r\n type: 'string',\r\n ref: 'props.dimSortByExpressionString',\r\n expression: 'optional',\r\n show: (data) => {\r\n return !data.props.dimSort && data.props.dimSortByExpression;\r\n },\r\n },\r\n dimSortByNum: {\r\n type: 'boolean',\r\n label: 'Sort numerically',\r\n ref: 'props.dimSortByNum',\r\n defaultValue: false,\r\n show: (data) => {\r\n return !data.props.dimSort;\r\n },\r\n },\r\n dimSortByNumAsc: {\r\n type: 'integer',\r\n component: 'dropdown',\r\n ref: 'props.dimSortByNumAsc',\r\n options: [{\r\n value: 1,\r\n label: 'Ascending',\r\n }, {\r\n value: -1,\r\n label: 'Descending',\r\n }],\r\n defaultValue: 1,\r\n show: (data) => {\r\n return !data.props.dimSort && data.props.dimSortByNum;\r\n },\r\n },\r\n dimSortByAlph: {\r\n type: 'boolean',\r\n label: 'Sort alphabetically',\r\n ref: 'props.dimSortByAlph',\r\n defaultValue: false,\r\n show: (data) => {\r\n return !data.props.dimSort;\r\n },\r\n },\r\n dimSortByAlphAsc: {\r\n type: 'integer',\r\n component: 'dropdown',\r\n ref: 'props.dimSortByAlphAsc',\r\n options: [{\r\n value: 1,\r\n label: 'Ascending',\r\n }, {\r\n value: -1,\r\n label: 'Descending',\r\n }],\r\n defaultValue: 1,\r\n show: (data) => {\r\n return !data.props.dimSort && data.props.dimSortByAlph;\r\n },\r\n },\r\n },\r\n },\r\n },\r\n },\r\n addons: {\r\n uses: 'addons',\r\n items: {\r\n dataHandling: {\r\n uses: 'dataHandling',\r\n },\r\n // Section for Reference Line\r\n ReferenceLine: {\r\n label: 'Reference Line',\r\n items: {\r\n fixlimit: {\r\n ref: 'props.limit',\r\n label: 'Limit',\r\n type: 'integer',\r\n defaultValue: \"\",\r\n show: (data) => {\r\n return [9].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n fixlimitlabel:{\r\n type:'string',\r\n label:'Label',\r\n ref:'props.limitlabel',\r\n defaultValue:'Reference Line',\r\n show:(data)=>{\r\n return[9].indexOf(data.props.analysisTypeId)>=0;\r\n },\r\n },\r\n //line style\r\n fixlimitstyle: {\r\n type: 'string',\r\n label: 'Line style',\r\n component: 'dropdown',\r\n ref: 'props.limitstyle',\r\n options: [{\r\n value: 'lines',\r\n label: 'lines',\r\n }, {\r\n value: 'dashdot',\r\n label: 'dashdot',\r\n }, {\r\n value: 'solid',\r\n label: 'solid',\r\n }, {\r\n value: 'dot',\r\n label: 'dot',\r\n }],\r\n defaultValue: 'lines',\r\n show: (data) => {\r\n return [9].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n //line width\r\n fixlimitwidth: {\r\n type: 'string',\r\n label: 'Line Width',\r\n component: 'dropdown',\r\n ref: 'props.limitwidth',\r\n options: [{\r\n value: '1',\r\n label: 'tiny',\r\n }, {\r\n value: '2',\r\n label: 'mid',\r\n }, {\r\n value: '4',\r\n label: 'huge',\r\n }],\r\n defaultValue: '1',\r\n show: (data) => {\r\n return [9].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n // line color\r\n fixlimitcolor: {\r\n label: 'Color',\r\n component: 'color-picker',\r\n ref: 'props.limitcolor',\r\n type: 'integer',\r\n defaultValue: 11,\r\n show: (data) => {\r\n return [9].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n },\r\n },\r\n //end of section for Reference line\r\n },\r\n },\r\n analysis: {\r\n label: 'Analysis Settings',\r\n items: {\r\n analysisCategoryDropDown: {\r\n type: 'integer',\r\n component: 'dropdown',\r\n label: 'Analysis Category',\r\n ref: 'props.analysisCategoryId',\r\n options: analysis.analysisCategories.map((d) => {\r\n return {\r\n value: d.id,\r\n label: d.name,\r\n };\r\n }),\r\n defaultValue: -1,\r\n },\r\n analysisTypeDropDown: {\r\n type: 'integer',\r\n component: 'dropdown',\r\n label: 'Analysis Type',\r\n ref: 'props.analysisTypeId',\r\n options: (data) => {\r\n const res = analysis.analysisTypes\r\n .filter((d) => {\r\n return d.category === data.props.analysisCategoryId;\r\n })\r\n .map((d) => {\r\n return {\r\n value: d.id,\r\n label: d.name,\r\n };\r\n });\r\n return res;\r\n },\r\n show: (data) => {\r\n return data.props.analysisCategoryId >= 0;\r\n },\r\n defaultValue: -1,\r\n },\r\n displayTable: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Table display mode',\r\n ref: 'props.displayTable',\r\n options: [{\r\n value: false,\r\n label: 'Off',\r\n }, {\r\n value: true,\r\n label: 'On',\r\n }],\r\n defaultValue: false,\r\n show: (data) => {\r\n return [0, 9, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n // *****\r\n // Analysis Options\r\n // *****\r\n displayFormula: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Display formula',\r\n ref: 'props.displayFormula',\r\n options: [{\r\n value: false,\r\n label: 'Off',\r\n }, {\r\n value: true,\r\n label: 'On',\r\n }],\r\n defaultValue: false,\r\n show: (data) => {\r\n return [0].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n extendLine: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Extend line',\r\n ref: 'props.extendLine',\r\n options: [{\r\n value: false,\r\n label: 'Off',\r\n }, {\r\n value: true,\r\n label: 'On',\r\n }],\r\n defaultValue: false,\r\n show: (data) => {\r\n return [0].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n extendDurations: {\r\n ref: 'props.extendDurations',\r\n label: 'Extend durations',\r\n type: 'string',\r\n show: (data) => {\r\n return [0].indexOf(data.props.analysisTypeId) >= 0 && data.props.extendLine === true;\r\n },\r\n defaultValue: 12,\r\n },\r\n interval: {\r\n type: 'string',\r\n component: 'dropdown',\r\n label: 'Interval',\r\n ref: 'props.interval',\r\n options: [{\r\n value: 'confidence',\r\n label: 'confidence',\r\n }, {\r\n value: 'prediction',\r\n label: 'prediction',\r\n }],\r\n defaultValue: 'confidence',\r\n show: (data) => {\r\n return [0, 1, 17].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n confidenceLevel: {\r\n ref: 'props.confidenceLevel',\r\n label: 'Confidence level',\r\n type: 'string',\r\n show: (data) => {\r\n return [0, 1, 2, 3, 4, 5, 9, 17, 22, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n defaultValue: 0.95,\r\n },\r\n frequency: {\r\n ref: 'props.frequency',\r\n label: 'Frequency',\r\n type: 'integer',\r\n show: (data) => {\r\n return [8, 9, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n defaultValue: 12,\r\n },\r\n // k-means\r\n numberOfClusters: {\r\n ref: 'props.numberOfClusters',\r\n label: 'Number of clusters',\r\n type: 'integer',\r\n show: (data) => {\r\n return [10, 16, 24].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n defaultValue: 3,\r\n },\r\n optimizationMethod: {\r\n ref: 'props.optimizationMethod',\r\n label: 'Optimization method',\r\n component: 'dropdown',\r\n type: 'string',\r\n options: [{\r\n value: 'gap',\r\n label: 'Gap Statistic',\r\n }],\r\n defaultValue: 'gap',\r\n show: (data) => {\r\n return [23].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n clusterMax: {\r\n ref: 'props.clusterMax',\r\n label: 'Max number of clusters',\r\n type: 'integer',\r\n show: (data) => {\r\n return [23].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n defaultValue: 10,\r\n },\r\n bootstrap: {\r\n ref: 'props.bootstrap',\r\n label: 'Number of Monte Carlo samples',\r\n type: 'integer',\r\n show: (data) => {\r\n return [23].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n defaultValue: 10,\r\n },\r\n scaleData: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Scale data',\r\n ref: 'props.scaleData',\r\n options: [{\r\n value: false,\r\n label: 'Off',\r\n }, {\r\n value: true,\r\n label: 'On',\r\n }],\r\n defaultValue: false,\r\n show: (data) => {\r\n return [10, 16, 23, 24].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n dividedBy: {\r\n type: 'string',\r\n component: 'dropdown',\r\n label: 'Grouped by',\r\n ref: 'props.dividedBy',\r\n options: [{\r\n value: 'variables',\r\n label: 'Variables',\r\n },\r\n {\r\n value: 'clusters',\r\n label: 'Clusters',\r\n }],\r\n defaultValue: 'clusters',\r\n show: (data) => {\r\n return [24].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n // Time series analysis\r\n differencing: {\r\n ref: 'props.differencing',\r\n label: 'Differencing',\r\n component: 'dropdown',\r\n type: 'integer',\r\n options: [{\r\n value: 0,\r\n label: 'Off',\r\n }, {\r\n value: 1,\r\n label: 'Seasonal differences',\r\n }, {\r\n value: 2,\r\n label: 'First and seasonal differences',\r\n }],\r\n defaultValue: 0,\r\n show: (data) => {\r\n return [6, 7, 12].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n seasonalDifferences: {\r\n ref: 'props.seasonalDifferences',\r\n label: 'Seasonal differences',\r\n type: 'integer',\r\n defaultValue: 12,\r\n show: (data) => {\r\n return [6, 7, 12].indexOf(data.props.analysisTypeId) >= 0 && [1, 2].indexOf(data.props.differencing) >= 0;\r\n },\r\n },\r\n firstDifferences: {\r\n ref: 'props.firstDifferences',\r\n label: 'First differences',\r\n type: 'integer',\r\n defaultValue: 1,\r\n show: (data) => {\r\n return [6, 7, 9, 12].indexOf(data.props.analysisTypeId) >= 0 && data.props.differencing === 2;\r\n },\r\n },\r\n // Autocorrelation\r\n lagMax: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Lag max',\r\n ref: 'props.lagMax',\r\n options: [{\r\n value: true,\r\n label: 'Auto',\r\n }, {\r\n value: false,\r\n label: 'Custom',\r\n }],\r\n defaultValue: true,\r\n show: (data) => {\r\n return [6].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n lagMaxValue: {\r\n ref: 'props.lagMaxValue',\r\n label: 'Lag max',\r\n type: 'integer',\r\n defaultValue: 20,\r\n show: (data) => {\r\n return [6].indexOf(data.props.analysisTypeId) >= 0 && data.props.lagMax === false;\r\n },\r\n },\r\n // Ljung-Box Test\r\n lag: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Lag',\r\n ref: 'props.lag',\r\n options: [{\r\n value: true,\r\n label: 'Auto',\r\n }, {\r\n value: false,\r\n label: 'Custom',\r\n }],\r\n defaultValue: true,\r\n show: (data) => {\r\n return [7].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n lagValue: {\r\n ref: 'props.lagValue',\r\n label: 'Lag',\r\n type: 'integer',\r\n defaultValue: 1,\r\n show: (data) => {\r\n return [7].indexOf(data.props.analysisTypeId) >= 0 && data.props.lag === false;\r\n },\r\n },\r\n // Decompose time series\r\n decomposeInFourCharts: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Display in 4 charts ',\r\n ref: 'props.decomposeInFourCharts',\r\n options: [{\r\n value: true,\r\n label: 'On',\r\n }, {\r\n value: false,\r\n label: 'Off',\r\n }],\r\n defaultValue: true,\r\n show: (data) => {\r\n return [8].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n // ARIMA forecast\r\n forecastingPeriods: {\r\n ref: 'props.forecastingPeriods',\r\n label: 'Forecasting periods',\r\n type: 'integer',\r\n show: (data) => {\r\n return [9, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n defaultValue: 12,\r\n },\r\n displayARIMAParams: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Display ARIMA parameters',\r\n ref: 'props.displayARIMAParams',\r\n options: [{\r\n value: false,\r\n label: 'Off',\r\n }, {\r\n value: true,\r\n label: 'On',\r\n }],\r\n defaultValue: false,\r\n show: (data) => {\r\n return [9].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n autoARIMA: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Parameter settings',\r\n ref: 'props.autoARIMA',\r\n options: [{\r\n value: true,\r\n label: 'Auto',\r\n }, {\r\n value: false,\r\n label: 'Custom',\r\n }],\r\n defaultValue: true,\r\n show: (data) => {\r\n return [9].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n AROrder: {\r\n ref: 'props.AROrder',\r\n label: 'AR Order(p)',\r\n type: 'integer',\r\n defaultValue: 0,\r\n show: (data) => {\r\n return [9].indexOf(data.props.analysisTypeId) >= 0 && data.props.autoARIMA === false;\r\n },\r\n },\r\n DegreeOfDifferencing: {\r\n ref: 'props.DegreeOfDifferencing',\r\n label: 'Degree of differencing(d)',\r\n type: 'integer',\r\n defaultValue: 0,\r\n show: (data) => {\r\n return [9].indexOf(data.props.analysisTypeId) >= 0 && data.props.autoARIMA === false;\r\n },\r\n },\r\n MAOrder: {\r\n ref: 'props.MAOrder',\r\n label: 'MA Order(q)',\r\n type: 'integer',\r\n defaultValue: 0,\r\n show: (data) => {\r\n return [9].indexOf(data.props.analysisTypeId) >= 0 && data.props.autoARIMA === false;\r\n },\r\n },\r\n SeasonalAROrder: {\r\n ref: 'props.SeasonalAROrder',\r\n label: 'Seasonal AR Order(P)',\r\n type: 'integer',\r\n defaultValue: 0,\r\n show: (data) => {\r\n return [9].indexOf(data.props.analysisTypeId) >= 0 && data.props.autoARIMA === false;\r\n },\r\n },\r\n SeasonalDegreeOfDifferencing: {\r\n ref: 'props.SeasonalDegreeOfDifferencing',\r\n label: 'Seasonal degree of differencing(D)',\r\n type: 'integer',\r\n defaultValue: 0,\r\n show: (data) => {\r\n return [9].indexOf(data.props.analysisTypeId) >= 0 && data.props.autoARIMA === false;\r\n },\r\n },\r\n SeasonalMAOrder: {\r\n ref: 'props.SeasonalMAOrder',\r\n label: 'Seasonal MA Order(Q)',\r\n type: 'integer',\r\n defaultValue: 0,\r\n show: (data) => {\r\n return [9].indexOf(data.props.analysisTypeId) >= 0 && data.props.autoARIMA === false;\r\n },\r\n },\r\n // HoltWinters\r\n displayHoltWintersParams: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Display Holt-Winters parameters',\r\n ref: 'props.displayHoltWintersParams',\r\n options: [{\r\n value: false,\r\n label: 'Off',\r\n }, {\r\n value: true,\r\n label: 'On',\r\n }],\r\n defaultValue: false,\r\n show: (data) => {\r\n return [30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n autoHoltWinters: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Parameter settings',\r\n ref: 'props.autoHoltWinters',\r\n options: [{\r\n value: true,\r\n label: 'Auto',\r\n }, {\r\n value: false,\r\n label: 'Custom',\r\n }],\r\n defaultValue: true,\r\n show: (data) => {\r\n return [30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n holtWintersAlpha: {\r\n ref: 'props.holtWintersAlpha',\r\n label: 'Alpha',\r\n type: 'integer',\r\n defaultValue: 1,\r\n show: (data) => {\r\n return [30].indexOf(data.props.analysisTypeId) >= 0 && data.props.autoHoltWinters === false;\r\n },\r\n },\r\n holtWintersBeta: {\r\n ref: 'props.holtWintersBeta',\r\n label: 'Beta',\r\n type: 'integer',\r\n defaultValue: 1,\r\n show: (data) => {\r\n return [30].indexOf(data.props.analysisTypeId) >= 0 && data.props.autoHoltWinters === false;\r\n },\r\n },\r\n holtWintersGamma: {\r\n ref: 'props.holtWintersGamma',\r\n label: 'Alpha',\r\n type: 'integer',\r\n defaultValue: 1,\r\n show: (data) => {\r\n return [30].indexOf(data.props.analysisTypeId) >= 0 && data.props.autoHoltWinters === false;\r\n },\r\n },\r\n // ARIMA and Holt-Winters\r\n seasonal: {\r\n type: 'string',\r\n component: 'dropdown',\r\n label: 'Seasonal',\r\n ref: 'props.seasonal',\r\n options: [{\r\n value: 'mult',\r\n label: 'Multiplicative',\r\n }, {\r\n value: 'additive',\r\n label: 'Additive',\r\n }],\r\n defaultValue: 'additive',\r\n show: (data) => {\r\n return [8, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n // Text mining / Wordcloud\r\n numOfFrequentTerms: {\r\n ref: 'props.numOfFrequentTerms',\r\n label: 'Show top N frequent terms',\r\n type: 'integer',\r\n defaultValue: 50,\r\n show: (data) => {\r\n return [13].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n tolower: {\r\n type: 'string',\r\n component: 'switch',\r\n label: 'Convert to lower case',\r\n ref: 'props.tolower',\r\n options: [{\r\n value: 'FALSE',\r\n label: 'Off',\r\n }, {\r\n value: 'TRUE',\r\n label: 'On',\r\n }],\r\n defaultValue: 'TRUE',\r\n show: (data) => {\r\n return [13].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n removeNumbers: {\r\n type: 'string',\r\n component: 'switch',\r\n label: 'Remove numbers',\r\n ref: 'props.removeNumbers',\r\n options: [{\r\n value: 'FALSE',\r\n label: 'Off',\r\n }, {\r\n value: 'TRUE',\r\n label: 'On',\r\n }],\r\n defaultValue: 'TRUE',\r\n show: (data) => {\r\n return [13].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n stopwords: {\r\n type: 'string',\r\n component: 'switch',\r\n label: 'Remove English common stepwords',\r\n ref: 'props.stopwords',\r\n options: [{\r\n value: 'FALSE',\r\n label: 'Off',\r\n }, {\r\n value: 'TRUE',\r\n label: 'On',\r\n }],\r\n defaultValue: 'TRUE',\r\n show: (data) => {\r\n return [13].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n removePunctuation: {\r\n type: 'string',\r\n component: 'switch',\r\n label: 'Remove punctuations',\r\n ref: 'props.removePunctuation',\r\n options: [{\r\n value: 'FALSE',\r\n label: 'Off',\r\n }, {\r\n value: 'TRUE',\r\n label: 'On',\r\n }],\r\n defaultValue: 'TRUE',\r\n show: (data) => {\r\n return [13].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n stemming: {\r\n type: 'string',\r\n component: 'switch',\r\n label: 'Text stemming',\r\n ref: 'props.stemming',\r\n options: [{\r\n value: 'FALSE',\r\n label: 'Off',\r\n }, {\r\n value: 'TRUE',\r\n label: 'On',\r\n }],\r\n defaultValue: 'TRUE',\r\n show: (data) => {\r\n return [13].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n // Decision tree\r\n rpartMethod: {\r\n type: 'string',\r\n component: 'dropdown',\r\n label: 'Method',\r\n ref: 'props.rpartMethod',\r\n options: [{\r\n value: 'class',\r\n label: 'Class',\r\n }, {\r\n value: 'anova',\r\n label: 'Anova',\r\n }],\r\n defaultValue: 'class',\r\n show: (data) => {\r\n return [25, 26].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n minSplit: {\r\n ref: 'props.minSplit',\r\n label: 'Minimum split',\r\n type: 'integer',\r\n defaultValue: 20,\r\n show: (data) => {\r\n return [25, 26].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n minBucket: {\r\n ref: 'props.minBucket',\r\n label: 'Minimum bucket',\r\n type: 'integer',\r\n defaultValue: 6,\r\n show: (data) => {\r\n return [25, 26].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n cp: {\r\n ref: 'props.cp',\r\n label: 'Complexity parameter(cp)',\r\n type: 'number',\r\n defaultValue: 0.01,\r\n show: (data) => {\r\n return [25, 26].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n maxDepth: {\r\n ref: 'props.maxDepth',\r\n label: 'Max depth',\r\n type: 'integer',\r\n defaultValue: 30,\r\n show: (data) => {\r\n return [25, 26].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n defaultCollapseLevel: {\r\n ref: 'props.defaultCollapseLevel',\r\n label: 'Default Collapse Level',\r\n type: 'integer',\r\n defaultValue: 3,\r\n show: (data) => {\r\n return [25].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n displayResultsOnAllNodes: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Display results on all nodes',\r\n ref: 'props.displayResultsOnAllNodes',\r\n options: [{\r\n value: true,\r\n label: 'On',\r\n }, {\r\n value: false,\r\n label: 'Off',\r\n }],\r\n defaultValue: false,\r\n show: (data) => {\r\n return [25].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n calcOddsRatio: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Calculate odds ratio',\r\n ref: 'props.calcOddsRatio',\r\n options: [{\r\n value: true,\r\n label: 'On',\r\n }, {\r\n value: false,\r\n label: 'Off',\r\n }],\r\n defaultValue: true,\r\n show: (data) => {\r\n return [29].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n splitDataset: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Split into training and test datasets',\r\n ref: 'props.splitDataset',\r\n options: [{\r\n value: true,\r\n label: 'On',\r\n }, {\r\n value: false,\r\n label: 'Off',\r\n }],\r\n defaultValue: false,\r\n show: (data) => {\r\n return [25, 27, 29].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n splitPercentage: {\r\n ref: 'props.splitPercentage',\r\n label: 'Treat first N% records as training dataset',\r\n type: 'number',\r\n min: 0.01,\r\n max: 0.99,\r\n defaultValue: 0.8,\r\n show: (data) => {\r\n return ([25, 27, 29].indexOf(data.props.analysisTypeId) >= 0 && data.props.splitDataset === true) || ([26, 28].indexOf(data.props.analysisTypeId) >= 0);\r\n },\r\n },\r\n // *****\r\n // Analysis Options\r\n // *****\r\n debugMode: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Debug mode',\r\n ref: 'props.debugMode',\r\n options: [{\r\n value: false,\r\n label: 'Off',\r\n }, {\r\n value: true,\r\n label: 'On',\r\n }],\r\n defaultValue: false,\r\n show: (data) => {\r\n return (enableDebugMode);\r\n },\r\n },\r\n debugModeLink: {\r\n label: 'What is debug mode?',\r\n component: 'link',\r\n url: 'https://github.com/mhamano/advanced-analytics-toolbox/blob/master/docs/debugmode.md',\r\n show: (data) => {\r\n return (enableDebugMode);\r\n },\r\n },\r\n },\r\n },\r\n settings: {\r\n uses: 'settings',\r\n items: {\r\n presentation: {\r\n type: 'items',\r\n label: 'Presentation',\r\n items: {\r\n line: {\r\n type: 'string',\r\n component: 'dropdown',\r\n ref: 'props.line',\r\n options: [{\r\n value: 'none',\r\n label: 'Line',\r\n }, {\r\n value: 'tozeroy',\r\n label: 'Area',\r\n }],\r\n defaultValue: 'none',\r\n show: (data) => {\r\n return [0, 6, 8, 9, 17, 20, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n datapoints: {\r\n type: 'boolean',\r\n label: 'Show data points',\r\n ref: 'props.datapoints',\r\n defaultValue: false,\r\n show: (data) => {\r\n return [0, 6, 8, 9, 17, 20, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n borderWidth: {\r\n type: 'number',\r\n component: 'slider',\r\n label: 'Border Width',\r\n ref: 'props.borderWidth',\r\n min: 0,\r\n max: 10,\r\n step: 1,\r\n defaultValue: 1,\r\n show: (data) => {\r\n return [0, 6, 8, 9, 15, 17, 20, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n pointRadius: {\r\n type: 'number',\r\n component: 'slider',\r\n label: 'Point Radius',\r\n ref: 'props.pointRadius',\r\n min: 1,\r\n max: 10,\r\n step: 1,\r\n defaultValue: 6,\r\n show: (data) => {\r\n return [0, 6, 8, 9, 15, 17, 20, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n bubbleSize: {\r\n type: 'number',\r\n component: 'slider',\r\n label: 'Bubble Size',\r\n ref: 'props.bubbleSize',\r\n min: 0,\r\n max: 50,\r\n step: 1,\r\n defaultValue: 12,\r\n show: (data) => {\r\n return [1, 10, 16, 19, 25].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n marginTop: {\r\n type: 'number',\r\n component: 'slider',\r\n label: 'Margin top',\r\n ref: 'props.marginTop',\r\n min: 0,\r\n max: 200,\r\n step: 1,\r\n defaultValue: 10,\r\n show: (data) => {\r\n return [0, 1, 6, 8, 9, 10, 14, 15, 16, 17, 19, 20, 23, 24, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n marginBottom: {\r\n type: 'number',\r\n component: 'slider',\r\n label: 'Margin bottom',\r\n ref: 'props.marginBottom',\r\n min: 0,\r\n max: 200,\r\n step: 1,\r\n defaultValue: 10,\r\n show: (data) => {\r\n return [0, 1, 6, 8, 9, 10, 14, 15, 16, 17, 19, 20, 23, 24, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n marginRight: {\r\n type: 'number',\r\n component: 'slider',\r\n label: 'Margin right',\r\n ref: 'props.marginRight',\r\n min: 0,\r\n max: 200,\r\n step: 1,\r\n defaultValue: 10,\r\n show: (data) => {\r\n return [0, 1, 6, 8, 9, 10, 14, 15, 16, 17, 19, 20, 23, 24, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n marginLeft: {\r\n type: 'number',\r\n component: 'slider',\r\n label: 'Margin left',\r\n ref: 'props.marginLeft',\r\n min: 0,\r\n max: 200,\r\n step: 1,\r\n defaultValue: 10,\r\n show: (data) => {\r\n return [0, 1, 6, 8, 9, 10, 14, 15, 16, 17, 19, 20, 23, 24, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n defineScreenSize: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Screen size',\r\n ref: 'props.defineScreenSize',\r\n options: [{\r\n value: true,\r\n label: 'Auto',\r\n }, {\r\n value: false,\r\n label: 'Custom',\r\n }],\r\n defaultValue: true,\r\n show: (data) => {\r\n return [25].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n screenWidth: {\r\n label: 'Width',\r\n ref: 'props.screenWidth',\r\n type: 'integer',\r\n defaultValue: 960,\r\n show: (data) => {\r\n return [25].indexOf(data.props.analysisTypeId) >= 0 && data.props.defineScreenSize === false;\r\n },\r\n },\r\n screenHeight: {\r\n label: 'Height',\r\n ref: 'props.screenHeight',\r\n type: 'integer',\r\n defaultValue: 500,\r\n show: (data) => {\r\n return [25].indexOf(data.props.analysisTypeId) >= 0 && data.props.defineScreenSize === false;\r\n },\r\n },\r\n },\r\n },\r\n colorsAndLegend: {\r\n type: 'items',\r\n label: 'Colors and legend',\r\n items: {\r\n colors: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Colors',\r\n ref: 'props.colors',\r\n options: [{\r\n value: true,\r\n label: 'Auto',\r\n }, {\r\n value: false,\r\n label: 'Custom',\r\n }],\r\n defaultValue: true,\r\n show: (data) => {\r\n return [0, 1, 6, 8, 9, 15, 17, 19, 20, 25, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n // colorBy: {\r\n // type: 'string',\r\n // component: 'dropdown',\r\n // ref: 'props.colorBy',\r\n // options: [{\r\n // value: 'single',\r\n // label: 'Single color',\r\n // }, {\r\n // value: 'dimension',\r\n // label: 'By dimension',\r\n // }],\r\n // defaultValue: 'single',\r\n // show: (data) => {\r\n // return [1].indexOf(data.props.analysisTypeId) >= 0 && data.props.colors === false;\r\n // },\r\n // },\r\n colorForMain: {\r\n label: 'Color',\r\n component: 'color-picker',\r\n ref: 'props.colorForMain',\r\n type: 'integer',\r\n defaultValue: 3,\r\n show: (data) => {\r\n return [0, 1, 6, 8, 9, 15, 17, 19, 20, 25, 29, 30].indexOf(data.props.analysisTypeId) >= 0 && data.props.colors === false;\r\n },\r\n },\r\n colorForSub: {\r\n label: 'Color (Trend/Forecast)',\r\n component: 'color-picker',\r\n ref: 'props.colorForSub',\r\n type: 'integer',\r\n defaultValue: 7,\r\n show: (data) => {\r\n return [0, 1, 9, 17, 19, 20, 30].indexOf(data.props.analysisTypeId) >= 0 && data.props.colors === false;\r\n },\r\n },\r\n showLegend: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Show legend',\r\n ref: 'props.showLegend',\r\n options: [{\r\n value: true,\r\n label: 'On',\r\n }, {\r\n value: false,\r\n label: 'Off',\r\n }],\r\n defaultValue: false,\r\n show: (data) => {\r\n return [0, 1, 9, 10, 15, 16, 17, 19, 20, 24, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n },\r\n },\r\n xAxis: {\r\n type: 'items',\r\n label: 'X-axis',\r\n items: {\r\n xLabelsAndTitle: {\r\n type: 'boolean',\r\n label: 'Show title',\r\n component: 'switch',\r\n ref: 'props.xLabelsAndTitle',\r\n options: [{\r\n value: true,\r\n label: 'On',\r\n }, {\r\n value: false,\r\n label: 'Off',\r\n }],\r\n defaultValue: false,\r\n show: (data) => {\r\n return [0, 1, 9, 10, 16, 17, 20, 24, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n xAxisPosition: {\r\n type: 'string',\r\n label: 'Position',\r\n component: 'dropdown',\r\n ref: 'props.xAxisPosition',\r\n options: [{\r\n value: 'bottom',\r\n label: 'Bottom',\r\n }, {\r\n value: 'top',\r\n label: 'Top',\r\n }],\r\n defaultValue: 'bottom',\r\n show: (data) => {\r\n return [0, 1, 9, 10, 15, 17, 20, 24, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n xScale: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Scale',\r\n ref: 'props.xScale',\r\n options: [{\r\n value: true,\r\n label: 'On',\r\n }, {\r\n value: false,\r\n label: 'Off',\r\n }],\r\n defaultValue: true,\r\n show: (data) => {\r\n return [0, 1, 6, 8, 9, 10, 15, 17, 19, 20, 24, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n xAxisType: {\r\n type: 'string',\r\n label: 'Axis Type',\r\n component: 'dropdown',\r\n ref: 'props.xAxisType',\r\n options: [{\r\n value: '-',\r\n label: 'Auto',\r\n }, {\r\n value: 'linear',\r\n label: 'Linear',\r\n }, {\r\n value: 'category',\r\n label: 'Category',\r\n }, {\r\n value: 'log',\r\n label: 'Log',\r\n }, {\r\n value: 'data',\r\n label: 'Date',\r\n }],\r\n defaultValue: '-',\r\n show: (data) => {\r\n return [0, 17].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n },\r\n },\r\n yAxis: {\r\n type: 'items',\r\n label: 'Y-axis',\r\n items: {\r\n yLabelsAndTitle: {\r\n type: 'boolean',\r\n label: 'Show title',\r\n component: 'switch',\r\n ref: 'props.yLabelsAndTitle',\r\n options: [{\r\n value: true,\r\n label: 'On',\r\n }, {\r\n value: false,\r\n label: 'Off',\r\n }],\r\n defaultValue: false,\r\n show: (data) => {\r\n return [0, 1, 9, 10, 16, 17, 20, 24, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n yAxisPosition: {\r\n type: 'string',\r\n label: 'Position',\r\n component: 'dropdown',\r\n ref: 'props.yAxisPosition',\r\n options: [{\r\n value: 'left',\r\n label: 'Left',\r\n }, {\r\n value: 'right',\r\n label: 'Right',\r\n }],\r\n defaultValue: 'left',\r\n show: (data) => {\r\n return [0, 1, 9, 10, 15, 17, 20, 24, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n yScale: {\r\n type: 'boolean',\r\n component: 'switch',\r\n label: 'Scale',\r\n ref: 'props.yScale',\r\n options: [{\r\n value: true,\r\n label: 'On',\r\n }, {\r\n value: false,\r\n label: 'Off',\r\n }],\r\n defaultValue: true,\r\n show: (data) => {\r\n return [0, 1, 6, 8, 9, 10, 15, 17, 19, 24, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n },\r\n },\r\n zAxis: {\r\n type: 'items',\r\n label: 'Z-axis',\r\n show: (data) => {\r\n return [16].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n items: {\r\n zLabelsAndTitle: {\r\n type: 'boolean',\r\n label: 'Show title',\r\n component: 'switch',\r\n ref: 'props.zLabelsAndTitle',\r\n options: [{\r\n value: true,\r\n label: 'On',\r\n }, {\r\n value: false,\r\n label: 'Off',\r\n }],\r\n defaultValue: false,\r\n show: (data) => {\r\n return [16].indexOf(data.props.analysisTypeId) >= 0;\r\n },\r\n },\r\n },\r\n },\r\n },\r\n },\r\n },\r\n };\r\n});\r\n"]} \ No newline at end of file +{"version":3,"sources":["properties.js"],"names":["define","analysis","qlik","$q","enableDebugMode","getNumberFormatSimple","app","currApp","undefined","defer","getAppLayout","layout","thousandSep","qLocaleInfo","qThousandSep","decimalSep","qDecimalSep","resolve","value","label","promise","type","component","items","dims","Dimensions","ref","itemTitleRef","allowAdd","allowRemove","addTranslation","expression","maxlength","meas","Measures","numberFormatting","options","defaultValue","formatting","show","data","numberFormattingSimple","then","customCurrency","prefixSuffix","numberFormatPattern","moneyFormatPattern","customFormatPattern","sorting","indexOf","props","analysisTypeId","sortDim","dimSort","dimSortByExpression","dimSortByExpressionAsc","dimSortByExpressionString","dimSortByNum","dimSortByNumAsc","dimSortByAlph","dimSortByAlphAsc","addons","uses","dataHandling","ReferenceLine","fixlimit","fixlimitlabel","fixlimitstyle","fixlimitwidth","fixlimitcolor","analysisCategoryDropDown","analysisCategories","map","d","id","name","analysisTypeDropDown","res","analysisTypes","filter","category","analysisCategoryId","displayTable","displayFormula","extendLine","extendDurations","interval","confidenceLevel","frequency","numberOfClusters","optimizationMethod","clusterMax","bootstrap","scaleData","dividedBy","differencing","seasonalDifferences","firstDifferences","lagMax","lagMaxValue","lag","lagValue","decomposeInFourCharts","forecastingPeriods","displayARIMAParams","autoARIMA","AROrder","DegreeOfDifferencing","MAOrder","SeasonalAROrder","SeasonalDegreeOfDifferencing","SeasonalMAOrder","displayHoltWintersParams","autoHoltWinters","holtWintersAlpha","holtWintersBeta","holtWintersGamma","seasonal","numOfFrequentTerms","tolower","removeNumbers","stopwords","removePunctuation","stemming","rpartMethod","minSplit","minBucket","cp","maxDepth","defaultCollapseLevel","displayResultsOnAllNodes","calcOddsRatio","splitDataset","splitPercentage","min","max","debugMode","debugModeLink","url","settings","presentation","line","datapoints","borderWidth","step","pointRadius","bubbleSize","marginTop","marginBottom","marginRight","marginLeft","defineScreenSize","screenWidth","screenHeight","colorsAndLegend","colors","colorForMain","colorForSub","showLegend","xAxis","xLabelsAndTitle","xAxisPosition","xScale","xAxisType","yAxis","yLabelsAndTitle","yAxisPosition","yScale","zAxis","zLabelsAndTitle"],"mappings":"AAAA,YAAAA,SAAQ,6BAA8B,OAAQ,SAAU,SAACC,EAAUC,EAAMC,GAEvE,GAAMC,IAAkB,EAElBC,EAAwB,WAC5B,GAAMC,GAAMJ,EAAKK,QAALC,QACNC,EAAQN,EAAGM,OAiCjB,OA/BAH,GAAII,aAAa,SAACC,GAChB,GAAMC,GAAcD,EAAOE,YAAYC,aACjCC,EAAaJ,EAAOE,YAAYG,WACtC,OAAOP,GAAMQ,UAGPC,MAAO,EACPC,MAAAA,IAAWP,EAAX,QAGAM,MAAO,EACPC,MAAAA,IAAWP,EAAX,MAA4BG,EAA5B,MAGAG,MAAO,EACPC,MAAAA,IAAWP,EAAX,MAA4BG,EAA5B,OAGAG,MAAO,EACPC,MAAO,QAGPD,MAAO,EACPC,MAAAA,KAAYJ,EAAZ,OAGAG,MAAO,EACPC,MAAAA,KAAYJ,EAAZ,WAIDN,EAAMW,QAGf,QACEC,KAAM,QACNC,UAAW,YACXC,OASEC,MACEL,MAAO,aACPI,OACEE,YACEJ,KAAM,QACNK,IAAK,mBACLP,MAAO,aACPQ,aAAc,QACdC,UAAU,EACVC,aAAa,EACbC,eAAgB,gBACh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IS,QAAQT,EAAKU,MAAMC,iBAAmB,MAK7DiH,OACE/I,KAAM,QACNF,MAAO,SACPI,OACE8I,iBACEhJ,KAAM,UACNF,MAAO,aACPG,UAAW,SACXI,IAAK,wBACLU,UACElB,OAAO,EACPC,MAAO,OAEPD,OAAO,EACPC,MAAO,QAETkB,cAAc,EACdE,KAAM,SAACC,GACL,OAAQ,EAAG,EAAG,EAAG,GAAI,GAAI,GAAI,GAAI,GAAI,IAAIS,QAAQT,EAAKU,MAAMC,iBAAmB,IAGnFmH,eACEjJ,KAAM,SACNF,MAAO,WACPG,UAAW,WACXI,IAAK,sBACLU,UACElB,MAAO,OACPC,MAAO,SAEPD,MAAO,QACPC,MAAO,UAETkB,aAAc,OACdE,KAAM,SAACC,GACL,OAAQ,EAAG,EAAG,EAAG,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,IAAIS,QAAQT,EAAKU,MAAMC,iBAAmB,IAGvFoH,QACElJ,KAAM,UACNC,UAAW,SACXH,MAAO,QACPO,IAAK,eACLU,UACElB,OAAO,EACPC,MAAO,OAEPD,OAAO,EACPC,MAAO,QAETkB,cAAc,EACdE,KAAM,SAACC,GACL,OAAQ,EAAG,EAAG,EAAG,EAAG,EAAG,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,IAAIS,QAAQT,EAAKU,MAAMC,iBAAmB,MAKjGqH,OACEnJ,KAAM,QACNF,MAAO,SACPoB,KAAM,SAACC,GACL,OAAQ,IAAIS,QAAQT,EAAKU,MAAMC,iBAAmB,GAEpD5B,OACEkJ,iBACEpJ,KAAM,UACNF,MAAO,aACPG,UAAW,SACXI,IAAK,wBACLU,UACElB,OAAO,EACPC,MAAO,OAEPD,OAAO,EACPC,MAAO,QAETkB,cAAc,EACdE,KAAM,SAACC,GACL,OAAQ,IAAIS,QAAQT,EAAKU,MAAMC,iBAAmB","file":"../../properties.js","sourcesContent":["define(['./lib/js/analysis/analysis', 'qlik', 'ng!$q'], (analysis, qlik, $q) => {\n // Control on debug mode\n const enableDebugMode = true;\n\n const getNumberFormatSimple = () => {\n const app = qlik.currApp(this);\n const defer = $q.defer();\n\n app.getAppLayout((layout) => {\n const thousandSep = layout.qLocaleInfo.qThousandSep;\n const decimalSep = layout.qLocaleInfo.qDecimalSep;\n return defer.resolve(\n [\n {\n value: 0,\n label: `1${thousandSep}000`,\n },\n {\n value: 1,\n label: `1${thousandSep}000${decimalSep}1`,\n },\n {\n value: 2,\n label: `1${thousandSep}000${decimalSep}12`,\n },\n {\n value: 3,\n label: '12%',\n },\n {\n value: 4,\n label: `12${decimalSep}3%`,\n },\n {\n value: 5,\n label: `12${decimalSep}34%`,\n },\n ]);\n });\n return defer.promise;\n };\n\n return {\n type: 'items',\n component: 'accordion',\n items: {\n // dimensions: {\n // uses: \"dimensions\",\n // show: false,\n // },\n // measures: {\n // uses: \"measures\",\n // show: false,\n // },\n dims: {\n label: 'Dimensions',\n items: {\n Dimensions: {\n type: 'array',\n ref: 'props.dimensions',\n label: 'Dimensions',\n itemTitleRef: 'label',\n allowAdd: true,\n allowRemove: true,\n addTranslation: 'Add dimension',\n items: {\n expression: {\n label: 'Field',\n type: 'string',\n ref: 'expression',\n expression: 'optional',\n },\n label: {\n label: 'Label',\n type: 'string',\n maxlength: 100,\n ref: 'label',\n },\n },\n },\n },\n },\n meas: {\n label: 'Measures',\n items: {\n Measures: {\n type: 'array',\n ref: 'props.measures',\n label: 'Measures',\n itemTitleRef: 'label',\n allowAdd: true,\n allowRemove: true,\n addTranslation: 'Add measure',\n items: {\n expression: {\n label: 'Expression',\n type: 'string',\n ref: 'expression',\n expression: 'optional',\n },\n label: {\n label: 'Label',\n type: 'string',\n maxlength: 100,\n ref: 'label',\n },\n numberFormatting: {\n type: 'string',\n component: 'dropdown',\n label: 'Number formatting',\n ref: 'numberFormatting',\n options: [\n {\n value: 0,\n label: 'Auto',\n },\n {\n value: 1,\n label: 'Number',\n },\n {\n value: 2,\n label: 'Money',\n },\n {\n value: 5,\n label: 'Custom',\n },\n ],\n defaultValue: 0,\n },\n formatting: {\n type: 'boolean',\n component: 'switch',\n label: 'Formatting',\n ref: 'formatting',\n options: [{\n value: true,\n label: 'Simple',\n }, {\n value: false,\n label: 'Custom',\n }],\n defaultValue: true,\n show: (data) => {\n return data.numberFormatting === 1;\n },\n },\n numberFormattingSimple: {\n type: 'string',\n component: 'dropdown',\n ref: 'numberFormattingSimple',\n options: getNumberFormatSimple().then((items) => {\n return items;\n }),\n defaultValue: 2,\n show: (data) => {\n return data.numberFormatting === 1 && (data.formatting === true || typeof data.formatting == 'undefined');\n },\n },\n customCurrency: {\n label: 'Currency',\n type: 'string',\n maxlength: 100,\n ref: 'customCurrency',\n defaultValue: '$',\n show: (data) => {\n return data.numberFormatting === 2;\n },\n },\n prefixSuffix: {\n type: 'string',\n component: 'dropdown',\n ref: 'prefixSuffix',\n options: [{\n value: 'prefix',\n label: 'Prefix',\n }, {\n value: 'suffix',\n label: 'Suffix',\n }],\n defaultValue: 'prefix',\n show: (data) => {\n return data.numberFormatting === 2;\n },\n },\n numberFormatPattern: {\n label: 'Format pattern',\n type: 'string',\n maxlength: 100,\n ref: 'numberFormatPattern',\n defaultValue: ',.2f',\n show: (data) => {\n return data.numberFormatting === 1 && data.formatting === false;\n },\n },\n moneyFormatPattern: {\n label: 'Format pattern',\n type: 'string',\n maxlength: 100,\n ref: 'moneyFormatPattern',\n defaultValue: ',.2f',\n show: (data) => {\n return data.numberFormatting === 2;\n },\n },\n customFormatPattern: {\n label: 'Format pattern',\n type: 'string',\n maxlength: 100,\n ref: 'customFormatPattern',\n defaultValue: ',.2f',\n show: (data) => {\n return data.numberFormatting === 5;\n },\n },\n },\n },\n },\n },\n sorting: {\n type: 'items',\n label: 'Sorting',\n show: (data) => {\n return [0, 17].indexOf(data.props.analysisTypeId) >= 0;\n },\n items: {\n sortDim: {\n type: 'items',\n label: 'Dimension',\n items: {\n dimSort: {\n type: 'boolean',\n component: 'switch',\n label: 'Sorting',\n ref: 'props.dimSort',\n options: [{\n value: true,\n label: 'Auto',\n }, {\n value: false,\n label: 'Custom',\n }],\n defaultValue: true,\n },\n dimSortByExpression: {\n type: 'boolean',\n label: 'Sort by expression',\n ref: 'props.dimSortByExpression',\n defaultValue: false,\n show: (data) => {\n return !data.props.dimSort;\n },\n },\n dimSortByExpressionAsc: {\n type: 'integer',\n component: 'dropdown',\n ref: 'props.dimSortByExpressionAsc',\n options: [{\n value: 1,\n label: 'Ascending',\n }, {\n value: -1,\n label: 'Descending',\n }],\n defaultValue: 1,\n show: (data) => {\n return !data.props.dimSort && data.props.dimSortByExpression;\n },\n },\n dimSortByExpressionString: {\n label: 'Expression',\n type: 'string',\n ref: 'props.dimSortByExpressionString',\n expression: 'optional',\n show: (data) => {\n return !data.props.dimSort && data.props.dimSortByExpression;\n },\n },\n dimSortByNum: {\n type: 'boolean',\n label: 'Sort numerically',\n ref: 'props.dimSortByNum',\n defaultValue: false,\n show: (data) => {\n return !data.props.dimSort;\n },\n },\n dimSortByNumAsc: {\n type: 'integer',\n component: 'dropdown',\n ref: 'props.dimSortByNumAsc',\n options: [{\n value: 1,\n label: 'Ascending',\n }, {\n value: -1,\n label: 'Descending',\n }],\n defaultValue: 1,\n show: (data) => {\n return !data.props.dimSort && data.props.dimSortByNum;\n },\n },\n dimSortByAlph: {\n type: 'boolean',\n label: 'Sort alphabetically',\n ref: 'props.dimSortByAlph',\n defaultValue: false,\n show: (data) => {\n return !data.props.dimSort;\n },\n },\n dimSortByAlphAsc: {\n type: 'integer',\n component: 'dropdown',\n ref: 'props.dimSortByAlphAsc',\n options: [{\n value: 1,\n label: 'Ascending',\n }, {\n value: -1,\n label: 'Descending',\n }],\n defaultValue: 1,\n show: (data) => {\n return !data.props.dimSort && data.props.dimSortByAlph;\n },\n },\n },\n },\n },\n },\n addons: {\n uses: 'addons',\n items: {\n dataHandling: {\n uses: 'dataHandling',\n },\n // Section for Reference Line\n ReferenceLine: {\n label: 'Reference Line',\n items: {\n fixlimit: {\n ref: 'props.limit',\n label: 'Limit',\n type: 'integer',\n defaultValue: \"\",\n show: (data) => {\n return [9].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n fixlimitlabel:{\n type:'string',\n label:'Label',\n ref:'props.limitlabel',\n defaultValue:'Reference Line',\n show:(data)=>{\n return[9].indexOf(data.props.analysisTypeId)>=0;\n },\n },\n //line style\n fixlimitstyle: {\n type: 'string',\n label: 'Line style',\n component: 'dropdown',\n ref: 'props.limitstyle',\n options: [{\n value: 'lines',\n label: 'lines',\n }, {\n value: 'dashdot',\n label: 'dashdot',\n }, {\n value: 'solid',\n label: 'solid',\n }, {\n value: 'dot',\n label: 'dot',\n }],\n defaultValue: 'lines',\n show: (data) => {\n return [9].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n //line width\n fixlimitwidth: {\n type: 'string',\n label: 'Line Width',\n component: 'dropdown',\n ref: 'props.limitwidth',\n options: [{\n value: '1',\n label: 'tiny',\n }, {\n value: '2',\n label: 'mid',\n }, {\n value: '4',\n label: 'huge',\n }],\n defaultValue: '1',\n show: (data) => {\n return [9].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n // line color\n fixlimitcolor: {\n label: 'Color',\n component: 'color-picker',\n ref: 'props.limitcolor',\n type: 'integer',\n defaultValue: 11,\n show: (data) => {\n return [9].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n },\n },\n //end of section for Reference line\n },\n },\n analysis: {\n label: 'Analysis Settings',\n items: {\n analysisCategoryDropDown: {\n type: 'integer',\n component: 'dropdown',\n label: 'Analysis Category',\n ref: 'props.analysisCategoryId',\n options: analysis.analysisCategories.map((d) => {\n return {\n value: d.id,\n label: d.name,\n };\n }),\n defaultValue: -1,\n },\n analysisTypeDropDown: {\n type: 'integer',\n component: 'dropdown',\n label: 'Analysis Type',\n ref: 'props.analysisTypeId',\n options: (data) => {\n const res = analysis.analysisTypes\n .filter((d) => {\n return d.category === data.props.analysisCategoryId;\n })\n .map((d) => {\n return {\n value: d.id,\n label: d.name,\n };\n });\n return res;\n },\n show: (data) => {\n return data.props.analysisCategoryId >= 0;\n },\n defaultValue: -1,\n },\n displayTable: {\n type: 'boolean',\n component: 'switch',\n label: 'Table display mode',\n ref: 'props.displayTable',\n options: [{\n value: false,\n label: 'Off',\n }, {\n value: true,\n label: 'On',\n }],\n defaultValue: false,\n show: (data) => {\n return [0, 9, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n // *****\n // Analysis Options\n // *****\n displayFormula: {\n type: 'boolean',\n component: 'switch',\n label: 'Display formula',\n ref: 'props.displayFormula',\n options: [{\n value: false,\n label: 'Off',\n }, {\n value: true,\n label: 'On',\n }],\n defaultValue: false,\n show: (data) => {\n return [0].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n extendLine: {\n type: 'boolean',\n component: 'switch',\n label: 'Extend line',\n ref: 'props.extendLine',\n options: [{\n value: false,\n label: 'Off',\n }, {\n value: true,\n label: 'On',\n }],\n defaultValue: false,\n show: (data) => {\n return [0].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n extendDurations: {\n ref: 'props.extendDurations',\n label: 'Extend durations',\n type: 'string',\n show: (data) => {\n return [0].indexOf(data.props.analysisTypeId) >= 0 && data.props.extendLine === true;\n },\n defaultValue: 12,\n },\n interval: {\n type: 'string',\n component: 'dropdown',\n label: 'Interval',\n ref: 'props.interval',\n options: [{\n value: 'confidence',\n label: 'confidence',\n }, {\n value: 'prediction',\n label: 'prediction',\n }],\n defaultValue: 'confidence',\n show: (data) => {\n return [0, 1, 17].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n confidenceLevel: {\n ref: 'props.confidenceLevel',\n label: 'Confidence level',\n type: 'string',\n show: (data) => {\n return [0, 1, 2, 3, 4, 5, 9, 17, 22, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n defaultValue: 0.95,\n },\n frequency: {\n ref: 'props.frequency',\n label: 'Frequency',\n type: 'integer',\n show: (data) => {\n return [8, 9, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n defaultValue: 12,\n },\n // k-means\n numberOfClusters: {\n ref: 'props.numberOfClusters',\n label: 'Number of clusters',\n type: 'integer',\n show: (data) => {\n return [10, 16, 24].indexOf(data.props.analysisTypeId) >= 0;\n },\n defaultValue: 3,\n },\n optimizationMethod: {\n ref: 'props.optimizationMethod',\n label: 'Optimization method',\n component: 'dropdown',\n type: 'string',\n options: [{\n value: 'gap',\n label: 'Gap Statistic',\n }],\n defaultValue: 'gap',\n show: (data) => {\n return [23].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n clusterMax: {\n ref: 'props.clusterMax',\n label: 'Max number of clusters',\n type: 'integer',\n show: (data) => {\n return [23].indexOf(data.props.analysisTypeId) >= 0;\n },\n defaultValue: 10,\n },\n bootstrap: {\n ref: 'props.bootstrap',\n label: 'Number of Monte Carlo samples',\n type: 'integer',\n show: (data) => {\n return [23].indexOf(data.props.analysisTypeId) >= 0;\n },\n defaultValue: 10,\n },\n scaleData: {\n type: 'boolean',\n component: 'switch',\n label: 'Scale data',\n ref: 'props.scaleData',\n options: [{\n value: false,\n label: 'Off',\n }, {\n value: true,\n label: 'On',\n }],\n defaultValue: false,\n show: (data) => {\n return [10, 16, 23, 24].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n dividedBy: {\n type: 'string',\n component: 'dropdown',\n label: 'Grouped by',\n ref: 'props.dividedBy',\n options: [{\n value: 'variables',\n label: 'Variables',\n },\n {\n value: 'clusters',\n label: 'Clusters',\n }],\n defaultValue: 'clusters',\n show: (data) => {\n return [24].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n // Time series analysis\n differencing: {\n ref: 'props.differencing',\n label: 'Differencing',\n component: 'dropdown',\n type: 'integer',\n options: [{\n value: 0,\n label: 'Off',\n }, {\n value: 1,\n label: 'Seasonal differences',\n }, {\n value: 2,\n label: 'First and seasonal differences',\n }],\n defaultValue: 0,\n show: (data) => {\n return [6, 7, 12].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n seasonalDifferences: {\n ref: 'props.seasonalDifferences',\n label: 'Seasonal differences',\n type: 'integer',\n defaultValue: 12,\n show: (data) => {\n return [6, 7, 12].indexOf(data.props.analysisTypeId) >= 0 && [1, 2].indexOf(data.props.differencing) >= 0;\n },\n },\n firstDifferences: {\n ref: 'props.firstDifferences',\n label: 'First differences',\n type: 'integer',\n defaultValue: 1,\n show: (data) => {\n return [6, 7, 9, 12].indexOf(data.props.analysisTypeId) >= 0 && data.props.differencing === 2;\n },\n },\n // Autocorrelation\n lagMax: {\n type: 'boolean',\n component: 'switch',\n label: 'Lag max',\n ref: 'props.lagMax',\n options: [{\n value: true,\n label: 'Auto',\n }, {\n value: false,\n label: 'Custom',\n }],\n defaultValue: true,\n show: (data) => {\n return [6].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n lagMaxValue: {\n ref: 'props.lagMaxValue',\n label: 'Lag max',\n type: 'integer',\n defaultValue: 20,\n show: (data) => {\n return [6].indexOf(data.props.analysisTypeId) >= 0 && data.props.lagMax === false;\n },\n },\n // Ljung-Box Test\n lag: {\n type: 'boolean',\n component: 'switch',\n label: 'Lag',\n ref: 'props.lag',\n options: [{\n value: true,\n label: 'Auto',\n }, {\n value: false,\n label: 'Custom',\n }],\n defaultValue: true,\n show: (data) => {\n return [7].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n lagValue: {\n ref: 'props.lagValue',\n label: 'Lag',\n type: 'integer',\n defaultValue: 1,\n show: (data) => {\n return [7].indexOf(data.props.analysisTypeId) >= 0 && data.props.lag === false;\n },\n },\n // Decompose time series\n decomposeInFourCharts: {\n type: 'boolean',\n component: 'switch',\n label: 'Display in 4 charts ',\n ref: 'props.decomposeInFourCharts',\n options: [{\n value: true,\n label: 'On',\n }, {\n value: false,\n label: 'Off',\n }],\n defaultValue: true,\n show: (data) => {\n return [8].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n // ARIMA forecast\n forecastingPeriods: {\n ref: 'props.forecastingPeriods',\n label: 'Forecasting periods',\n type: 'integer',\n show: (data) => {\n return [9, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n defaultValue: 12,\n },\n displayARIMAParams: {\n type: 'boolean',\n component: 'switch',\n label: 'Display ARIMA parameters',\n ref: 'props.displayARIMAParams',\n options: [{\n value: false,\n label: 'Off',\n }, {\n value: true,\n label: 'On',\n }],\n defaultValue: false,\n show: (data) => {\n return [9].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n autoARIMA: {\n type: 'boolean',\n component: 'switch',\n label: 'Parameter settings',\n ref: 'props.autoARIMA',\n options: [{\n value: true,\n label: 'Auto',\n }, {\n value: false,\n label: 'Custom',\n }],\n defaultValue: true,\n show: (data) => {\n return [9].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n AROrder: {\n ref: 'props.AROrder',\n label: 'AR Order(p)',\n type: 'integer',\n defaultValue: 0,\n show: (data) => {\n return [9].indexOf(data.props.analysisTypeId) >= 0 && data.props.autoARIMA === false;\n },\n },\n DegreeOfDifferencing: {\n ref: 'props.DegreeOfDifferencing',\n label: 'Degree of differencing(d)',\n type: 'integer',\n defaultValue: 0,\n show: (data) => {\n return [9].indexOf(data.props.analysisTypeId) >= 0 && data.props.autoARIMA === false;\n },\n },\n MAOrder: {\n ref: 'props.MAOrder',\n label: 'MA Order(q)',\n type: 'integer',\n defaultValue: 0,\n show: (data) => {\n return [9].indexOf(data.props.analysisTypeId) >= 0 && data.props.autoARIMA === false;\n },\n },\n SeasonalAROrder: {\n ref: 'props.SeasonalAROrder',\n label: 'Seasonal AR Order(P)',\n type: 'integer',\n defaultValue: 0,\n show: (data) => {\n return [9].indexOf(data.props.analysisTypeId) >= 0 && data.props.autoARIMA === false;\n },\n },\n SeasonalDegreeOfDifferencing: {\n ref: 'props.SeasonalDegreeOfDifferencing',\n label: 'Seasonal degree of differencing(D)',\n type: 'integer',\n defaultValue: 0,\n show: (data) => {\n return [9].indexOf(data.props.analysisTypeId) >= 0 && data.props.autoARIMA === false;\n },\n },\n SeasonalMAOrder: {\n ref: 'props.SeasonalMAOrder',\n label: 'Seasonal MA Order(Q)',\n type: 'integer',\n defaultValue: 0,\n show: (data) => {\n return [9].indexOf(data.props.analysisTypeId) >= 0 && data.props.autoARIMA === false;\n },\n },\n // HoltWinters\n displayHoltWintersParams: {\n type: 'boolean',\n component: 'switch',\n label: 'Display Holt-Winters parameters',\n ref: 'props.displayHoltWintersParams',\n options: [{\n value: false,\n label: 'Off',\n }, {\n value: true,\n label: 'On',\n }],\n defaultValue: false,\n show: (data) => {\n return [30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n autoHoltWinters: {\n type: 'boolean',\n component: 'switch',\n label: 'Parameter settings',\n ref: 'props.autoHoltWinters',\n options: [{\n value: true,\n label: 'Auto',\n }, {\n value: false,\n label: 'Custom',\n }],\n defaultValue: true,\n show: (data) => {\n return [30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n holtWintersAlpha: {\n ref: 'props.holtWintersAlpha',\n label: 'Alpha',\n type: 'integer',\n defaultValue: 1,\n show: (data) => {\n return [30].indexOf(data.props.analysisTypeId) >= 0 && data.props.autoHoltWinters === false;\n },\n },\n holtWintersBeta: {\n ref: 'props.holtWintersBeta',\n label: 'Beta',\n type: 'integer',\n defaultValue: 1,\n show: (data) => {\n return [30].indexOf(data.props.analysisTypeId) >= 0 && data.props.autoHoltWinters === false;\n },\n },\n holtWintersGamma: {\n ref: 'props.holtWintersGamma',\n label: 'Alpha',\n type: 'integer',\n defaultValue: 1,\n show: (data) => {\n return [30].indexOf(data.props.analysisTypeId) >= 0 && data.props.autoHoltWinters === false;\n },\n },\n // ARIMA and Holt-Winters\n seasonal: {\n type: 'string',\n component: 'dropdown',\n label: 'Seasonal',\n ref: 'props.seasonal',\n options: [{\n value: 'mult',\n label: 'Multiplicative',\n }, {\n value: 'additive',\n label: 'Additive',\n }],\n defaultValue: 'additive',\n show: (data) => {\n return [8, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n // Text mining / Wordcloud\n numOfFrequentTerms: {\n ref: 'props.numOfFrequentTerms',\n label: 'Show top N frequent terms',\n type: 'integer',\n defaultValue: 50,\n show: (data) => {\n return [13].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n tolower: {\n type: 'string',\n component: 'switch',\n label: 'Convert to lower case',\n ref: 'props.tolower',\n options: [{\n value: 'FALSE',\n label: 'Off',\n }, {\n value: 'TRUE',\n label: 'On',\n }],\n defaultValue: 'TRUE',\n show: (data) => {\n return [13].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n removeNumbers: {\n type: 'string',\n component: 'switch',\n label: 'Remove numbers',\n ref: 'props.removeNumbers',\n options: [{\n value: 'FALSE',\n label: 'Off',\n }, {\n value: 'TRUE',\n label: 'On',\n }],\n defaultValue: 'TRUE',\n show: (data) => {\n return [13].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n stopwords: {\n type: 'string',\n component: 'switch',\n label: 'Remove English common stepwords',\n ref: 'props.stopwords',\n options: [{\n value: 'FALSE',\n label: 'Off',\n }, {\n value: 'TRUE',\n label: 'On',\n }],\n defaultValue: 'TRUE',\n show: (data) => {\n return [13].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n removePunctuation: {\n type: 'string',\n component: 'switch',\n label: 'Remove punctuations',\n ref: 'props.removePunctuation',\n options: [{\n value: 'FALSE',\n label: 'Off',\n }, {\n value: 'TRUE',\n label: 'On',\n }],\n defaultValue: 'TRUE',\n show: (data) => {\n return [13].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n stemming: {\n type: 'string',\n component: 'switch',\n label: 'Text stemming',\n ref: 'props.stemming',\n options: [{\n value: 'FALSE',\n label: 'Off',\n }, {\n value: 'TRUE',\n label: 'On',\n }],\n defaultValue: 'TRUE',\n show: (data) => {\n return [13].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n // Decision tree\n rpartMethod: {\n type: 'string',\n component: 'dropdown',\n label: 'Method',\n ref: 'props.rpartMethod',\n options: [{\n value: 'class',\n label: 'Class',\n }, {\n value: 'anova',\n label: 'Anova',\n }],\n defaultValue: 'class',\n show: (data) => {\n return [25, 26].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n minSplit: {\n ref: 'props.minSplit',\n label: 'Minimum split',\n type: 'integer',\n defaultValue: 20,\n show: (data) => {\n return [25, 26].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n minBucket: {\n ref: 'props.minBucket',\n label: 'Minimum bucket',\n type: 'integer',\n defaultValue: 6,\n show: (data) => {\n return [25, 26].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n cp: {\n ref: 'props.cp',\n label: 'Complexity parameter(cp)',\n type: 'number',\n defaultValue: 0.01,\n show: (data) => {\n return [25, 26].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n maxDepth: {\n ref: 'props.maxDepth',\n label: 'Max depth',\n type: 'integer',\n defaultValue: 30,\n show: (data) => {\n return [25, 26].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n defaultCollapseLevel: {\n ref: 'props.defaultCollapseLevel',\n label: 'Default Collapse Level',\n type: 'integer',\n defaultValue: 3,\n show: (data) => {\n return [25].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n displayResultsOnAllNodes: {\n type: 'boolean',\n component: 'switch',\n label: 'Display results on all nodes',\n ref: 'props.displayResultsOnAllNodes',\n options: [{\n value: true,\n label: 'On',\n }, {\n value: false,\n label: 'Off',\n }],\n defaultValue: false,\n show: (data) => {\n return [25].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n calcOddsRatio: {\n type: 'boolean',\n component: 'switch',\n label: 'Calculate odds ratio',\n ref: 'props.calcOddsRatio',\n options: [{\n value: true,\n label: 'On',\n }, {\n value: false,\n label: 'Off',\n }],\n defaultValue: true,\n show: (data) => {\n return [29].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n splitDataset: {\n type: 'boolean',\n component: 'switch',\n label: 'Split into training and test datasets',\n ref: 'props.splitDataset',\n options: [{\n value: true,\n label: 'On',\n }, {\n value: false,\n label: 'Off',\n }],\n defaultValue: false,\n show: (data) => {\n return [25, 27, 29].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n splitPercentage: {\n ref: 'props.splitPercentage',\n label: 'Treat first N% records as training dataset',\n type: 'number',\n min: 0.01,\n max: 0.99,\n defaultValue: 0.8,\n show: (data) => {\n return ([25, 27, 29].indexOf(data.props.analysisTypeId) >= 0 && data.props.splitDataset === true) || ([26, 28].indexOf(data.props.analysisTypeId) >= 0);\n },\n },\n // *****\n // Analysis Options\n // *****\n debugMode: {\n type: 'boolean',\n component: 'switch',\n label: 'Debug mode',\n ref: 'props.debugMode',\n options: [{\n value: false,\n label: 'Off',\n }, {\n value: true,\n label: 'On',\n }],\n defaultValue: false,\n show: (data) => {\n return (enableDebugMode);\n },\n },\n debugModeLink: {\n label: 'What is debug mode?',\n component: 'link',\n url: 'https://github.com/mhamano/advanced-analytics-toolbox/blob/master/docs/debugmode.md',\n show: (data) => {\n return (enableDebugMode);\n },\n },\n },\n },\n settings: {\n uses: 'settings',\n items: {\n presentation: {\n type: 'items',\n label: 'Presentation',\n items: {\n line: {\n type: 'string',\n component: 'dropdown',\n ref: 'props.line',\n options: [{\n value: 'none',\n label: 'Line',\n }, {\n value: 'tozeroy',\n label: 'Area',\n }],\n defaultValue: 'none',\n show: (data) => {\n return [0, 6, 8, 9, 17, 20, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n datapoints: {\n type: 'boolean',\n label: 'Show data points',\n ref: 'props.datapoints',\n defaultValue: false,\n show: (data) => {\n return [0, 6, 8, 9, 17, 20, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n borderWidth: {\n type: 'number',\n component: 'slider',\n label: 'Border Width',\n ref: 'props.borderWidth',\n min: 0,\n max: 10,\n step: 1,\n defaultValue: 1,\n show: (data) => {\n return [0, 6, 8, 9, 15, 17, 20, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n pointRadius: {\n type: 'number',\n component: 'slider',\n label: 'Point Radius',\n ref: 'props.pointRadius',\n min: 1,\n max: 10,\n step: 1,\n defaultValue: 6,\n show: (data) => {\n return [0, 6, 8, 9, 15, 17, 20, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n bubbleSize: {\n type: 'number',\n component: 'slider',\n label: 'Bubble Size',\n ref: 'props.bubbleSize',\n min: 0,\n max: 50,\n step: 1,\n defaultValue: 12,\n show: (data) => {\n return [1, 10, 16, 19, 25].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n marginTop: {\n type: 'number',\n component: 'slider',\n label: 'Margin top',\n ref: 'props.marginTop',\n min: 0,\n max: 200,\n step: 1,\n defaultValue: 10,\n show: (data) => {\n return [0, 1, 6, 8, 9, 10, 14, 15, 16, 17, 19, 20, 23, 24, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n marginBottom: {\n type: 'number',\n component: 'slider',\n label: 'Margin bottom',\n ref: 'props.marginBottom',\n min: 0,\n max: 200,\n step: 1,\n defaultValue: 10,\n show: (data) => {\n return [0, 1, 6, 8, 9, 10, 14, 15, 16, 17, 19, 20, 23, 24, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n marginRight: {\n type: 'number',\n component: 'slider',\n label: 'Margin right',\n ref: 'props.marginRight',\n min: 0,\n max: 200,\n step: 1,\n defaultValue: 10,\n show: (data) => {\n return [0, 1, 6, 8, 9, 10, 14, 15, 16, 17, 19, 20, 23, 24, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n marginLeft: {\n type: 'number',\n component: 'slider',\n label: 'Margin left',\n ref: 'props.marginLeft',\n min: 0,\n max: 200,\n step: 1,\n defaultValue: 10,\n show: (data) => {\n return [0, 1, 6, 8, 9, 10, 14, 15, 16, 17, 19, 20, 23, 24, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n defineScreenSize: {\n type: 'boolean',\n component: 'switch',\n label: 'Screen size',\n ref: 'props.defineScreenSize',\n options: [{\n value: true,\n label: 'Auto',\n }, {\n value: false,\n label: 'Custom',\n }],\n defaultValue: true,\n show: (data) => {\n return [25].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n screenWidth: {\n label: 'Width',\n ref: 'props.screenWidth',\n type: 'integer',\n defaultValue: 960,\n show: (data) => {\n return [25].indexOf(data.props.analysisTypeId) >= 0 && data.props.defineScreenSize === false;\n },\n },\n screenHeight: {\n label: 'Height',\n ref: 'props.screenHeight',\n type: 'integer',\n defaultValue: 500,\n show: (data) => {\n return [25].indexOf(data.props.analysisTypeId) >= 0 && data.props.defineScreenSize === false;\n },\n },\n },\n },\n colorsAndLegend: {\n type: 'items',\n label: 'Colors and legend',\n items: {\n colors: {\n type: 'boolean',\n component: 'switch',\n label: 'Colors',\n ref: 'props.colors',\n options: [{\n value: true,\n label: 'Auto',\n }, {\n value: false,\n label: 'Custom',\n }],\n defaultValue: true,\n show: (data) => {\n return [0, 1, 6, 8, 9, 15, 17, 19, 20, 25, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n // colorBy: {\n // type: 'string',\n // component: 'dropdown',\n // ref: 'props.colorBy',\n // options: [{\n // value: 'single',\n // label: 'Single color',\n // }, {\n // value: 'dimension',\n // label: 'By dimension',\n // }],\n // defaultValue: 'single',\n // show: (data) => {\n // return [1].indexOf(data.props.analysisTypeId) >= 0 && data.props.colors === false;\n // },\n // },\n colorForMain: {\n label: 'Color',\n component: 'color-picker',\n ref: 'props.colorForMain',\n type: 'integer',\n defaultValue: 3,\n show: (data) => {\n return [0, 1, 6, 8, 9, 15, 17, 19, 20, 25, 29, 30].indexOf(data.props.analysisTypeId) >= 0 && data.props.colors === false;\n },\n },\n colorForSub: {\n label: 'Color (Trend/Forecast)',\n component: 'color-picker',\n ref: 'props.colorForSub',\n type: 'integer',\n defaultValue: 7,\n show: (data) => {\n return [0, 1, 9, 17, 19, 20, 30].indexOf(data.props.analysisTypeId) >= 0 && data.props.colors === false;\n },\n },\n showLegend: {\n type: 'boolean',\n component: 'switch',\n label: 'Show legend',\n ref: 'props.showLegend',\n options: [{\n value: true,\n label: 'On',\n }, {\n value: false,\n label: 'Off',\n }],\n defaultValue: false,\n show: (data) => {\n return [0, 1, 9, 10, 15, 16, 17, 19, 20, 24, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n },\n },\n xAxis: {\n type: 'items',\n label: 'X-axis',\n items: {\n xLabelsAndTitle: {\n type: 'boolean',\n label: 'Show title',\n component: 'switch',\n ref: 'props.xLabelsAndTitle',\n options: [{\n value: true,\n label: 'On',\n }, {\n value: false,\n label: 'Off',\n }],\n defaultValue: false,\n show: (data) => {\n return [0, 1, 9, 10, 16, 17, 20, 24, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n xAxisPosition: {\n type: 'string',\n label: 'Position',\n component: 'dropdown',\n ref: 'props.xAxisPosition',\n options: [{\n value: 'bottom',\n label: 'Bottom',\n }, {\n value: 'top',\n label: 'Top',\n }],\n defaultValue: 'bottom',\n show: (data) => {\n return [0, 1, 9, 10, 15, 17, 20, 24, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n xScale: {\n type: 'boolean',\n component: 'switch',\n label: 'Scale',\n ref: 'props.xScale',\n options: [{\n value: true,\n label: 'On',\n }, {\n value: false,\n label: 'Off',\n }],\n defaultValue: true,\n show: (data) => {\n return [0, 1, 6, 8, 9, 10, 15, 17, 19, 20, 24, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n xAxisType: {\n type: 'string',\n label: 'Axis Type',\n component: 'dropdown',\n ref: 'props.xAxisType',\n options: [{\n value: '-',\n label: 'Auto',\n }, {\n value: 'linear',\n label: 'Linear',\n }, {\n value: 'category',\n label: 'Category',\n }, {\n value: 'log',\n label: 'Log',\n }, {\n value: 'data',\n label: 'Date',\n }],\n defaultValue: '-',\n show: (data) => {\n return [0, 17].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n },\n },\n yAxis: {\n type: 'items',\n label: 'Y-axis',\n items: {\n yLabelsAndTitle: {\n type: 'boolean',\n label: 'Show title',\n component: 'switch',\n ref: 'props.yLabelsAndTitle',\n options: [{\n value: true,\n label: 'On',\n }, {\n value: false,\n label: 'Off',\n }],\n defaultValue: false,\n show: (data) => {\n return [0, 1, 9, 10, 16, 17, 20, 24, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n yAxisPosition: {\n type: 'string',\n label: 'Position',\n component: 'dropdown',\n ref: 'props.yAxisPosition',\n options: [{\n value: 'left',\n label: 'Left',\n }, {\n value: 'right',\n label: 'Right',\n }],\n defaultValue: 'left',\n show: (data) => {\n return [0, 1, 9, 10, 15, 17, 20, 24, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n yScale: {\n type: 'boolean',\n component: 'switch',\n label: 'Scale',\n ref: 'props.yScale',\n options: [{\n value: true,\n label: 'On',\n }, {\n value: false,\n label: 'Off',\n }],\n defaultValue: true,\n show: (data) => {\n return [0, 1, 6, 8, 9, 10, 15, 17, 19, 24, 29, 30].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n },\n },\n zAxis: {\n type: 'items',\n label: 'Z-axis',\n show: (data) => {\n return [16].indexOf(data.props.analysisTypeId) >= 0;\n },\n items: {\n zLabelsAndTitle: {\n type: 'boolean',\n label: 'Show title',\n component: 'switch',\n ref: 'props.zLabelsAndTitle',\n options: [{\n value: true,\n label: 'On',\n }, {\n value: false,\n label: 'Off',\n }],\n defaultValue: false,\n show: (data) => {\n return [16].indexOf(data.props.analysisTypeId) >= 0;\n },\n },\n },\n },\n },\n },\n },\n };\n});\n"]} \ No newline at end of file diff --git a/docs/analysis/analysis.md b/docs/analysis/analysis.md index 3d19992..e4959c9 100644 --- a/docs/analysis/analysis.md +++ b/docs/analysis/analysis.md @@ -4,11 +4,15 @@ * [Line chart with linear regression line](simple_linear_line.md) - Plots a simple linear regression line on a line chart. * [Scatter plot with linear regression line](simple_linear_bubble.md) - Plots a simple linear regression line on a scatter plot. + * Multiple linear regression Analysis * [Multiple regression analysis](regression_analysis.md) - Performs multiple regression analysis and fits linear models. * [Line chart with multiple regression line](regression_analysis_line_chart.md) - Plots a multiple linear regression line on a line chart. * [Plot regression coefficients](coefplot.md) - Plots the coefficients from a regression model. * [Correlation matrix heatmap](correlation_heatmap.md) - Displays correlation matrix heatmap. + * [Multiple regression model](regression_model.md) - Performs multiple regression analysis and fits linear models. + * [Multiple regression prediction](regression_predict.md) - Plots on a histogram a prediction of multiple linear regression model. + * [Multiple regression prediction table](regression_predict_table.md) - Plots on a table a prediction of multiple linear regression model. * Statistical hypothesis testing * [F-Test](f_test.md) - Performs an F-Test to compare the variances of two samples. diff --git a/docs/analysis/images/m_reg_pred.PNG b/docs/analysis/images/m_reg_pred.PNG new file mode 100644 index 0000000..193509a Binary files /dev/null and b/docs/analysis/images/m_reg_pred.PNG differ diff --git a/docs/analysis/images/m_reg_pred_t.PNG b/docs/analysis/images/m_reg_pred_t.PNG new file mode 100644 index 0000000..1bdcfd8 Binary files /dev/null and b/docs/analysis/images/m_reg_pred_t.PNG differ diff --git a/docs/analysis/regression_model.md b/docs/analysis/regression_model.md new file mode 100644 index 0000000..bd29b98 --- /dev/null +++ b/docs/analysis/regression_model.md @@ -0,0 +1,56 @@ +# Multiple regression analysis +Performs multiple regression analysis and fits linear models. + +## Screenshot + ![regression analysis example1](./images/regression_analysis_example1.png) + +## Prerequisite R packages + * jsonlite + * caret + +## Used R command + * [lm](https://www.rdocumentation.org/packages/stats/versions/3.4.0/topics/lm) + * [coef](https://www.rdocumentation.org/packages/stats/versions/3.4.1/topics/coef) + * [preProcess](https://www.rdocumentation.org/packages/caret/versions/6.0-78/topics/preProcess) + * [cor](https://www.rdocumentation.org/packages/stats/versions/3.4.3/topics/cor) + +## Caution + * Number formatting settings on measure properties are ignored. + * Use only training set (where Response variable have some value). + * Data are normalized (exclude the Response variable). + * Model is based on Predictor variables with a certain degree of correlation (>= |0.3|). + +## Usage + 1. Place [Advanced Analytics Toolbox] extension on a sheet and select [Multiple linear regression Analysis] > [Multiple regression model] for [Analysis Type] + 2. Select dimensions and measures + * Dimension: A field uniquely identifies each record (ex: ID, Code) + * Measure 1: Response variable + * Measure 2-: Predictor variables + +## Options + * Confidence level - Tolerance/confidence level. + +## Example1 - The Boston Housing Dataset +The Boston housing dataset contains medv (median house value) for 506 neighborhoods around Boston. In this example, we seek to predict medev using predictors such as rm (average number of rooms per house), age (average age of house) and crim (per capita crime rate by town). + + 1. Download the following sample file. + * Boston ( [Download file](./data/Boston.xlsx) | [Description on the dataset](http://www.cs.toronto.edu/~delve/data/boston/bostonDetail.html) ) + 2. Load the downloaded file into a new Qlik Sense app. + 3. Place [Advanced Analytics Toolbox] extension on a sheet and select [Multiple linear regression Analysis] > [Multiple regression model] for [Analysis Type]. + 4. Select [id] for a dimension. + 5. Select Sum([mdev]) for the first measure as a response(dependent) variable. This is the values we seek to predict. + 6. We are adding 13 predictor(independent) variables. Press [+] button to add measure button, and select the following fields for these measures: + * crim - per capita crime rate by town + * zn - proportion of residential land zoned for lots over 25,000 sq.ft. + * indus - proportion of non-retail business acres per town + * chas - Charles River dummy variable (= 1 if tract bounds) + * nox - nitric oxides concentration (parts per 10 million) + * rm - average number of rooms per dwelling + * age - proportion of owner-occupied units built prior to 1940 + * dis - weighted distances to five Boston employment centres + * rad - index of accessibility to radial highways + * tax - full-value property-tax rate per $10,000 + * ptratio - pupil-teacher ratio by town + * black - 1000(Bk - 0.63)^2 where Bk is the proportion of blacks by town + * lstat ^ percentage of lower status of the population + diff --git a/docs/analysis/regression_predict.md b/docs/analysis/regression_predict.md new file mode 100644 index 0000000..c41d0f5 --- /dev/null +++ b/docs/analysis/regression_predict.md @@ -0,0 +1,31 @@ +# Regression Analysis with prediction +Plots on a histogram a prediction of multiple linear regression model. + +## Screenshot + ![regression analysis prediction](./images/m_reg_pred.png) + +## Prerequisite R packages + * caret + +## Used R command + * [lm](https://www.rdocumentation.org/packages/stats/versions/3.4.0/topics/lm) + * [predict](https://www.rdocumentation.org/packages/stats/versions/3.4.0/topics/predict) + * [preProcess](https://www.rdocumentation.org/packages/caret/versions/6.0-78/topics/preProcess) + * [cor](https://www.rdocumentation.org/packages/stats/versions/3.4.3/topics/cor) + +## Caution + * Histogram show only the prediction values on a Test Set elements. + * Use only Training Set (where Response variable have some value) to fit the model. + * Data are normalized (exclude the Response variable). + * Model is based on Predictor variables with a certain degree of correlation (>= |0.3|). + +## Usage + 1. Place [Advanced Analytics Toolbox] extension on a sheet and select [Multiple linear regression analysis] > [Multiple regression prediction] for [Analysis Type] + 2. Select dimensions and measures + * Dimension: A field uniquely identifies each record (ex: ID, Code) + * Measure 1: Response variable + * Measure 2-: Predictor variables + +## Options + * Confidence level - Tolerance/confidence level. + diff --git a/docs/analysis/regression_predict_table.md b/docs/analysis/regression_predict_table.md new file mode 100644 index 0000000..fed4668 --- /dev/null +++ b/docs/analysis/regression_predict_table.md @@ -0,0 +1,31 @@ +# Regression Analysis with prediction (table) +Plots on a table a prediction of multiple linear regression model. + +## Screenshot + ![regression analysis prediction table](./images/m_reg_pred_t.png) + +## Prerequisite R packages + * caret + +## Used R command + * [lm](https://www.rdocumentation.org/packages/stats/versions/3.4.0/topics/lm) + * [predict](https://www.rdocumentation.org/packages/stats/versions/3.4.0/topics/predict) + * [preProcess](https://www.rdocumentation.org/packages/caret/versions/6.0-78/topics/preProcess) + * [cor](https://www.rdocumentation.org/packages/stats/versions/3.4.3/topics/cor) + +## Caution + * Table show only the prediction values on a Test Set elements. + * Use only Training Set (where Response variable have some value) to fit the model. + * Data are normalized (exclude the Response variable). + * Model is based on Predictor variables with a certain degree of correlation (>= |0.3|). + +## Usage + 1. Place [Advanced Analytics Toolbox] extension on a sheet and select [Multiple linear regression analysis] > [Multiple regression prediction table] for [Analysis Type] + 2. Select dimensions and measures + * Dimension: A field uniquely identifies each record (ex: ID, Code) + * Measure 1: Response variable + * Measure 2-: Predictor variables + +## Options + * Confidence level - Tolerance/confidence level. + diff --git a/package.json b/package.json index 10e1adc..f8218d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "advanced-analytics-toolbox", - "version": "1.4.0", + "version": "1.4.2", "description": "", "main": "advanced-analytics-toolbox.js", "scripts": { diff --git a/src/advanced-analytics-toolbox.qext b/src/advanced-analytics-toolbox.qext index fbd6246..8f66da7 100644 --- a/src/advanced-analytics-toolbox.qext +++ b/src/advanced-analytics-toolbox.qext @@ -4,7 +4,7 @@ "icon": "bar-chart-horizontal", "type": "visualization", "preview" : "./lib/images/icon.png", - "version": "1.4.1", + "version": "1.4.2", "author": "", "homepage": "", "keywords": "qlik-sense, visualization, advanced analytics, statistics", diff --git a/src/lib/js/analysis/analysis.js b/src/lib/js/analysis/analysis.js index dae31df..fc4b41c 100644 --- a/src/lib/js/analysis/analysis.js +++ b/src/lib/js/analysis/analysis.js @@ -437,6 +437,48 @@ define([], () => { minMeas: 1, sortId: 5, setCustomButtonLabel: false, + }, + { + id: 31, + category: 1, + name: 'Multiple regression prediction', + file: 'regression_predict', + minDims: 1, + minMeas: 2, + sortId: 2, + allowAddMea: true, + setCustomButtonLabel: true, + dimButtonLabel: ['Add dimension'], + meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'], + meaButtonLabelOthers: 'Add measure - Predictor variable', + }, + { + id: 32, + category: 1, + name: 'Multiple regression prediction table', + file: 'regression_predict_table', + minDims: 1, + minMeas: 2, + sortId: 2, + allowAddMea: true, + setCustomButtonLabel: true, + dimButtonLabel: ['Add dimension'], + meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'], + meaButtonLabelOthers: 'Add measure - Predictor variable', + }, + { + id: 33, + category: 1, + name: 'Multiple regression model', + file: 'regression_model', + minDims: 1, + minMeas: 2, + sortId: 1, + allowAddMea: true, + setCustomButtonLabel: true, + dimButtonLabel: ['Add dimension'], + meaButtonLabel: ['Add measure - Response variable', 'Add measure - Predictor variable'], + meaButtonLabelOthers: 'Add measure - Predictor variable', }, ].sort((a, b) => { return a.sortId - b.sortId; diff --git a/src/lib/js/analysis/regression_model.js b/src/lib/js/analysis/regression_model.js new file mode 100644 index 0000000..95443a0 --- /dev/null +++ b/src/lib/js/analysis/regression_model.js @@ -0,0 +1,222 @@ +define([ + '../util/utils', + 'ng!$q', +], (utils, $q) => { + return { + /** + * createCube - create HyperCubes + * + * @param {Object} app reference to app + * @param {Object} $scope angular $scope + * + * @return {Null} null + */ + createCube(app, $scope) { + const layout = $scope.layout; + + // Set definitions for dimensions and measures + const dimension = utils.validateDimension(layout.props.dimensions[0]); + const dimensions = [{ + qNullSuppression: true, + qDef: { + qFieldDefs: [dimension] + }, + }]; + + const meaLen = layout.props.measures.length; + $scope.rowsLabel = ['(Intercept)', (layout.props.measures[1].label != '') ? layout.props.measures[1].label : utils.validateMeasure(layout.props.measures[0]) ]; // Label for dimension values + let params = `${utils.validateMeasure(layout.props.measures[0])} as mea0, ${utils.validateMeasure(layout.props.measures[1])} as mea1`; + let meaList = 'q$mea0 ~ q$mea1'; + let dataType = 'NN'; + + for (let i = 2; i < meaLen; i++) { + const mea = utils.validateMeasure(layout.props.measures[i]); + if (mea.length > 0) { + const param = `,${mea} as mea${i}`; + params += param; + meaList += ` + q$mea${i}`; + dataType += 'N'; + + $scope.rowsLabel.push(utils.validateMeasure(layout.props.measures[i])); + } + } + // Normalize data - Find Correlation - Split condition - set training data for fit model using most correlated features. + const soglia = 0.3; + const split = `q$mea0 > 0.0`; + const norm = `library(caret);target <- q$mea0; preParams <- preProcess(q[,1:${meaLen}], method=c("range"));q <- predict(preParams, q[,1:${meaLen}]); q$mea0 <- target`; + const cor = `m = abs(cor(subset(q,q$mea0 != 0),q$mea0[q$mea0 != 0], method = "pearson"))`; + const fo = `f="";for(j in 2:${meaLen}) if(!is.na(m[j]) && m[j]>=${soglia}){l=paste("q$mea",j-1,sep=""); f=paste(f,l,sep=" + ")} ;f=paste("q$mea0 ~ ",substring(f,3));str(f)`; + + // Debug mode - set R dataset name to store the q data. + utils.displayDebugModeMessage(layout.props.debugMode); + const saveRDataset = utils.getDebugSaveDatasetScript(layout.props.debugMode, 'debug_regression_analysis.rda'); + + const defMea1 = `R.ScriptEvalExStr('${dataType}','${saveRDataset} library(jsonlite);${norm};${cor}; ${fo}; lm_result <- lm(as.formula(f), q, ${split});lm_summary <- summary(lm_result); + json <- toJSON(list(coef(lm_summary)[,"Estimate"], coef(lm_summary)[,"Std. Error"], coef(lm_summary)[,"t value"], coef(lm_summary)[,"Pr(>|t|)"], + as.double(summary(lm_result$residuals)), summary(lm_result)$sigma, summary(lm_result)$df, lm_summary$r.squared, lm_summary$adj.r.squared, + summary(lm_result)$fstatistic, extractAIC(lm_result)[2])); json;',${params})`; + + // Debug mode - display R Scripts to console + utils.displayRScriptsToConsole(layout.props.debugMode, [defMea1]); + + const measures = [ + { + qDef: { + qDef: defMea1, + }, + }, + { + qDef: { + qLabel: '-', + qDef: '', // Dummy + }, + }, + { + qDef: { + qLabel: '-', + qDef: '', // Dummy + }, + }, + { + qDef: { + qLabel: '-', + qDef: '', // Dummy + }, + }, + { + qDef: { + qLabel: '-', + qDef: '', // Dummy + }, + }, + ]; + + $scope.backendApi.applyPatches([ + { + qPath: '/qHyperCubeDef/qDimensions', + qOp: 'replace', + qValue: JSON.stringify(dimensions), + }, + { + qPath: '/qHyperCubeDef/qMeasures', + qOp: 'replace', + qValue: JSON.stringify(measures), + }, + ], false); + + $scope.patchApplied = true; + return null; + }, + /** + * drawChart - draw chart with updated data + * + * @param {Object} $scope angular $scope + * + * @return {Object} Promise object + */ + drawChart($scope) { + const defer = $q.defer(); + const layout = $scope.layout; + + const dimension = utils.validateDimension(layout.props.dimensions[0]); + const requestPage = [{ + qTop: 0, + qLeft: 0, + qWidth: 2, + qHeight: 1, + }]; + + $scope.backendApi.getData(requestPage).then((dataPages) => { + const measureInfo = $scope.layout.qHyperCube.qMeasureInfo; + + // Display error when all measures' grand total return NaN. + if (dataPages[0].qMatrix[0][1].qText.length === 0 || dataPages[0].qMatrix[0][1].qText == '-') { + utils.displayConnectionError($scope.extId); + } else { + // Debug mode - display returned dataset to console + utils.displayReturnedDatasetToConsole(layout.props.debugMode, dataPages[0]); + + const result = JSON.parse(dataPages[0].qMatrix[0][1].qText); + + const estimate = result[0]; + const stdError = result[1]; + const tValue = result[2]; + const pr = result[3]; + const minPr = Math.max.apply(null, pr); + + const residuals = result[4]; + + const sigma = result[5]; + const df = result[6]; + + const rSquared = result[7]; + const adjRSquared = result[8]; + + const fstatistic = result[9]; + const aic = result[10]; + + // Set table header + let html = ` +

Residuals:

+ + + + + + + + + + + +
Min1QMedian3QMax
${residuals[0]}${residuals[1]}${residuals[2]}${residuals[4]}${residuals[5]}
+ +

Coefficients:

+ + + + + + + + `; + + // Set regression analysis results to table + for (let i = 0; i < $scope.rowsLabel.length; i++) { + html += ` + + `; + } + + // Set table footer and other results + html += ` + +
EstimateStd.Errort valuePr(>|t|)Signif
${$scope.rowsLabel[i]}${estimate[i]}${stdError[i]}${tValue[i]}${pr[i]}${(pr[i] < 0.001) ? '' : (pr[i] < 0.01) ? '' : (pr[i] < 0.05) ? '' : (pr[i] < 0.1) ? '.' : ''}
+
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+ +

Others:

+ + + + + + + + + + + + + +
ItemValue
Residual standard error${sigma[0]} on ${df[1]} degrees of freedom
Multiple R-squared${rSquared[0]}
Adjusted R-squared${adjRSquared[0]}
F-statistic ${fstatistic[0]} on ${fstatistic[1]} and ${fstatistic[2]} DF, p-value: < ${minPr}
AIC${aic[0]}
+ `; + + // Set HTML element for chart + $(`.advanced-analytics-toolsets-${$scope.extId}`).html(html); + } + return defer.resolve(); + }); + return defer.promise; + }, + }; +}); diff --git a/src/lib/js/analysis/regression_predict.js b/src/lib/js/analysis/regression_predict.js new file mode 100644 index 0000000..b3e6d72 --- /dev/null +++ b/src/lib/js/analysis/regression_predict.js @@ -0,0 +1,190 @@ +define([ + '../chart/line_chart', + '../util/utils', + 'ng!$q', +], (lineChart, utils, $q) => { + return { + /** + * createCube - create HyperCubes + * + * @param {Object} app reference to app + * @param {Object} $scope angular $scope + * + * @return {Null} null + */ + createCube(app, $scope) { + const layout = $scope.layout; + const dimension = utils.validateDimension(layout.props.dimensions[0]); + const dimensions = [ + { + qNullSuppression: true, + qDef: { + qFieldDefs: [dimension], + qSortCriterias: [{ + qSortByExpression: layout.props.dimSort || !layout.props.dimSortByExpression ? 0 : layout.props.dimSortByExpressionAsc, + qSortByNumeric: (layout.props.dimSort) ? 1 : (!layout.props.dimSortByNum) ? 0 : layout.props.dimSortByNumAsc, + qSortByAscii: layout.props.dimSort || !layout.props.dimSortByAlph ? 0 : layout.props.dimSortByAlphAsc, + qExpression: { + qv: layout.props.dimSortByExpressionString, + }, + }], + }, + }, + ]; + + const meaLen = layout.props.measures.length; + $scope.rowsLabel = ['(Intercept)', utils.validateMeasure(layout.props.measures[1])]; // Label for dimension values + let params = `${utils.validateMeasure(layout.props.measures[0])} as mea0, ${utils.validateMeasure(layout.props.measures[1])} as mea1`; + let meaList = 'q$mea0 ~ q$mea1'; + + for (let i = 2; i < meaLen; i++) { + const mea = utils.validateMeasure(layout.props.measures[i]); + if (mea.length > 0) { + const param = `,${mea} as mea${i}`; + params += param; + meaList += ` + q$mea${i}`; + + $scope.rowsLabel.push(utils.validateMeasure(layout.props.measures[i])); + } + } + + // Normalize data - Find Correlation - Split condition - set training data for fit model and predict only NA values, using most correlated features. + const soglia = 0.3; + const norm = `library(caret);target <- q$mea0; preParams <- preProcess(q[,1:${meaLen}], method=c("range"));q <- predict(preParams, q[,1:${meaLen}]); q$mea0 <- target`; + const cor = `m = abs(cor(subset(q,q$mea0 != 0),q$mea0[q$mea0 != 0], method = "pearson"))`; + const fo = `f="";for(j in 2:${meaLen}) if(!is.na(m[j]) && m[j]>=${soglia}){l=paste("q$mea",j-1,sep=""); f=paste(f,l,sep=" + ")} ;f=paste("q$mea0 ~ ",substring(f,3));str(f)`; + const split = `q$mea0 > 0`; + const s = `q = subset(q,q$mea0 == 0); q$mea0[q$mea0 == 0] <- NA;`; + + // Debug mode - set R dataset name to store the q data. + utils.displayDebugModeMessage(layout.props.debugMode); + const saveRDataset = utils.getDebugSaveDatasetScript(layout.props.debugMode, 'debug_regression_analysis_line_chart.rda'); + + const defMea1 = `R.ScriptEval('${saveRDataset} ${norm}; if(sum(q$mea0)> 0 && min(q$mea0) == 0){${cor}; ${fo}; lm_result <- lm(as.formula(f), q, ${split});${s} predict(lm_result, q, interval="${layout.props.interval}", level=${layout.props.confidenceLevel});} else{lm_result <- lm(${meaList});predict(lm_result, interval="${layout.props.interval}", level=${layout.props.confidenceLevel}); }[,1]',${params})`; + const defMea2 = `R.ScriptEval('${norm}; if(sum(q$mea0)> 0 && min(q$mea0) == 0){${cor}; ${fo}; lm_result <- lm(as.formula(f), q, ${split});${s} predict(lm_result, q, interval="${layout.props.interval}", level=${layout.props.confidenceLevel});} else{lm_result <- lm(${meaList});predict(lm_result, interval="${layout.props.interval}", level=${layout.props.confidenceLevel}); }[,2]',${params})`; + const defMea3 = `R.ScriptEval('${norm}; if(sum(q$mea0)> 0 && min(q$mea0) == 0){${cor}; ${fo}; lm_result <- lm(as.formula(f), q, ${split});${s} predict(lm_result, q, interval="${layout.props.interval}", level=${layout.props.confidenceLevel});} else{lm_result <- lm(${meaList});predict(lm_result, interval="${layout.props.interval}", level=${layout.props.confidenceLevel}); }[,3]',${params})`; + + // Debug mode - display R Scripts to console + utils.displayRScriptsToConsole(layout.props.debugMode, [defMea1, defMea2, defMea3]); + + const measure = utils.validateMeasure(layout.props.measures[0]); + const measures = [ + { + qDef: { + qDef: measure, + }, + }, + { + qDef: { + qDef: defMea1, + }, + }, + { + qDef: { + qDef: defMea2, + }, + }, + { + qDef: { + qDef: defMea3, + }, + }, + { + qDef: { + qLabel: '-', + qDef: '', // Dummy + }, + }, + ]; + + $scope.backendApi.applyPatches([ + { + qPath: '/qHyperCubeDef/qDimensions', + qOp: 'replace', + qValue: JSON.stringify(dimensions), + }, + { + qPath: '/qHyperCubeDef/qMeasures', + qOp: 'replace', + qValue: JSON.stringify(measures), + }, + ], false); + + $scope.patchApplied = true; + return null; + }, + /** + * drawChart - draw chart with updated data + * + * @param {Object} $scope angular $scope + * + * @return {Object} Promise object + */ + drawChart($scope, app) { + const defer = $q.defer(); + const layout = $scope.layout; + + const requestPage = [{ + qTop: 0, + qLeft: 0, + qWidth: 6, + qHeight: 1500, + }]; + + $scope.backendApi.getData(requestPage).then((dataPages) => { + const measureInfo = $scope.layout.qHyperCube.qMeasureInfo; + + // Display error when all measures' grand total return NaN. + if (isNaN(measureInfo[1].qMin) && isNaN(measureInfo[1].qMax) + && isNaN(measureInfo[2].qMin) && isNaN(measureInfo[2].qMax) + && isNaN(measureInfo[3].qMin) && isNaN(measureInfo[3].qMax) + ) { + utils.displayConnectionError($scope.extId); + } else { + // Debug mode - display returned dataset to console + utils.displayReturnedDatasetToConsole(layout.props.debugMode, dataPages[0]); + + const palette = utils.getDefaultPaletteColor(); + const elemNum = []; + const dim1 = []; // Dimension + const mea1 = []; + const mea2 = []; + const mea3 = []; + const mea4 = []; + + + $.each(dataPages[0].qMatrix, (key, value) => { + elemNum.push(value[0].qElemNumber); + if(value[1].qNum == 0) + dim1.push(value[0].qText); + mea1.push(value[1].qNum); + mea2.push(value[2].qNum); + mea3.push(value[3].qNum); + mea4.push(value[4].qNum); + }); + + const chartData = [ + { + x: dim1, + y: mea2, + name: 'Fit', + mode: 'none', + type: 'bar', + line: { + color: `rgba(${palette[layout.props.colorForSub]},1)`, + }, + }, + ]; + + // Set HTML element for chart + $(`.advanced-analytics-toolsets-${$scope.extId}`).html(`
`); + + const chart = lineChart.draw($scope, chartData, `aat-chart-${$scope.extId}`, null); + lineChart.setEvents(chart, $scope, app); + } + return defer.resolve(); + }); + return defer.promise; + }, + }; +}); diff --git a/src/lib/js/analysis/regression_predict_table.js b/src/lib/js/analysis/regression_predict_table.js new file mode 100644 index 0000000..e561f83 --- /dev/null +++ b/src/lib/js/analysis/regression_predict_table.js @@ -0,0 +1,200 @@ +define([ + '../chart/line_chart', + '../util/utils', + 'ng!$q', +], (lineChart, utils, $q) => { + return { + /** + * createCube - create HyperCubes + * + * @param {Object} app reference to app + * @param {Object} $scope angular $scope + * + * @return {Null} null + */ + createCube(app, $scope) { + const layout = $scope.layout; + const dimension = utils.validateDimension(layout.props.dimensions[0]); + const dimensions = [ + { + qNullSuppression: true, + qDef: { + qFieldDefs: [dimension], + qSortCriterias: [{ + qSortByExpression: layout.props.dimSort || !layout.props.dimSortByExpression ? 0 : layout.props.dimSortByExpressionAsc, + qSortByNumeric: (layout.props.dimSort) ? 1 : (!layout.props.dimSortByNum) ? 0 : layout.props.dimSortByNumAsc, + qSortByAscii: layout.props.dimSort || !layout.props.dimSortByAlph ? 0 : layout.props.dimSortByAlphAsc, + qExpression: { + qv: layout.props.dimSortByExpressionString, + }, + }], + }, + }, + ]; + + const meaLen = layout.props.measures.length; + $scope.rowsLabel = ['(Intercept)', utils.validateMeasure(layout.props.measures[1])]; // Label for dimension values + let params = `${utils.validateMeasure(layout.props.measures[0])} as mea0, ${utils.validateMeasure(layout.props.measures[1])} as mea1`; + let meaList = 'q$mea0 ~ q$mea1'; + + for (let i = 2; i < meaLen; i++) { + const mea = utils.validateMeasure(layout.props.measures[i]); + if (mea.length > 0) { + const param = `,${mea} as mea${i}`; + params += param; + meaList += ` + q$mea${i}`; + + $scope.rowsLabel.push(utils.validateMeasure(layout.props.measures[i])); + } + } + + // Normalize data - Find Correlation - Split condition - set training data for fit model and predict only NA values, using most correlated features. + const soglia = 0.3; + const norm = `library(caret);target <- q$mea0; preParams <- preProcess(q[,1:${meaLen}], method=c("range"));q <- predict(preParams, q[,1:${meaLen}]); q$mea0 <- target`; + const cor = `m = abs(cor(subset(q,q$mea0 != 0),q$mea0[q$mea0 != 0], method = "pearson"))`; + const fo = `f="";for(j in 2:${meaLen}) if(!is.na(m[j]) && m[j]>=${soglia}){l=paste("q$mea",j-1,sep=""); f=paste(f,l,sep=" + ")} ;f=paste("q$mea0 ~ ",substring(f,3));str(f)`; + const split = `q$mea0 > 0`; + const s = `q = subset(q,q$mea0 == 0); q$mea0[q$mea0 == 0] <- NA;`; + + // Debug mode - set R dataset name to store the q data. + utils.displayDebugModeMessage(layout.props.debugMode); + const saveRDataset = utils.getDebugSaveDatasetScript(layout.props.debugMode, 'debug_regression_analysis_line_chart.rda'); + + const defMea1 = `R.ScriptEval('${saveRDataset} ${norm}; if(sum(q$mea0)> 0 && min(q$mea0) == 0){${cor}; ${fo}; lm_result <- lm(as.formula(f), q, ${split});${s} predict(lm_result, q, interval="${layout.props.interval}", level=${layout.props.confidenceLevel});} else{lm_result <- lm(${meaList});predict(lm_result, interval="${layout.props.interval}", level=${layout.props.confidenceLevel}); }[,1]',${params})`; + const defMea2 = `R.ScriptEval('${norm}; if(sum(q$mea0)> 0 && min(q$mea0) == 0){${cor}; ${fo}; lm_result <- lm(as.formula(f), q, ${split});${s} predict(lm_result, q, interval="${layout.props.interval}", level=${layout.props.confidenceLevel});} else{lm_result <- lm(${meaList});predict(lm_result, interval="${layout.props.interval}", level=${layout.props.confidenceLevel}); }[,2]',${params})`; + const defMea3 = `R.ScriptEval('${norm}; if(sum(q$mea0)> 0 && min(q$mea0) == 0){${cor}; ${fo}; lm_result <- lm(as.formula(f), q, ${split});${s} predict(lm_result, q, interval="${layout.props.interval}", level=${layout.props.confidenceLevel});} else{lm_result <- lm(${meaList});predict(lm_result, interval="${layout.props.interval}", level=${layout.props.confidenceLevel}); }[,3]',${params})`; + + // Debug mode - display R Scripts to console + utils.displayRScriptsToConsole(layout.props.debugMode, [defMea1, defMea2, defMea3]); + + const measure = utils.validateMeasure(layout.props.measures[0]); + const measures = [ + { + qDef: { + qDef: measure, + }, + }, + { + qDef: { + qDef: defMea1, + }, + }, + { + qDef: { + qDef: defMea2, + }, + }, + { + qDef: { + qDef: defMea3, + }, + }, + { + qDef: { + qLabel: '-', + qDef: '', // Dummy + }, + }, + ]; + + $scope.backendApi.applyPatches([ + { + qPath: '/qHyperCubeDef/qDimensions', + qOp: 'replace', + qValue: JSON.stringify(dimensions), + }, + { + qPath: '/qHyperCubeDef/qMeasures', + qOp: 'replace', + qValue: JSON.stringify(measures), + }, + ], false); + + $scope.patchApplied = true; + return null; + }, + /** + * drawChart - draw chart with updated data + * + * @param {Object} $scope angular $scope + * + * @return {Object} Promise object + */ + drawChart($scope, app) { + const defer = $q.defer(); + const layout = $scope.layout; + + const requestPage = [{ + qTop: 0, + qLeft: 0, + qWidth: 6, + qHeight: 1500, + }]; + + $scope.backendApi.getData(requestPage).then((dataPages) => { + const measureInfo = $scope.layout.qHyperCube.qMeasureInfo; + + // Display error when all measures' grand total return NaN. + if (isNaN(measureInfo[1].qMin) && isNaN(measureInfo[1].qMax) + && isNaN(measureInfo[2].qMin) && isNaN(measureInfo[2].qMax) + && isNaN(measureInfo[3].qMin) && isNaN(measureInfo[3].qMax) + ) { + utils.displayConnectionError($scope.extId); + } else { + // Debug mode - display returned dataset to console + utils.displayReturnedDatasetToConsole(layout.props.debugMode, dataPages[0]); + + const palette = utils.getDefaultPaletteColor(); + const elemNum = []; + const dim1 = []; // Dimension + const mea1 = []; + const mea2 = []; + const mea3 = []; + const mea4 = []; + + + $.each(dataPages[0].qMatrix, (key, value) => { + elemNum.push(value[0].qElemNumber); + if(value[1].qNum == 0) + dim1.push(value[0].qText); + mea1.push(value[1].qNum); + mea2.push(value[2].qNum); + mea3.push(value[3].qNum); + mea4.push(value[4].qNum); + }); + + + // Set table header + let html = ` +

Predicted:

+ + + + + + + + `; + + // Set regression analysis results to table + for (let i = 0; i < dim1.length; i++) { + html += ` + `; + } + + // Set table footer and other results + html += ` + +
CodeRemaining Life
${dim1[i]}${Math.ceil(mea2[i])}
+ `; + + // Set HTML element for chart + $(`.advanced-analytics-toolsets-${$scope.extId}`).html(html); + + } + return defer.resolve(); + }); + return defer.promise; + }, + }; +});