Effects of investment environment on SME's gross capital formation in the Sub-Saharan region
# Load computational libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.metrics import r2_score
Abstract
1.Introduction
2 Literature Review
3. Methodology
Data
Methods
4.Data Pre-processing and Exploration
#STEP 2: Check all the columns in the data set to selct the required variables only
df.columns
Regression Analysis
#STEP 6: Exploratory data analysis.
# We split the dataset in order to obtain two different set that are used for training and validation of the regression equation
x_train, x_test, y_train, y_test = train_test_split(x,y, test_size=0.3, random_state=42)
#STEP 8: Predict the model
# we predict the value of y which is the response based on the seperated test data
y_prediction = model.predict(x_test)
6 Results and Discussion
#STEP 12 Summary Statistics
# We continue further on a summary statistics to determine the r2 with indicates how well the independent varibales affect the response variable
r2_score(y_train, model.predict(x_train))
7 Conclusion and Policy Recommendation
References