Advertisement

Hands-On Machine Learning with Scikit-Learn & TensorFlow Exercise Q&A Chapter 02

阅读量:

Due to an unknown reason, the Scikit-Learn package on my computer is unable to handle the ColumnTransformer function, resulting in repeated failures in obtaining the housing_prepared data. As a result, the responses that follow are the official answers and results.

Q1. 采用支持向量机回归模型(sklearn.svm.SVR),尝试不同的超参数配置。对于核函数为线性的情况(通过调节C参数的不同取值),以及核函数为径向基函数的情况(同时调节C和gamma参数),观察最佳预测器的表现如何?

A1:

model:

复制代码
 from sklearn.model_selection import GridSearchCV

    
  
    
 param_grid = [
    
     {'kernel': ['linear'], 'C': [10., 30., 100., 300., 1000., 3000., 10000., 30000.0]},
    
     {'kernel': ['

全部评论 (0)

还没有任何评论哟~