hello i am new to sklearn in python and iam trying to learn it and use this module to predict some numbers based on two features here is the error i am getting:
ValueError: only 2 non-keyword arguments accepted
and here is my code:
from sklearn.linear_model import LinearRegression import numpy as np trainingData = np.array([[861, 16012018], [860, 12012018], [859, 9012018], [858, 5012018], [857, 2012018], [856, 29122017], [855, 26122017], [854, 22122017], [853, 19122017]]) trainingScores = np.array([11,18,23,33,34,6],[10,19,21,33,34,1], [14,18,22,23,31,6],[16,22,29,31,33,10],[21,24,27,30,31,6],[1,14,15,20,27,7],[1,9,10,11,15,8],[2,9,27,31,35,1],[7,13,18,22,33,2]) clf = LinearRegression(fit_intercept=True) clf.fit(trainingScores,trainingData) predictionData = np.array([862, 19012018 ]) x=clf.predict(predictionData) print(x)
Related Posts:
- ValueError: Unknown label type: ‘continuous’
- XGBoost XGBClassifier Defaults in Python
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- ValueError: unsupported pickle protocol: 3, python2 pickle can not load the file dumped by python 3 pickle?
- ValueError: unsupported pickle protocol: 3, python2 pickle can not load the file dumped by python 3 pickle?
- Is there a library function for Root mean square error (RMSE) in python?
- sklearn: Found arrays with inconsistent numbers of samples when calling LinearRegression.fit()
- TypeError: fit() missing 1 required positional argument: ‘y’
- SyntaxError: unexpected EOF while parsing
- How to use filter, map, and reduce in Python 3
- converting time from UTC to CST
- Use Gif Logo For Loading Screen In Kivy
- Praw & Discord.py: The bot keep sending the same meme. I want the bot to send different meme whenever it is asked
- How can I make a time delay in Python? [duplicate]
- Python – TypeError: ‘int’ object is not iterable
- Understanding the main method of python [duplicate]
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- How to open a file using the open with statement
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)
- How to install pip with Python 3?
- What is the difference between rw+ and r+
- Convert bytes to a string
- How can I represent an ‘Enum’ in Python?
- Python – TypeError: ‘int’ object is not iterable
- Import Error: No module named numpy
- Python3 – ModuleNotFoundError: No module named ‘numpy’
- Relative imports – ModuleNotFoundError: No module named x
- Python: ‘ModuleNotFoundError’ when trying to import module from imported package
- Relative imports – ModuleNotFoundError: No module named x
- TypeError: a bytes-like object is required, not ‘str’ when writing to a file in Python3
- How to uninstall a package installed with pip install –user
- How do I upgrade the Python installation in Windows 10?
- not all arguments converted during string formatting.. NO % variables
- How do I use raw_input in Python 3
- Python Variable Declaration
- Relative imports in Python 3
- Relative imports in Python 3
- ImportError: No module named sklearn.cross_validation
- ImportError: No module named sklearn.cross_validation
- working of \n in python [duplicate]
- Pip freeze vs. pip list
- TypeError: list indices must be integers or slices, not list
- Best way to convert string to bytes in Python 3?
- Best way to convert string to bytes in Python 3?
- What does the list() function do in Python?
- TypeError: not all arguments converted during string formatting python
- No module named ‘sklearn.cross_validation’
- PermissionError: [Errno 13] Permission denied
- What is setup.py?
- How is Anaconda related to Python?
- PermissionError: [Errno 13] in Python
- FileNotFoundError: [WinError 2] The system cannot find the file specified:
- Invalid character in identifier
- LogisticRegression: Unknown label type: ‘continuous’ using sklearn in python
- Should I put #! (shebang) in Python scripts, and what form should it take?
- ValueError: operands could not be broadcast together with shapes (5,) (30,)
- Should I put #! (shebang) in Python scripts, and what form should it take?
- Using Python 3 in virtualenv
- Relative imports in Python 3
- How to correct TypeError: Unicode-objects must be encoded before hashing?
- How to remove EOFError: EOF when reading a line?
- WinError 2 The system cannot find the file specified (Python)
- Converting list to numpy array
- hashlib.md5() TypeError: Unicode-objects must be encoded before hashing
- TypeError: cannot unpack non-iterable NoneType object
- Is there a ‘foreach’ function in Python 3?
- Python inline if statement
- How to install python3 version of package via pip on Ubuntu?
- Updating a dictionary in python
- TypeError: cannot perform reduce with flexible type
- Could not find a version that satisfies the requirement tensorflow
- Convert bytes to a string
- ModuleNotFoundError: No module named ‘requests’. But ‘requests’ already installed
- How to normalize a NumPy array to a unit vector?
- How to copy a dictionary and only edit the copy
- How to print like printf in Python3?
- Could not find a version that satisfies the requirement tensorflow
- Local variable referenced before assignment?
- What are type hints in Python 3.5?
- What does ‘super().__init__()’ mean in python 3.x?
- ValueError: shape mismatch: objects cannot be broadcast to a single shape
- ModuleNotFoundError: No module named ‘sklearn’
- AttributeError: ‘module’ object has no attribute ‘urlopen’
- ImportError: No module named ‘keras’
- Python Error: AttributeError: __enter__ [duplicate]
- Updating Python on Mac
- Can’t fix “zipimport.ZipImportError: can’t decompress data; zlib not available” when I type in “python3.6 get-pip.py”
- TypeError: ‘float’ object not iterable
- Arrays used as indices must be of integer (or boolean) type
- How can I plot a confusion matrix? [duplicate]
- TypeError: slice indices must be integers or None or have an __index__ method
- TypeError: ‘type’ object is not subscriptable when indexing in to a dictionary
- ModuleNotFoundError: No module named ‘sklearn’
- ‘method’ object is not subscriptable. Don’t know what’s wrong
- Invalid character in identifier
- Importing class from another file [duplicate]
- filedialog, tkinter and opening files