<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Combined Cycle Power Plant Regression
This is an analysis of the <a href="https
Step1:  Attribute Information
Features consist of hourly average ambient variables
- Temperature (T) in the range 1.81°C and 37.11°C,
- Ambient Pressure (AP) in the range 992.89-1033.30 milibar,
- Relative Humidity (RH) in the range 25.56% to 100.16%
- Exhaust Vacuum (V) in teh range 25.36-81.56 cm Hg
- Net hourly electrical energy output (EP) 420.26-495.76 MW
The averages are taken from various sensors located around the plant that record the ambient variables every second. The variables are given without normalization. 
Univariate Analysis
Step2:  Correlation With the Target column
Step3:  Feature Correlations
Step4:  Bivariate Analysis
Step5:  OLS Regression
Step6:  Cross-Validation
<ASSISTANT_TASK:>
Python Code:
import numpy as np
import pandas as pd
%pylab inline
pylab.style.use('ggplot')
import seaborn as sns
pp_data = pd.read_csv('ccpp.csv')
pp_data.head()
Explanation: Combined Cycle Power Plant Regression
This is an analysis of the <a href="https://archive.ics.uci.edu/ml/datasets/Combined+Cycle+Power+Plant">Combined Cycle Power Plant</a> dataset in the UCI archive.
End of explanation
for c in pp_data.columns:
    _ = pylab.figure()
    pp_data.loc[:, c].plot(kind='hist')
Explanation: Attribute Information
Features consist of hourly average ambient variables
- Temperature (T) in the range 1.81°C and 37.11°C,
- Ambient Pressure (AP) in the range 992.89-1033.30 milibar,
- Relative Humidity (RH) in the range 25.56% to 100.16%
- Exhaust Vacuum (V) in teh range 25.36-81.56 cm Hg
- Net hourly electrical energy output (EP) 420.26-495.76 MW
The averages are taken from various sensors located around the plant that record the ambient variables every second. The variables are given without normalization. 
Univariate Analysis
End of explanation
feature_data = pp_data.drop('AT', axis=1)
corrs = feature_data.corrwith(pp_data.loc[:, 'AT'])
corrs.sort_values(ascending=False).plot(kind='barh')
Explanation: Correlation With the Target column
End of explanation
f_corrs = feature_data.corr()
sns.heatmap(f_corrs, annot=True)
Explanation: Feature Correlations
End of explanation
fig, axes = pylab.subplots(1, 4, figsize=(16, 8))
for i, c in enumerate(feature_data.columns):
    sns.regplot(x=c, y='AT', data=pp_data, ax=axes[i])
from sklearn.feature_selection import f_regression
f_scores, f_probs = f_regression(feature_data, pp_data.loc[:, 'AT'])
f_imp_df = pd.DataFrame({'scores': f_scores, 'probs': f_probs}, index=feature_data.columns)
f_imp_df.plot(kind='barh', subplots=True)
Explanation: Bivariate Analysis
End of explanation
import statsmodels.formula.api as sm
model = sm.ols(formula='AT ~ PE + RH + V', data=pp_data)
result = model.fit()
result.summary()
Explanation: OLS Regression
End of explanation
from sklearn.model_selection import KFold
from sklearn.metrics import r2_score
n_splits = 10
fold = KFold(n_splits=n_splits, shuffle=True)
scores = []
for train_idx, test_idx in fold.split(pp_data):
    model = sm.ols(formula='AT ~ PE + RH + V', data=pp_data.loc[train_idx])
    result = model.fit()
    test_features = pp_data.loc[test_idx].drop('AT', axis=1)
    
    predictions = result.predict(test_features)
    actual = pp_data.loc[test_idx, 'AT']
    
    score = r2_score(actual, predictions)
    scores.append(score)
    
scores = pd.Series(scores)
scores.plot(kind='bar')
Explanation: Cross-Validation
End of explanation
<END_TASK>