November 2017
Intermediate to advanced
304 pages
6h 58m
English
Now, we will extract the required features to train and test our data:
feature_columns = ['SNPS_log_return_positive', 'SNPS_log_return_negative'] for i in range(len(codes)): index = codes[i].split("/")[1] feature_columns.extend([ '{}_log_return_1'.format(index), '{}_log_return_2'.format(index), '{}_log_return_3'.format(index) ]) features_and_labels = pd.DataFrame(columns=feature_columns) closings['SNPS_log_return_positive'] = 0 closings.ix[closings['SNPS_log_return'] >= 0, 'SNPS_log_return_positive'] = 1 closings['SNPS_log_return_negative'] = 0 closings.ix[closings['SNPS_log_return'] < 0, 'SNPS_log_return_negative'] = 1 for i in range(7, len(closings)): feed_dict = {'SNPS_log_return_positive': closings['SNPS_log_return_positive'].ix[i], ...Read now
Unlock full access