Created
June 24, 2020 14:37
-
-
Save Mehdi-Amine/13014cccea168bb57055590bdade8468 to your computer and use it in GitHub Desktop.
method to return the false negatives and false positives to their normal scale for inspection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def inverse_scale_for(fp_cases, fn_cases): | |
# Converting to Numpy to be compatible with Sklearn | |
fp_cases = x_test[fp_indx].numpy() | |
fn_cases = x_test[fn_indx].numpy() | |
# Inverse transformation for the columns that were scaled: tea temp + internet speed | |
fp_cases_inv = std_scaler.inverse_transform(fp_cases[:,:2]) | |
fn_cases_inv = std_scaler.inverse_transform(fn_cases[:,:2]) | |
# Concatenating the now normally scaled columns with the book column | |
fp_cases_inv = np.concatenate((fp_cases_inv, fp_cases[:,-1:]), axis=1) | |
fn_cases_inv = np.concatenate((fn_cases_inv, fn_cases[:,-1:]), axis=1) | |
return fp_cases_inv, fn_cases_inv | |
fp_cases_inv, fn_cases_inv = inverse_scale_for(fp_cases, fn_cases) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment