-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
200baae
commit c8886dd
Showing
9 changed files
with
16,996 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Created on Tue Mar 5 19:51:58 2019 | ||
@author: Vishnu Vardhan Ch | ||
""" | ||
|
||
|
||
|
||
|
||
|
||
|
||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
import pandas as pd | ||
|
||
|
||
dataset = pd.read_csv('housing.csv') | ||
X = dataset.iloc[:, :-1].values | ||
y = dataset.iloc[:, 3].values | ||
|
||
from sklearn.model_selection import train_test_split | ||
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.1, random_state = 0) | ||
|
||
from sklearn.linear_model import LinearRegression | ||
regressor = LinearRegression() | ||
regressor.fit(X_train,y_train) | ||
|
||
y_pred = regressor.predict(X_test) | ||
|
||
import statsmodels.formula.api as sm | ||
X = np.append(arr=np.ones((489,1)).astype(int),values=X,axis=1) | ||
X_opt = X[:,[0,1,2,3]] | ||
regressor_OLS =sm.OLS(endog=y,exog=X_opt).fit() | ||
regressor_OLS.summary() |
Oops, something went wrong.