Python ile Spyder içinde kod yazarken bazen şu hata alınabilir. “if it contains a single sample.”.format(array)) ValueError: Expected 2D array, got scalar array instead: array=7.800000190734863. Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample Şu şekilde olan predict kodumuzu y_head=lr.predict(x) şu […]
[Çözüldü]-ValueError: Expected 2D array, got scalar array instead: Hata-Çözümü
HATA b0=linear_reg.predict(0) Traceback (most recent call last): File “”, line 1, in b0=linear_reg.predict(0) File “C:\Users\E-A-S\Anaconda3\lib\site-packages\sklearn\linear_model\base.py”, line 213, in predict return self._decision_function(X) File “C:\Users\E-A-S\Anaconda3\lib\site-packages\sklearn\linear_model\base.py”, line 196, in _decision_function X = check_array(X, accept_sparse=[‘csr’, ‘csc’, ‘coo’]) File “C:\Users\E-A-S\Anaconda3\lib\site-packages\sklearn\utils\validation.py”, line 545, in check_array “if it contains a single sample.”.format(array)) ValueError: Expected 2D array, got scalar array instead: array=0. Reshape […]