8000 getdata function doesn't function,only returns the first line · Issue #1 · lezzago/LambdaMart · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
getdata function doesn't function,only returns the first line #1
Open
@cuihuahuahua

Description

@cuihuahuahua

Dear,

I run the function on my computer. But the final file including training and test both contains only one record and the rest of the record in the file is the same as the first one.

def get_data(file_loc):
f = open(file_loc, 'r')
data = []
for line in f:
new_arr = []
arr = line.split(' #')[0].split()
score = arr[0]
q_id = arr[1].split(':')[1]
new_arr.append(int(score))
new_arr.append(int(q_id))
arr = arr[2:]
for el in arr:
new_arr.append(float(el.split(':')[1]))
data.append(new_arr)
f.close()
return np.array(data)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0