- Ensemble Machine Learning Cookbook
- Dipayan Sarkar Vijayalakshmi Natarajan
- 373字
- 2021-07-02 13:21:54
How it works...
In Step 1, we started by reading and describing our data. This step provided us with summary statistics for our dataset. We looked at the number of variables for each datatype in Step 2.
In Step 3, we created two variables, namely, numerical_features and categorical_features, to hold the names of numerical and categorical variables respectively. We used these two variables in the steps when we worked with numerical and categorical features separately.
In Step 4 and Step 5, we used the seaborn library to plot our charts. We also introduced the melt() function from pandas, which can be used to reshape our DataFrame and feed it to the FacetGrid() function of the seaborn library. Here, we showed how you can paint the distribution plots for all the numerical variables in one single go. We also showed you how to use the same FacetGrid() function to plot the distribution of SalesPrice by each categorical variable.
We generated the correlation matrix in Step 6 using the corr() function of the DataFrame object. However, we noticed that with too many variables, the display does not make it easy for you to identify the correlations. In Step 7, we plotted the correlation matrix heatmap by using the heatmap() function from the seaborn library.
In Step 8, we saw how the numerical variables correlated with the sale prices of houses using a scatter plot matrix. We generated the scatter plot matrix using the regplot() function from the seaborn library. Note that we used a parameter, fit_reg=False, to remove the regression line from the scatter plots.
In Step 9, we repeated Step 8 to see the relationship of the numerical variables with the sale prices of the houses in a numerical format, instead of scatter plots. We also sorted the output in descending order by passing a [::-1] argument to the corr() function.
- 嵌入式系統(tǒng)及其開發(fā)應(yīng)用
- 智能傳感器技術(shù)與應(yīng)用
- 7天精通Dreamweaver CS5網(wǎng)頁設(shè)計與制作
- Hands-On Neural Networks with Keras
- 輕松學Java
- Expert AWS Development
- 城市道路交通主動控制技術(shù)
- STM32嵌入式微控制器快速上手
- 人工智能趣味入門:光環(huán)板程序設(shè)計
- 生成對抗網(wǎng)絡(luò)項目實戰(zhàn)
- 人工智能云平臺:原理、設(shè)計與應(yīng)用
- Java求職寶典
- 數(shù)據(jù)庫基礎(chǔ):Access
- 歐姆龍CP1系列PLC原理與應(yīng)用
- 創(chuàng)客機器人實戰(zhàn):基于Arduino和樹莓派