Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions day3/distribute_learning_models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1072,12 +1072,14 @@
"datasize=df.shape[0]\n",
"#split dataset using the index, as we have x,f, and y that we want to split.\n",
"itrain,itest = train_test_split(range(30),train_size=24, test_size=6)\n",
"xtrain= df.x[itrain].values\n",
"ftrain = df.f[itrain].values\n",
"ytrain = df.y[itrain].values\n",
"xtest= df.x[itest].values\n",
"ftest = df.f[itest].values\n",
"ytest = df.y[itest].values"
"xtrain= df.x[indexes[itrain]].values\n",
"ftrain = df.f[indexes[itrain]].values\n",
"ytrain = df.y[indexes[itrain]].values\n",
"xtest= df.x[indexes[itest]].values\n",
"ftest = df.f[indexes[itest]].values\n",
"ytest = df.y[indexes[itest]].values\n",
"# Dict creates different indexing so in order for the itrain and itest indices to be correct they have to pass through 'indexes'!!\n",
"# otherwise there's a lot of Nan values that should be there.",
],
"outputs": [],
"metadata": {
Expand Down Expand Up @@ -1508,4 +1510,4 @@
"metadata": {}
}
]
}
}