application_vnd.jupyter.stderr_output_1.png
from scipy.interpolate import griddata

from sklearn.multioutput import MultiOutputRegressor

from sklearn.neighbors import KNeighborsRegressor

import numpy as np # linear algebra

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

traindf = pd.read_csv('../input/train.csv')
testdf = pd.read_csv('../input/test.csv')
totalRows = traindf[' y'].max()
totalCols = traindf['x'].max()
trainData = traindf.iloc[:, 2:]
trainlabels = traindf.iloc[:, 0:2]
testData = testdf.iloc[:, 2:]
testlabels = testdf.iloc[:, 0:2]
dimOfdata = trainData.shape[1]
numberOfSamples = len(trainlabels)

train_X = trainData.values
train_Y = trainlabels.values
test_X = testData.values
test_Y = testlabels.values

from scipy.interpolate import griddata
room_y = np.zeros(((totalRows + 1) * (totalCols + 1), 2))
k = 0
for i in range(totalCols + 1):
    for j in range(totalRows + 1):
        room_y[k, :] = [i, j]
        k += 1
room_x = griddata(train_Y, train_X, room_y, method='cubic')
room_x = np.nan_to_num(room_x)

k = 4
model = MultiOutputRegressor(KNeighborsRegressor(k))
model.fit(train_x, train_y)