Skip to content

Instantly share code, notes, and snippets.

@StephenFordham
Last active September 9, 2020 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StephenFordham/e7e8a1fe1a301c8f762f9427b353052f to your computer and use it in GitHub Desktop.
Save StephenFordham/e7e8a1fe1a301c8f762f9427b353052f to your computer and use it in GitHub Desktop.
creating_a_datapoint
features = pd.DataFrame(data=data[0], columns=['feature_' + str(i) for i in range(1, 6)])
lables = pd.DataFrame(data[1], columns=['labels'])
dataset = pd.concat([features, lables], axis=1)
data_point_1 = scaler.transform(np.array(dataset.iloc[0][:-1]).reshape(-1, 5))
knn.predict(data_point_1)[0]
# Output
# 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment