def expand_and_standardize_dataset(response_index, response_header, data_set, col_vals, headers, standardizers, feats_to_ignore, columns_to_expand, outcome_trans_dict):
<EOL>modified_set = []<EOL>for row_index, row in enumerate(data_set):<EOL><INDENT>new_row = []<EOL>for col_index, val in enumerate(row):<EOL><INDENT>header = headers[col_index]<EOL>if col_index == response_index:<EOL><INDENT>new_outcome = outcome_trans_dict[val]<EOL>new_row.append(new_outcome)<EOL><DEDENT>elif header in feats_to_ignore:<EOL><INDENT>pass<EOL><DEDENT>elif header in columns_to_expand:<EOL><INDENT>for poss_val in col_vals[header]:<EOL><INDENT>if val == poss_val:<EOL><INDENT>new_cat_val = <NUM_LIT:1.0><EOL><DEDENT>else:<EOL><INDENT>new_cat_val = -<NUM_LIT:1.0><EOL><DEDENT>new_row.append(new_cat_val)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>new_cont_val = float((val - standardizers[header]['<STR_LIT>']) / standardizers[header]['<STR_LIT>'])<EOL>new_row.append(new_cont_val)<EOL><DEDENT><DEDENT>modified_set.append(new_row)<EOL><DEDENT>expanded_headers = []<EOL>for header in headers:<EOL><INDENT>if header in feats_to_ignore:<EOL><INDENT>pass<EOL><DEDENT>elif (header in columns_to_expand) and (header is not response_header):<EOL><INDENT>for poss_val in col_vals[header]:<EOL><INDENT>new_header = '<STR_LIT>'.format(header,poss_val)<EOL>expanded_headers.append(new_header)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>expanded_headers.append(header)<EOL><DEDENT><DEDENT>return modified_set, expanded_headers<EOL>
Standardizes continuous features and expands categorical features.