Skip to content

Commit

Permalink
main files
Browse files Browse the repository at this point in the history
  • Loading branch information
Chvishnuvardhan707 committed Apr 9, 2019
1 parent 200baae commit c8886dd
Show file tree
Hide file tree
Showing 9 changed files with 16,996 additions and 0 deletions.
10,000 changes: 10,000 additions & 0 deletions bj_housing.csv

Large diffs are not rendered by default.

499 changes: 499 additions & 0 deletions hi.py

Large diffs are not rendered by default.

490 changes: 490 additions & 0 deletions housing.csv

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions myfile.py
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()
Loading

0 comments on commit c8886dd

Please sign in to comment.