EnMAP-Box / enmap-box

EnMAP-Box source code repository. See https://enmap-box.readthedocs.io for documentation
GNU General Public License v3.0
35 stars 16 forks source link

Create regression dataset (from text files) #313

Closed mbayad33 closed 1 year ago

mbayad33 commented 1 year ago

I wanted to create a regression dataset using csv files (for both x and y). It generated the following error. Could you please help edentif=y the source of this error? Traceback (most recent call last): File "C:\Users/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\site-packages\typeguard__init__.py", line 903, in wrapper retval = func(*args, **kwargs) File "C:\Users/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapboxprocessing\algorithm\prepareregressiondatasetfromfilesalgorithm.py", line 67, in processAlgorithm X = np.array(X, dtype=np.float32) ValueError: could not convert string to float: '0.036495,0.016645,-0.003204,-0.011743,-0.014978,-0.009181,-0.007560,-0.009011,-0.006907,-0.009963,-0.008065,-0.009912,-0.009052,-0.006105,-0.010938,-0.013128,-0.018103,-0.019599,-0.016563,-0.014642,-0.015299,-0.017531,-0.017233,-0.014134,-0.012968,-0.011649,-0.012161,-0.009814,-0.007738,-0.006189,-0.005994,-0.007256,-0.008421,-0.011324,-0.008412,-0.009465,-0.009323,-0.003649,-0.005287,-0.008166,-0.009567,-0.015435,-0.007933,-0.004316,-0.008725,-0.000612,-0.000739,0.000591,-0.001804,-0.008506,-0.006628,-0.007092,-0.009122,-0.004931,0.003030,-0.002707,-0.006966,-0.001935,0.016636,0.032042,0.015145,0.034132,0.036114,0.039835,0.015448,-0.035220,-0.035365,-0.034106,-0.017960,-0.009144,-0.006383,-0.004636,-0.005404,-0.006220,-0.005180,-0.003176,-0.000901,-0.000036,0.002848,0.017455,0.019219,0.019287,0.019539,-0.000220,-0.008939,-0.027030,-0.034505,-0.019091,-0.011180,-0.004386,-0.003489,-0.007580,-0.011686,-0.013379,-0.006658,0.005405,0.015263,0.016293,0.013948,0.005611,-0.006664,0.421532,1.102600,1.342835,0.976418,0.387452,-0.272346,-0.590055,-0.654828,-0.758787,-0.652242,-0.501599,-0.436781,-0.237074,-0.001926,-0.031139,-0.041858,-0.029965,-0.017015,-0.007983,-0.003629,-0.004258,-0.005257,-0.005016,-0.004248,-0.002799,-0.001234,-0.000665,-0.000475,-0.000388,-0.000249,-0.000820,0.000715,0.001466,0.002345,0.002471,0.001643,0.001521,0.004035,0.005256,0.005840,0.007471,0.006352,0.003509,0.216186,0.408909,0.511283,0.448705,0.185236,0.048649,0.085753,0.053426,0.030979,0.004505,-0.037386,0.031674,0.013079,-0.021448,0.004384,-0.034290,-0.095553,-0.373879,-0.532416,-0.464876,-0.323328,-0.072009,-0.035717,0.000834,0.023964,0.018560,-0.013760,-0.040495,-0.029039,-0.009880,0.005046,0.003867,0.000511,0.003598,0.000763,0.004629,0.002745,0.002655,0.000351,-0.001864,-0.001226,0.001590,0.002476,0.002535,0.000684,-0.001027,0.001828,0.002032,0.000998,0.001010,-0.001803,-0.001480,-0.000160,0.000583,0.001089,0.002590,0.005279,0.002463,0.002838,0.004703,0.006989,0.016373,0.023632,0.016185,0.003980,-0.004852,0.002929,0.048210,0.058890,0.070626,0.065990,0.047913,0.041501,0.005706,0.015285,0.044079,0.064539,0.036946,0.001001,-0.015150,0.046646,0.083068,0.053134,0.059464,0.100197,0.178703,0.427117,0.292021,0.089801,-0.112419'

Execution failed after 0.03 seconds

janzandr commented 1 year ago

Please check if your data is formatted correctly. Here is an example with the correct format: https://raw.githubusercontent.com/EnMAP-Box/enmap-box/main/tests/testdata/ml/classification_dataset_force_features.csv https://raw.githubusercontent.com/EnMAP-Box/enmap-box/main/tests/testdata/ml/classification_dataset_force_labels.csv

mbayad33 commented 1 year ago

Indeed, the correct format uses spaces to separate values (not commas). Thank you!