input_file.close()
    output_file.close()

    return output_file_path


if __name__ == "__main__":
    col_mapping = {
        'user_id': 1,
        'sequence_id': 12,
        'problem_id': 0,
        'correct': 19,
        'difficulty': 16,
        'prior_correct': 17,
        'prior_incorrect': 18
    }

    col_mapping_2 = {
        'user_id': 1,
        'sequence_id': 2,
        'problem_id': 3,
        'correct': 4
    }

    input_data = os.path.join(config.get('localfiles', 'data_path'),
                              'arrs_data.csv')
    output_data = os.path.join(config.get('localfiles', 'data_path'),
                               'arrs_data_pfa.csv')

    PFA_converter(input_data, output_data, col_mapping, 1)
Exemplo n.º 2
0
from assistments_workbench.config_reader import config
import sqlsoup

username = config.get('postgres', 'username')
password = config.get('postgres', 'password')
db_url = config.get('postgres', 'db_url')
port = config.get('postgres', 'port')


db_str = 'postgresql://%s:%s@%s:%s/assistment_production' % \
    (username, password, db_url, port)

db = sqlsoup.SQLSoup(db_str)
session = db.session
		if pfa_model == 1:
			correct_num_list[seq_pos] = prior_correct
			correct_num_list[seq_len + seq_pos] = prior_incorrect
		elif pfa_model == 2:
			correct_num_list = [prior_correct, prior_incorrect]

		output_data = [correct, seq, user, difficulty] + correct_num_list

		csv_writer.writerow(output_data)

		if correct == 1.0:
			this_user_seq['correct_num'] += 1
		else:
			this_user_seq['incorrect_num'] += 1
			correct = 0

	input_file.close()
	output_file.close()

	return output_file_path

if __name__ == "__main__":
	col_mapping = {'user_id': 1, 'sequence_id' : 12, 'problem_id' : 0, 'correct': 19, 'difficulty': 16, 'prior_correct': 17, 'prior_incorrect': 18}

	col_mapping_2 = {'user_id': 1, 'sequence_id' : 2, 'problem_id' : 3, 'correct': 4}

	input_data = os.path.join(config.get('localfiles', 'data_path'), 'arrs_data.csv')
	output_data = os.path.join(config.get('localfiles', 'data_path'), 'arrs_data_pfa.csv')

	PFA_converter(input_data, output_data, col_mapping, 1)