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
#Importing required libraries | |
from sklearn.linear_model import LinearRegression | |
from sklearn.datasets import california_housing | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import mean_squared_error | |
#Downloading dataset | |
data = california_housing.fetch_california_housing() | |
#Getting target and features |
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
#importing libraries | |
from sklearn.linear_model import LinearRegression | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import mean_squared_error | |
import pandas as pd | |
#loading data | |
data = pd.read_csv('path of your csv file here.csv') | |
#getting information |
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
#importing required libraries | |
import pandas as pd | |
from sklearn.linear_model import LogisticRegression | |
from sklearn.model_selection import train_test_split | |
#loading data from a csv file to a pandas Dataframe | |
df = pd.read_csv('https://query.data.world/s/nsyvxagzhkssbiwytst5vpuvxpwgtb') | |
#looking at first 5 rows of the data | |
df.head() |
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
#loading required libraries | |
import pandas as pd | |
from sklearn.model_selection import train_test_split | |
from sklearn.svm import SVC | |
#loading data for classification | |
df = pd.read_csv('https://query.data.world/s/67p5gkjye5vocfiqm2cuxnrkx4ijim') | |
#looking at first five rows | |
df.head() |
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
#loading required libraries | |
import pandas as pd | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import mean_squared_error | |
from sklearn.svm import SVR | |
#loading data | |
df = pd.read_csv('boston_train.csv') | |
#looking at first five rows |
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
#importing required libraries | |
from sklearn.neighbors import KNeighborsClassifier | |
import pandas as pd | |
from sklearn.model_selection import train_test_split | |
#loading data into dataframe | |
df = pd.read_csv('https://query.data.world/s/67p5gkjye5vocfiqm2cuxnrkx4ijim') | |
#printig first five rows | |
df.head() |
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
#importing required libraries | |
from sklearn.neighbors import KNeighborsRegressor | |
import pandas as pd | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import mean_squared_error | |
#loading data for regression | |
r_df = pd.read_csv('boston_train.csv') | |
#printing first five rows |
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
#importing required libraries | |
from sklearn.naive_bayes import GaussianNB | |
import pandas as pd | |
from sklearn.model_selection import train_test_split | |
#loading data into dataframe | |
df = pd.read_csv('https://query.data.world/s/67p5gkjye5vocfiqm2cuxnrkx4ijim') | |
#printig first five rows | |
df.head() |
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
#importing required libraries | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from sklearn.cluster import KMeans | |
#creating data | |
x1 = np.concatenate((np.random.normal(10,2,(100,1)),np.random.normal(20,5,(100,1)))) | |
x2 = np.concatenate((np.random.normal(10,2,(100,1)), np.random.normal(30,3,(100,1)))) | |
#visualizing the data |
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
#importing required libraries | |
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from sklearn.linear_model import LogisticRegression | |
from sklearn.tree import DecisionTreeClassifier, ExtraTreeClassifier | |
from sklearn.ensemble import RandomForestClassifier | |
from sklearn.svm import SVC | |
from sklearn.naive_bayes import GaussianNB | |
from sklearn.neighbors import KNeighborsClassifier |
OlderNewer