s434749
This commit is contained in:
parent
858c7511df
commit
2df663db76
22
run.py
22
run.py
@ -104,13 +104,21 @@ for month in range(12):
|
|||||||
|
|
||||||
z_prev = z.copy()
|
z_prev = z.copy()
|
||||||
|
|
||||||
for month in range(12):
|
METHOD = "mean"
|
||||||
model = model_per_month[month]
|
if METHOD == "linear_regression":
|
||||||
u = entries_of_fully_known_stations[:, known_years:, month].T
|
for month in range(12):
|
||||||
p = model.predict(u)
|
model = model_per_month[month]
|
||||||
p[p<0] = 0
|
u = entries_of_fully_known_stations[:, known_years:, month].T
|
||||||
assert np.all(z[missing_stations, known_years:, month] == -1)
|
p = model.predict(u)
|
||||||
z[missing_stations, known_years:, month] = p.T
|
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)
|
assert np.all(z != -1)
|
||||||
df = pd.read_csv('test-A/in.tsv', header=None, sep='\t')
|
df = pd.read_csv('test-A/in.tsv', header=None, sep='\t')
|
||||||
df.columns = in_columns
|
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