varvectors=PCA.getEigenVectors(FeaturesSelectedPoints);// Run a local PCA!
varPCAResults=PCA.computeAdjustedData(FeaturesSelectedPoints,vectors[0]);// Get the results for individual dimension.
varPCASelVec=[];
varPCAResults=PCA.computeAdjustedData(FeaturesSelectedPoints,vectors[0]);// Get the results with the first most variation.
varPCASelVec=[];varPCASelVecAbs=[];
PCASelVec=PCAResults.selectedVectors[0];
PCASelVec.forEach(element=>{
element=Math.abs(element);
PCASelVecAbs.push(element);
});
varlen=PCASelVec.length;
varlen=PCASelVecAbs.length;
varindices=newArray(len);
for(vari=0;i<len;++i)indices[i]=i;
indices=indices.sort(function(a,b){returnPCASelVec[a]<PCASelVec[b]?-1:PCASelVec[a]>PCASelVec[b]?1:0;});// Get the most important features first! Clockwise ordering
if(len>8){
indices=indices.sort(function(a,b){returnPCASelVecAbs[a]>PCASelVecAbs[b]?-1:PCASelVecAbs[a]<PCASelVecAbs[b]?1:0;});// Get the most important features first!
if(len>8){// Get only the 8 best dimensions.
indices=indices.slice(0,8);
}
@ -2560,21 +2565,21 @@ if (points.length) { // If points exist (at least 1 point)
Object.assign(data,{[Object.keys(dataFeatures[selectedPoints[i].id])[m]]:"Positive"});// Push the values into the pcp
}else{
Object.assign(data,{[Object.keys(dataFeatures[selectedPoints[i].id])[j]]:"Negative"});// Push the values into the pcp
Object.assign(data,{[Object.keys(dataFeatures[selectedPoints[i].id])[m]]:"Negative"});// Push the values into the pcp
}
}else{
Object.assign(data,{[Object.keys(dataFeatures[selectedPoints[i].id])[j]]:(Object.values(dataFeatures[selectedPoints[i].id])[j])});// Push the values into the pcp
}
}else{
if(indices[m]==j){
Object.assign(data,{[Object.keys(dataFeatures[selectedPoints[i].id])[m]]:parseFloat(Object.values(dataFeatures[selectedPoints[i].id])[m]).toFixed(1)});// Push the values into the pcp
Object.assign(data,{[Object.keys(dataFeatures[selectedPoints[i].id])[indices[m]]]:parseFloat(Object.values(dataFeatures[selectedPoints[i].id])[indices[m]]).toFixed(1)});// Push the values into the pcp
}
}
}
@ -2582,7 +2587,6 @@ if (points.length) { // If points exist (at least 1 point)
Object.assign(data,{[Object.keys(dataFeatures[points[i].id])[m]]:"Positive"});// Push the values into the pcp
}else{
Object.assign(data,{[Object.keys(dataFeatures[points[i].id])[j]]:"Negative"});// Push the values into the pcp
Object.assign(data,{[Object.keys(dataFeatures[points[i].id])[m]]:"Negative"});// Push the values into the pcp
}
}else{
Object.assign(data,{[Object.keys(dataFeatures[points[i].id])[j]]:(Object.values(dataFeatures[points[i].id])[j])});// Push the values into the pcp
}
}else{
if(indices[m]==j){
Object.assign(data,{[Object.keys(dataFeatures[points[i].id])[m]]:parseFloat(Object.values(dataFeatures[points[i].id])[m]).toFixed(1)});// Push the values into the pcp
Object.assign(data,{[Object.keys(dataFeatures[points[i].id])[indices[m]]]:parseFloat(Object.values(dataFeatures[points[i].id])[indices[m]]).toFixed(1)});// Push the values into the pcp