Using Machine Learning to Predict high- performing Players in Fantasy Premier League
Roshan Thapaliya
561

ValueErrorTraceback (most recent call last)
<ipython-input-4-74fa5f47483c> in <module>()
64
65
---> 66 res = clf.predict(first_test)
67
68 if res[0] == 1:

C:\ProgramData\Anaconda2\lib\site-packages\sklearn\naive_bayes.pyc in predict(self, X)
64 Predicted target values for X
65 """
---> 66 jll = self._joint_log_likelihood(X)
67 return self.classes_[np.argmax(jll, axis=1)]
68

C:\ProgramData\Anaconda2\lib\site-packages\sklearn\naive_bayes.pyc in _joint_log_likelihood(self, X)
426 check_is_fitted(self, "classes_")
427
--> 428 X = check_array(X)
429 joint_log_likelihood = []
430 for i in range(np.size(self.classes_)):

C:\ProgramData\Anaconda2\lib\site-packages\sklearn\utils\validation.pyc in check_array(array, accept_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, warn_on_dtype, estimator)
408 "Reshape your data either using array.reshape(-1, 1) if "
409 "your data has a single feature or array.reshape(1, -1) "
--> 410 "if it contains a single sample.".format(array))
411 array = np.atleast_2d(array)
412 # To ensure that array flags are maintained

ValueError: Expected 2D array, got 1D array instead:
array=[0 0 0].
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.

Please help with these errors?

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.