In [1]:
import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error, r2_score
In [2]:
df = pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/housing/housing.data',
header=None,sep="\s+")
df.columns = ["CRIM","ZN","INDUS","CHAS","NOX","RM","AGE","DIS","RAD","TAX","PTRATIO","B","LSTAT","MEDV"]
In [3]:
X = df.iloc[:,:-1].values
y = df["MEDV"].values
slr = LinearRegression()
slr.fit(X,y)
Out[3]:
In [6]:
from analyzefit import Analysis
In [7]:
an = Analysis(X,y,slr)
an.res_vs_fit()
In [ ]: