Search the whole station

# 预测分析课业代写 Predictive Analytics代写 作业代写

728

## Homework 6

Submit a report on a pdf with white background.

### 1. 预测分析课业代写

Use the Boston dataset from sklearn.datasets to fit the following models to predict the price of houses in the Boston area. Read boston.data into a DataFrame using

X = pd.DataFrame(boston.data,columns = boston.feature_names).

Before modeling let us rename some features. Rename features RM and CHAS with

X.rename(columns = {’RM’:’MR’,’CHAS’:’HAS’},inplace=True). Then use X.columns.str[:1]

to rename all 13 columns by their first letter. Whenever needed (use random_state = 0 and default test, train sizes). Use sklearn to fit all models.

#### a) (10 pts.)

Use MinMaxScaler() to scale all features in (0, 1). Split the data into train and test set .

Fit a linear regression model. Report test R2 , test MSPE.

#### b) (15 pts.) 预测分析课业代写

Use poly = PolynomialFeatures() to add 93 features in a new array X3.

Use poly.get_feature_names(X.columns) to review the names of the old and new columns.

Convert array X3 to a DataFrame using

X3 = pd.DataFrame(X3,columns=poly.get_feature_names(X.columns))

We will call X3 the extended Boston dataset.

Use MinMaxScaler() to scale all 104 features in (0, 1), call it X4.

Split X4 into train and test set. Use these sets for all of the following parts in this homework.

Fit a linear regression model. Report test R2 , test MSPE.

#### c) (15 pts.) 预测分析课业代写

Use Ridge(alpha = 0.1,normalize = True).fit(X_train,y_train) to fit a RR model.

Notice that we are normalzing the already scaled data in X4. Report test R2 , test MSPE.

#### d) (15 pts.)

Search for the best alpha value then fit the RR model again. Report test R2 , test MSPE.

#### e) (15 pts.)

Fit a Random Forest model on 500 trees with max_features = 10, max_depth = 6, random_state=0. Report test R2 , test MSPE.

#### f) (15 pts.)

Find most important features in the extended Boston dataset identified by the RF. Report the top seven. What original features are most important?

#### g) (15 pts.)

Use GridSearchCV to find best values for max_features, max_depth. Fit the RF with these values and report test R2 , test MSPE.

The prev:

### Related recommendations

• #### 算法作业代写 Algorithm代写 CS代写 cs算法课业代写

854

Algorithm in Action CSCI-570 Homework 4 算法作业代写 1 Compute Max-Flow And Min-Cut 2 Escape From the Building In this problem, we need to decide whether there is a feasible plan for all th...

View details
• #### 运筹学作业代写 PRODUCTION AND Operations Analysis代写

1117

PRODUCTION AND Operations Analysis IEOR 3402: Assignment 6 运筹学作业代写 1. The Manager of the American Savings Bank wants to determine the minimum number of tellers needed to handle luncht...

View details
• #### Datastructure代写业务-家人们，我想问决定Datastructure代写

268

家人们，我想问决定Datastructure代写价格的依据是什么？ Datastructure代写业务 Datastructure作业，翻译成中文就是数据结构作业。一般来说，Datastructure作业往往是计算机专业留学生的必修课、必完成的作...

View details
• #### 作业代写枪手-作业代写枪手告诉你，怎么写一篇高水平的

616

作业代写枪手告诉你，怎么写一篇高水平的读书报告 作业代写枪手 随着社会和科技的发展，知识的重要性是毫无疑问的。正所谓“活到老，学到老”。那要如何读书才可以让你有效的学习知识呢？读书报告在这其中的作...

View details
1