![]() ![]() To get a matrix just use toarray() : print( enc.transform(X). Returns ] Encoding the elements of matrix X using the function OneHotEncoderĪnother solution to encode the elements of matrix X using the function OneHotEncoder enc = preprocessing.OneHotEncoder(categories='auto') enc.fit(X) print( enc.transform(X) ) To encode the elements of matrix X a solution is to use OrdinalEncoder: enc = preprocessing.OrdinalEncoder(categories='auto') enc.fit(X) print( enc.transform(X) ) ![]() Returns print(X.shape) (7, 1) Encoding the elements of matrix X using the function OrdinalEncoder ![]() That can be reshaped: X = X.reshape(-1,1) ![]() Let's consider the following input matrix X: from sklearn import preprocessing import numpy as np X = np.array(('A','C','B','A','C','D','A')) That is pretty self-explanatory, so I'll stop writing here and go on to step 1.Oh, wait, I. Encoding the elements of matrix X using the function OneHotEncoder Encrypt a Message Using Matrixes: Well, it seems that you can use matrices to encode a secret message.Regarding ' how is each value of that matrix generated', those are generated by the transducers (microphone) action. but the point is do we know the values (matrix values) which will produce that specific sound. Encoding the elements of matrix X using the function OrdinalEncoder Yes, it is definitely possible to produce the specific sound like guitar. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |