Created
October 7, 2019 21:28
-
-
Save bobbywlindsey/82059d3c11d9d33b2e0e48f2f9c66d8b to your computer and use it in GitHub Desktop.
Splitting features and label for the perceptron data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
train_data = pd.DataFrame(data = data, index=list(range(len(data))), columns=['X_1', 'X_2', 'label']) | |
# Don't forget to add a vector of 1s for the bias weight | |
train_data['bias'] = np.repeat(1.0, train_data.shape[0]) | |
train_label = train_data.label | |
train_data = train_data[[each for each in train_data.columns if each != 'label']] | |
train_data.head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment