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’
- How to open a file using the open with statement
- How can I represent an ‘Enum’ in Python?
- Relative imports – ModuleNotFoundError: No module named x
- Relative imports – ModuleNotFoundError: No module named x
- How do I upgrade the Python installation in Windows 10?
- Python Variable Declaration
- Relative imports in Python 3
- ImportError: No module named sklearn.cross_validation
- Best way to convert string to bytes in Python 3?
- PermissionError: [Errno 13] Permission denied
- What is setup.py?
- LogisticRegression: Unknown label type: ‘continuous’ using sklearn in python
- Relative imports in Python 3
- How to remove EOFError: EOF when reading a line?
- TypeError: cannot unpack non-iterable NoneType object
- Is there a ‘foreach’ function in Python 3?
- Python inline if statement
- 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
- What are type hints in Python 3.5?
- TypeError: ‘type’ object is not subscriptable when indexing in to a dictionary
- Invalid character in identifier
- pip or pip3 to install packages for Python 3?
- ‘str’ object has no attribute ‘decode’. Python 3 error?
- How to find all the indexes of a recurring item in a list?
- Unable to initialize device PRN in Python
- How do you use subprocess.check_output() in Python?
- (Help) TypeError: ‘str’ object cannot be interpreted as an integer
- Why KeyError: 0
- How to normalize a NumPy array to a unit vector?
- Are dictionaries ordered in Python 3.6+?
- SSH using python script
- builtins.TypeError: must be str, not bytes
- TypeError: write() argument must be str, not bytes (Python 3 vs Python 2 )
- How can I get a list shape without using numpy?
- Why am I getting this syntax error: keyword can’t be an expression
- ctypes – Beginner
- How can I flush the output of the print function?
- TypeError: ‘encoding’ is an invalid keyword argument for this function
- What is the Python 3 equivalent of “python -m SimpleHTTPServer”
- What does -> mean in Python function definitions?
- ‘dict’ object has no attribute ‘has_key’
- How do you use subprocess.check_output() in Python?
- Dice rolling simulator in Python
- Arrays used as indices must be of integer (or boolean) type
- Alternative to scipy.misc.imresize()
- Get degree of each nodes in a graph by Networkx in python
- List attributes of an object [duplicate]
- “The path python3 (from –python=python3) does not exist” error
- How to troubleshoot an “AttributeError: __exit__” in multiproccesing in Python?
- TypeError; Must use key word argument or key function in python 3.x
- Type error Unhashable type:set
- How to install requests module in Python 3.4, instead of 2.7
- Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings
- Python map object is not subscriptable
- .pyw files in python program
- Replacing a character from a certain index
- ImportError: No module named ‘google’
- How do I remove/delete a virtualenv?
- Ruby equivalent for Python’s “try”?
- Cross Validation in Keras
- Get a random sample with replacement
- NameError: global name ‘unicode’ is not defined – in Python 3
- Conda command is not recognized on Windows 10
- TypeError: int() argument must be a string, a bytes-like object or a number, not ‘list’
- ImportError: No module named ‘django.core.urlresolvers’
- How to do a Sigma in python 3
- Python 3: Multiply a vector by a matrix without NumPy
- How to fix “Can’t find a default Python” error
- TypeError: ‘newline’ is an invalid keyword argument for this function
- Import py file in another directory in Jupyter notebook
- environment variables PYSPARK_PYTHON and PYSPARK_DRIVER_PYTHON
- Python: urllib.error.HTTPError: HTTP Error 404: Not Found
- ImportError: No module named model_selection
- “This constructor takes no arguments” error in __init__
- ValueError: cannot switch from manual field specification to automatic field numbering
- How to embed image or picture in jupyter notebook, either from a local machine or from a web resource?
- Python/Scikit-Learn – Can’t handle mix of multiclass and continuous
- How can I count time in Python 3?
- What is the correct format to write float value to file in Python
- Using strip() to clean up a string
- “E: Unable to locate package python3-pip”
- How to draw a line with matplotlib?
- Accessing dict_keys element by index in Python3
- Why can’t I print to terminal with my python script?
- How to install Anaconda on RaspBerry Pi 3 Model B
- Pip install on Mac OS gets error: command ‘/usr/bin/clang’ failed with exit code 1
- KeyError: ‘plotly_domain’
- TypeError: ‘zip’ object is not subscriptable