'module' object has no attribute 'svc'

前端 未结 6 427
野性不改
野性不改 2021-01-19 02:14
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.cros         


        
6条回答
  •  粉色の甜心
    2021-01-19 03:08

    The error come from you code below:

    model = svm.svc(kernel='linear', c=1, gamma=1) 
    

    After you use :

    svc = svm.SVC()
    

    svc is an object produced by svm.SVC(). So I guess what you want is :

    model = svc(kernel='linear', c=1, gamma=1)
    

    or

    model = svm.SVC(kernel='linear', c=1, gamma=1)
    

    Wish this could help~

提交回复
热议问题