我需要一个python脚本来运行模型的次数,并将所有运行的结果(MAEValue)保存在CSV文件中。你知道吗
model = SVR(kernel = 'rbf',gamma=0.032 ,C=16187.696941074802) # it also can be : linear, poly, linear, linear, precomputed
model.fit(X_train, y_train)
print('Grey Wolf Train Score is : ' , model.score(X_train, y_train))
print('Grey Wolf Test Score is : ' , model.score(X_test, y_test))
y_preda = model.predict(X_test)
#Calculating Mean Absolute Error
MAEValue1 = mean_absolute_error(y_test, y_preda, multioutput='uniform_average') # it can be raw_values
print(MAEValue1)
在运行之前创建空数据帧:
然后每次得到
MAEValue1
时,使用以下命令将其输入df
:最后(在所有运行之后)将其保存为:
相关问题 更多 >
编程相关推荐