![]() ![]() # print('Bin descriptions: %s' % str(discretizer._bin_descriptions))Īny help processing this would be greatly appreciated. # print('Interval cut-points: %s' % str(discretizer._cuts)) # print('Discretized dataset:\n%s' % str(X_train_discretized)) # print('Original dataset:\n%s' % str(X_train)) #Print a slice of original and discretized data # discretizer = MDLP_Discretizer(features=numeric_features) #Initialize discretizer object and fit to training data # X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33) # numeric_features = np.arange(X.shape) # all fetures in this dataset are numeric. # feature_names, class_names = dataset, dataset The code for this implementation is from sklearn import datasetsįrom sklearn.model_selection import train_test_split ValueError: could not convert string to float: 'A1' Items = įile "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\numpy\lib\npyio.py", line 1061, in įile "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\numpy\lib\npyio.py", line 768, in floatconv The program process the csv and loads the data.Īctual: Traceback (most recent call last):ĭataset = np.loadtxt(fname = 'A1-dm.csv', delimiter = ',')įile "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\numpy\lib\npyio.py", line 1134, in loadtxtįile "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\numpy\lib\npyio.py", line 1061, in read_data I am trying to replace datasets.load_iris() with a method to read the csv 'A1-md.csv'. ![]() The example that I am working with comes from the popular python tutorial with the iris data set. This file needs to be converted into a dataset. The default is whitespace.I have a program that needs to process a csv file. For backwards compatibility,īyte strings will be decoded as ‘latin1’. The character used to separate the values. The characters or list of characters used to indicate the start of aĬomment. comments str or sequence of str or None, optional In thisĬase, the number of columns used must match the number of fields in Structured data-type, the resulting array will be 1-dimensional, andĮach row will be interpreted as an element of the array. dtype data-type, optionalĭata-type of the resulting array default: float. In a list or produced by a generator are treated as lines. That generators must return bytes or strings. ![]() Parameters : fname file, str, pathlib.Path, list of str, generatorįile, filename, list, or generator to read. loadtxt ( fname, dtype=, comments='#', delimiter=None, converters=None, skiprows=0, usecols=None, unpack=False, ndmin=0, encoding='bytes', max_rows=None, *, quotechar=None, like=None ) # ![]() In this case, the number of columns used must match the number of fields in the data-type. If this is a structured data-type, the resulting array will be 1-dimensional, and each row will be interpreted as an element of the array.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |