Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- from sklearn import preprocessing
- input_colours = ['red','white','green','black','yellow', 'blue']
- encoder = preprocessing.ColourEncoder()
- encoder.fit(input_colours)
- test_colours = ['red', 'yellow', 'white']
- encoded_colours = encoder.transform(test_colours)
- print("\nColours =", test_colours)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement