s434749
This commit is contained in:
parent
858c7511df
commit
2df663db76
8
run.py
8
run.py
@ -104,6 +104,8 @@ for month in range(12):
|
||||
|
||||
z_prev = z.copy()
|
||||
|
||||
METHOD = "mean"
|
||||
if METHOD == "linear_regression":
|
||||
for month in range(12):
|
||||
model = model_per_month[month]
|
||||
u = entries_of_fully_known_stations[:, known_years:, month].T
|
||||
@ -111,6 +113,12 @@ for month in range(12):
|
||||
p[p < 0] = 0
|
||||
assert np.all(z[missing_stations, known_years:, month] == -1)
|
||||
z[missing_stations, known_years:, month] = p.T
|
||||
elif METHOD == "mean":
|
||||
for year in range(known_years, total_years):
|
||||
for month in range(12):
|
||||
assert np.all(z[known_stations, year, month] != -1)
|
||||
assert np.all(z[missing_stations, year, month] == -1)
|
||||
z[missing_stations, year, month] = np.mean(z[known_stations, year, month])
|
||||
assert np.all(z != -1)
|
||||
df = pd.read_csv('test-A/in.tsv', header=None, sep='\t')
|
||||
df.columns = in_columns
|
||||
|
1412
test-A/out.tsv
1412
test-A/out.tsv
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user