|
|
@ -484,7 +484,7 @@ def Transformation(quadrant1, quadrant2, quadrant3, quadrant4): |
|
|
|
global packCorrTransformed |
|
|
|
global packCorrTransformed |
|
|
|
packCorrTransformed = [] |
|
|
|
packCorrTransformed = [] |
|
|
|
|
|
|
|
|
|
|
|
for i in columns: |
|
|
|
for count, i in enumerate(columns): |
|
|
|
|
|
|
|
|
|
|
|
dicTransf = {} |
|
|
|
dicTransf = {} |
|
|
|
|
|
|
|
|
|
|
@ -495,7 +495,7 @@ def Transformation(quadrant1, quadrant2, quadrant3, quadrant4): |
|
|
|
quadrantVariable = str('quadrant%s' % number) |
|
|
|
quadrantVariable = str('quadrant%s' % number) |
|
|
|
illusion = locals()[quadrantVariable] |
|
|
|
illusion = locals()[quadrantVariable] |
|
|
|
d["DataRows{0}".format(number)] = XDataNumericCopy.iloc[illusion, :] |
|
|
|
d["DataRows{0}".format(number)] = XDataNumericCopy.iloc[illusion, :] |
|
|
|
dicTransf["round"] = NewComputationTransf(d['DataRows1'], d['DataRows2'], d['DataRows3'], d['DataRows4'], quadrant1, quadrant2, quadrant3, quadrant4) |
|
|
|
dicTransf["round"] = NewComputationTransf(d['DataRows1'], d['DataRows2'], d['DataRows3'], d['DataRows4'], quadrant1, quadrant2, quadrant3, quadrant4, i, count) |
|
|
|
|
|
|
|
|
|
|
|
d={} |
|
|
|
d={} |
|
|
|
XDataNumericCopy = XDataNumeric.copy() |
|
|
|
XDataNumericCopy = XDataNumeric.copy() |
|
|
@ -505,7 +505,7 @@ def Transformation(quadrant1, quadrant2, quadrant3, quadrant4): |
|
|
|
quadrantVariable = str('quadrant%s' % number) |
|
|
|
quadrantVariable = str('quadrant%s' % number) |
|
|
|
illusion = locals()[quadrantVariable] |
|
|
|
illusion = locals()[quadrantVariable] |
|
|
|
d["DataRows{0}".format(number)] = XDataNumericCopy.iloc[illusion, :] |
|
|
|
d["DataRows{0}".format(number)] = XDataNumericCopy.iloc[illusion, :] |
|
|
|
dicTransf["roundLogE"] = NewComputationTransf(d['DataRows1'], d['DataRows2'], d['DataRows3'], d['DataRows4'], quadrant1, quadrant2, quadrant3, quadrant4) |
|
|
|
dicTransf["roundLogE"] = NewComputationTransf(d['DataRows1'], d['DataRows2'], d['DataRows3'], d['DataRows4'], quadrant1, quadrant2, quadrant3, quadrant4, i, count) |
|
|
|
|
|
|
|
|
|
|
|
d={} |
|
|
|
d={} |
|
|
|
XDataNumericCopy = XDataNumeric.copy() |
|
|
|
XDataNumericCopy = XDataNumeric.copy() |
|
|
@ -515,7 +515,7 @@ def Transformation(quadrant1, quadrant2, quadrant3, quadrant4): |
|
|
|
quadrantVariable = str('quadrant%s' % number) |
|
|
|
quadrantVariable = str('quadrant%s' % number) |
|
|
|
illusion = locals()[quadrantVariable] |
|
|
|
illusion = locals()[quadrantVariable] |
|
|
|
d["DataRows{0}".format(number)] = XDataNumericCopy.iloc[illusion, :] |
|
|
|
d["DataRows{0}".format(number)] = XDataNumericCopy.iloc[illusion, :] |
|
|
|
dicTransf["roundLog2"] = NewComputationTransf(d['DataRows1'], d['DataRows2'], d['DataRows3'], d['DataRows4'], quadrant1, quadrant2, quadrant3, quadrant4) |
|
|
|
dicTransf["roundLog2"] = NewComputationTransf(d['DataRows1'], d['DataRows2'], d['DataRows3'], d['DataRows4'], quadrant1, quadrant2, quadrant3, quadrant4, i, count) |
|
|
|
|
|
|
|
|
|
|
|
d={} |
|
|
|
d={} |
|
|
|
XDataNumericCopy = XDataNumeric.copy() |
|
|
|
XDataNumericCopy = XDataNumeric.copy() |
|
|
@ -525,13 +525,13 @@ def Transformation(quadrant1, quadrant2, quadrant3, quadrant4): |
|
|
|
quadrantVariable = str('quadrant%s' % number) |
|
|
|
quadrantVariable = str('quadrant%s' % number) |
|
|
|
illusion = locals()[quadrantVariable] |
|
|
|
illusion = locals()[quadrantVariable] |
|
|
|
d["DataRows{0}".format(number)] = XDataNumericCopy.iloc[illusion, :] |
|
|
|
d["DataRows{0}".format(number)] = XDataNumericCopy.iloc[illusion, :] |
|
|
|
dicTransf["roundLog10"] = NewComputationTransf(d['DataRows1'], d['DataRows2'], d['DataRows3'], d['DataRows4'], quadrant1, quadrant2, quadrant3, quadrant4) |
|
|
|
dicTransf["roundLog10"] = NewComputationTransf(d['DataRows1'], d['DataRows2'], d['DataRows3'], d['DataRows4'], quadrant1, quadrant2, quadrant3, quadrant4, i, count) |
|
|
|
|
|
|
|
|
|
|
|
packCorrTransformed.append(dicTransf) |
|
|
|
packCorrTransformed.append(dicTransf) |
|
|
|
|
|
|
|
|
|
|
|
return 'Everything Okay' |
|
|
|
return 'Everything Okay' |
|
|
|
|
|
|
|
|
|
|
|
def NewComputationTransf(DataRows1, DataRows2, DataRows3, DataRows4, quadrant1, quadrant2, quadrant3, quadrant4): |
|
|
|
def NewComputationTransf(DataRows1, DataRows2, DataRows3, DataRows4, quadrant1, quadrant2, quadrant3, quadrant4, feature, count): |
|
|
|
|
|
|
|
|
|
|
|
# Main Features |
|
|
|
# Main Features |
|
|
|
corrMatrix1 = DataRows1.corr() |
|
|
|
corrMatrix1 = DataRows1.corr() |
|
|
@ -543,6 +543,11 @@ def NewComputationTransf(DataRows1, DataRows2, DataRows3, DataRows4, quadrant1, |
|
|
|
corrMatrix4 = DataRows4.corr() |
|
|
|
corrMatrix4 = DataRows4.corr() |
|
|
|
corrMatrix4 = corrMatrix4.abs() |
|
|
|
corrMatrix4 = corrMatrix4.abs() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
corrMatrix1 = corrMatrix1.loc[[feature]] |
|
|
|
|
|
|
|
corrMatrix2 = corrMatrix2.loc[[feature]] |
|
|
|
|
|
|
|
corrMatrix3 = corrMatrix3.loc[[feature]] |
|
|
|
|
|
|
|
corrMatrix4 = corrMatrix4.loc[[feature]] |
|
|
|
|
|
|
|
|
|
|
|
DataRows1 = DataRows1.reset_index(drop=True) |
|
|
|
DataRows1 = DataRows1.reset_index(drop=True) |
|
|
|
DataRows2 = DataRows2.reset_index(drop=True) |
|
|
|
DataRows2 = DataRows2.reset_index(drop=True) |
|
|
|
DataRows3 = DataRows3.reset_index(drop=True) |
|
|
|
DataRows3 = DataRows3.reset_index(drop=True) |
|
|
@ -576,9 +581,11 @@ def NewComputationTransf(DataRows1, DataRows2, DataRows3, DataRows4, quadrant1, |
|
|
|
VIF1 = pd.Series([variance_inflation_factor(X1.values, i) |
|
|
|
VIF1 = pd.Series([variance_inflation_factor(X1.values, i) |
|
|
|
for i in range(X1.shape[1])], |
|
|
|
for i in range(X1.shape[1])], |
|
|
|
index=X1.columns) |
|
|
|
index=X1.columns) |
|
|
|
|
|
|
|
VIF1 = VIF1.loc[[feature]] |
|
|
|
if (len(targetRows1Arr) > 2): |
|
|
|
if (len(targetRows1Arr) > 2): |
|
|
|
MI1 = mutual_info_classif(DataRows1, targetRows1Arr) |
|
|
|
MI1 = mutual_info_classif(DataRows1, targetRows1Arr) |
|
|
|
MI1List = MI1.tolist() |
|
|
|
MI1List = MI1.tolist() |
|
|
|
|
|
|
|
MI1List = MI1List[count] |
|
|
|
else: |
|
|
|
else: |
|
|
|
MI1List = [] |
|
|
|
MI1List = [] |
|
|
|
else: |
|
|
|
else: |
|
|
@ -599,9 +606,11 @@ def NewComputationTransf(DataRows1, DataRows2, DataRows3, DataRows4, quadrant1, |
|
|
|
VIF2 = pd.Series([variance_inflation_factor(X2.values, i) |
|
|
|
VIF2 = pd.Series([variance_inflation_factor(X2.values, i) |
|
|
|
for i in range(X2.shape[1])], |
|
|
|
for i in range(X2.shape[1])], |
|
|
|
index=X2.columns) |
|
|
|
index=X2.columns) |
|
|
|
|
|
|
|
VIF2 = VIF2.loc[[feature]] |
|
|
|
if (len(targetRows2Arr) > 2): |
|
|
|
if (len(targetRows2Arr) > 2): |
|
|
|
MI2 = mutual_info_classif(DataRows2, targetRows2Arr) |
|
|
|
MI2 = mutual_info_classif(DataRows2, targetRows2Arr) |
|
|
|
MI2List = MI2.tolist() |
|
|
|
MI2List = MI2.tolist() |
|
|
|
|
|
|
|
MI2List = MI2List[count] |
|
|
|
else: |
|
|
|
else: |
|
|
|
MI2List = [] |
|
|
|
MI2List = [] |
|
|
|
else: |
|
|
|
else: |
|
|
@ -622,9 +631,11 @@ def NewComputationTransf(DataRows1, DataRows2, DataRows3, DataRows4, quadrant1, |
|
|
|
VIF3 = pd.Series([variance_inflation_factor(X3.values, i) |
|
|
|
VIF3 = pd.Series([variance_inflation_factor(X3.values, i) |
|
|
|
for i in range(X3.shape[1])], |
|
|
|
for i in range(X3.shape[1])], |
|
|
|
index=X3.columns) |
|
|
|
index=X3.columns) |
|
|
|
|
|
|
|
VIF3 = VIF3.loc[[feature]] |
|
|
|
if (len(targetRows3Arr) > 2): |
|
|
|
if (len(targetRows3Arr) > 2): |
|
|
|
MI3 = mutual_info_classif(DataRows3, targetRows3Arr) |
|
|
|
MI3 = mutual_info_classif(DataRows3, targetRows3Arr) |
|
|
|
MI3List = MI3.tolist() |
|
|
|
MI3List = MI3.tolist() |
|
|
|
|
|
|
|
MI3List = MI3List[count] |
|
|
|
else: |
|
|
|
else: |
|
|
|
MI3List = [] |
|
|
|
MI3List = [] |
|
|
|
else: |
|
|
|
else: |
|
|
@ -645,9 +656,11 @@ def NewComputationTransf(DataRows1, DataRows2, DataRows3, DataRows4, quadrant1, |
|
|
|
VIF4 = pd.Series([variance_inflation_factor(X4.values, i) |
|
|
|
VIF4 = pd.Series([variance_inflation_factor(X4.values, i) |
|
|
|
for i in range(X4.shape[1])], |
|
|
|
for i in range(X4.shape[1])], |
|
|
|
index=X4.columns) |
|
|
|
index=X4.columns) |
|
|
|
|
|
|
|
VIF4 = VIF4.loc[[feature]] |
|
|
|
if (len(targetRows4Arr) > 2): |
|
|
|
if (len(targetRows4Arr) > 2): |
|
|
|
MI4 = mutual_info_classif(DataRows4, targetRows4Arr) |
|
|
|
MI4 = mutual_info_classif(DataRows4, targetRows4Arr) |
|
|
|
MI4List = MI4.tolist() |
|
|
|
MI4List = MI4.tolist() |
|
|
|
|
|
|
|
MI4List = MI4List[count] |
|
|
|
else: |
|
|
|
else: |
|
|
|
MI4List = [] |
|
|
|
MI4List = [] |
|
|
|
else: |
|
|
|
else: |
|
|
@ -655,6 +668,11 @@ def NewComputationTransf(DataRows1, DataRows2, DataRows3, DataRows4, quadrant1, |
|
|
|
VIF4 = pd.Series() |
|
|
|
VIF4 = pd.Series() |
|
|
|
MI4List = [] |
|
|
|
MI4List = [] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
corrMatrixComb1 = corrMatrixComb1.loc[[feature]] |
|
|
|
|
|
|
|
corrMatrixComb2 = corrMatrixComb2.loc[[feature]] |
|
|
|
|
|
|
|
corrMatrixComb3 = corrMatrixComb3.loc[[feature]] |
|
|
|
|
|
|
|
corrMatrixComb4 = corrMatrixComb4.loc[[feature]] |
|
|
|
|
|
|
|
|
|
|
|
targetRows1ArrDF = pd.DataFrame(targetRows1Arr) |
|
|
|
targetRows1ArrDF = pd.DataFrame(targetRows1Arr) |
|
|
|
targetRows2ArrDF = pd.DataFrame(targetRows2Arr) |
|
|
|
targetRows2ArrDF = pd.DataFrame(targetRows2Arr) |
|
|
|
targetRows3ArrDF = pd.DataFrame(targetRows3Arr) |
|
|
|
targetRows3ArrDF = pd.DataFrame(targetRows3Arr) |
|
|
@ -674,6 +692,15 @@ def NewComputationTransf(DataRows1, DataRows2, DataRows3, DataRows4, quadrant1, |
|
|
|
corrMatrixCombTotal4 = concatAllDF4.corr() |
|
|
|
corrMatrixCombTotal4 = concatAllDF4.corr() |
|
|
|
corrMatrixCombTotal4 = corrMatrixCombTotal4.abs() |
|
|
|
corrMatrixCombTotal4 = corrMatrixCombTotal4.abs() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
corrMatrixCombTotal1 = corrMatrixCombTotal1.loc[[feature]] |
|
|
|
|
|
|
|
corrMatrixCombTotal1 = corrMatrixCombTotal1.iloc[:,-1] |
|
|
|
|
|
|
|
corrMatrixCombTotal2 = corrMatrixCombTotal2.loc[[feature]] |
|
|
|
|
|
|
|
corrMatrixCombTotal2 = corrMatrixCombTotal2.iloc[:,-1] |
|
|
|
|
|
|
|
corrMatrixCombTotal3 = corrMatrixCombTotal3.loc[[feature]] |
|
|
|
|
|
|
|
corrMatrixCombTotal3 = corrMatrixCombTotal3.iloc[:,-1] |
|
|
|
|
|
|
|
corrMatrixCombTotal4 = corrMatrixCombTotal4.loc[[feature]] |
|
|
|
|
|
|
|
corrMatrixCombTotal4 = corrMatrixCombTotal4.iloc[:,-1] |
|
|
|
|
|
|
|
|
|
|
|
corrMatrixCombTotal1 = pd.concat([corrMatrixCombTotal1.tail(1)]) |
|
|
|
corrMatrixCombTotal1 = pd.concat([corrMatrixCombTotal1.tail(1)]) |
|
|
|
corrMatrixCombTotal2 = pd.concat([corrMatrixCombTotal2.tail(1)]) |
|
|
|
corrMatrixCombTotal2 = pd.concat([corrMatrixCombTotal2.tail(1)]) |
|
|
|
corrMatrixCombTotal3 = pd.concat([corrMatrixCombTotal3.tail(1)]) |
|
|
|
corrMatrixCombTotal3 = pd.concat([corrMatrixCombTotal3.tail(1)]) |
|
|
@ -696,11 +723,6 @@ def NewComputationTransf(DataRows1, DataRows2, DataRows3, DataRows4, quadrant1, |
|
|
|
packCorrLoc.append(corrMatrixCombTotal3.to_json()) |
|
|
|
packCorrLoc.append(corrMatrixCombTotal3.to_json()) |
|
|
|
packCorrLoc.append(corrMatrixCombTotal4.to_json()) |
|
|
|
packCorrLoc.append(corrMatrixCombTotal4.to_json()) |
|
|
|
|
|
|
|
|
|
|
|
packCorrLoc.append(json.dumps(uniqueTarget1)) |
|
|
|
|
|
|
|
packCorrLoc.append(json.dumps(uniqueTarget2)) |
|
|
|
|
|
|
|
packCorrLoc.append(json.dumps(uniqueTarget3)) |
|
|
|
|
|
|
|
packCorrLoc.append(json.dumps(uniqueTarget4)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
packCorrLoc.append(VIF1.to_json()) |
|
|
|
packCorrLoc.append(VIF1.to_json()) |
|
|
|
packCorrLoc.append(VIF2.to_json()) |
|
|
|
packCorrLoc.append(VIF2.to_json()) |
|
|
|
packCorrLoc.append(VIF3.to_json()) |
|
|
|
packCorrLoc.append(VIF3.to_json()) |
|
|
@ -711,6 +733,11 @@ def NewComputationTransf(DataRows1, DataRows2, DataRows3, DataRows4, quadrant1, |
|
|
|
packCorrLoc.append(json.dumps(MI3List)) |
|
|
|
packCorrLoc.append(json.dumps(MI3List)) |
|
|
|
packCorrLoc.append(json.dumps(MI4List)) |
|
|
|
packCorrLoc.append(json.dumps(MI4List)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
packCorrLoc.append(json.dumps(uniqueTarget1)) |
|
|
|
|
|
|
|
packCorrLoc.append(json.dumps(uniqueTarget2)) |
|
|
|
|
|
|
|
packCorrLoc.append(json.dumps(uniqueTarget3)) |
|
|
|
|
|
|
|
packCorrLoc.append(json.dumps(uniqueTarget4)) |
|
|
|
|
|
|
|
|
|
|
|
return packCorrLoc |
|
|
|
return packCorrLoc |
|
|
|
|
|
|
|
|
|
|
|
@cross_origin(origin='localhost',headers=['Content-Type','Authorization']) |
|
|
|
@cross_origin(origin='localhost',headers=['Content-Type','Authorization']) |
|
|
|