import pandas as pd
from sklearn import svm
### Read the CSV ###
df = pd.read_csv('C:/Users/anagha/Documents/Python Scripts/sampleData.csv')
df
from sklearn.cross_validation import train_test_split
train, test = train_test_split(df, train_size = 0.8)
train
test
x_column=['Userid','day_of_week','hour_of_day','minute_of_hour']
y_column = ['thermostat']
svc = svm.SVC()
model = svm.svc(kernel='linear', c=1, gamma=1)
I'm getting an error AttributeError: 'module' object has no attribute 'svc'. Tried many techniques, but none of them are working. I'm new to python, and would really appreciate the help
svc = svm.SVC(kernel='linear', C=1, gamma=1)
Note that capital C
.
See the docs.
You can try
from sklearn.svm import SVC
then
model = SVC(kernel='linear', c=1, gamma=1)
worked fine for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With