我是SVM领域的新手,并且正在尝试通过教程来教导自己。我最近试图创建一个样本svm测试,但是,run-time
似乎是无止境的。考虑到我的dataframe
有7976行,典型的处理时间是多少?使用SVM处理时间
import numpy as np
from sklearn import svm
from sklearn import preprocessing
import pandas as pd
import os
directory_name = 'D:\Timothy\Practice SVM\Data'
name_of_file = 'Sample_SVM.csv'
df_start = pd.read_csv(os.path.join(directory_name, name_of_file))
df_cleaned = df_start.dropna()
X = df_cleaned.ix[1:8000, 'Sun'].as_matrix()
X = X.reshape((7976,1)) #unsure if this step is needed
X_test = df_cleaned.ix[8000:9913, 'Sun'].as_matrix()
y = df_cleaned.ix[1:8000, 'Meter_Total'].as_matrix()
y_test = df_cleaned.ix[8000:9913, 'Meter_Total'].as_matrix()
model = svm.SVC(kernel='linear', C=1, gamma=1)
model.fit(X,y)
model.score(X, y)
predicted = model.predict(X_test)
您的数据是否正常化? – hashcode55