python – ‘module’对象没有属性’svc’
发布时间:2020-12-20 12:33:42 所属栏目:Python 来源:网络整理
导读:import pandas as pdfrom sklearn import svm### Read the CSV ###df = pd.read_csv('C:/Users/anagha/Documents/Python Scripts/sampleData.csv')dffrom sklearn.cross_validation import train_test_splittrain,test = train_test_split(df,train_size = 0
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) 我收到错误AttributeError:’module’对象没有属性’svc’.尝试了很多技术,但没有一个是有效的.我是python的新手,非常感谢他们的帮助 解决方法svc = svm.SVC(kernel='linear',C=1,gamma=1) 注意资本C. 见docs. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |