-
-
Save zelsaddr/28bf35d155c9f16f1b8913aec8b3a62e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # Di kerjakan bersama : | |
| # - Izzeldin Addarda (41519010045) | |
| # - Micheal Gunawan (41519010147) | |
| # - Akbar Basyarudin (41519010046) | |
| # - Fahad Hakim Mc (41519010061) | |
| # - Dinda Arum Nugroho (41519010049) | |
| # - Sandika Maulana (41519010066) | |
| # - Bambang Subroto (41519010067) | |
| import pandas as pd | |
| import sys | |
| import numpy as np | |
| from sklearn.linear_model import LinearRegression | |
| from sklearn.preprocessing import MinMaxScaler | |
| from sklearn.preprocessing import StandardScaler | |
| data = pd.read_csv('train.csv') | |
| scaler = MinMaxScaler() | |
| X = data[['LotFrontage', 'LotArea']].astype(float).fillna(0) | |
| Y = data['SalePrice'].astype(float).fillna(0) | |
| new_X = np.array(StandardScaler().fit_transform(X)).reshape(2, -1) | |
| new_Y = np.array(StandardScaler().fit_transform(Y.values.reshape(-1, 1))) | |
| print() | |
| B = np.dot(np.dot((np.dot(new_X.T, new_X)**-1), new_X.T).reshape(2, -1), new_Y) | |
| print("B adalah\n", B) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment