|
@@ -63,10 +63,10 @@ class DataExplorer:
|
|
def calculate_big_matrix_correlation(self, data: pd.DataFrame, column_name_to_predict: str, method: str='pearson') -> pd.DataFrame():
|
|
def calculate_big_matrix_correlation(self, data: pd.DataFrame, column_name_to_predict: str, method: str='pearson') -> pd.DataFrame():
|
|
|
|
|
|
num_columns = ['int16', 'int32', 'int64', 'float16', 'float32', 'float64', 'bool']
|
|
num_columns = ['int16', 'int32', 'int64', 'float16', 'float32', 'float64', 'bool']
|
|
- numeric_data = data.select_dtypes(num_columns)
|
|
|
|
result_data = {}
|
|
result_data = {}
|
|
- for column in numeric_data.columns:
|
|
|
|
- result_data[column] = numeric_data[column_name_to_predict].corr(numeric_data[column], method=method)
|
|
|
|
|
|
+ for column in data.columns:
|
|
|
|
+ if data[column].dtype in num_columns:
|
|
|
|
+ result_data[column] = data[column_name_to_predict].corr(data[column], method=method)
|
|
|
|
|
|
result_df = pd.DataFrame.from_dict(result_data, orient='index')
|
|
result_df = pd.DataFrame.from_dict(result_data, orient='index')
|
|
label_string = method + ' correlation'
|
|
label_string = method + ' correlation'
|