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
from sklearn.datasets import load_iris | |
from sklearn.model_selection import train_test_split | |
from sklearn.preprocessing import StandardScaler | |
from sklearn.decomposition import PCA | |
from sklearn.pipeline import Pipeline | |
from sklearn import tree | |
# Load and split the data | |
iris = load_iris() | |
X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2, random_state=42) |
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
from sklearn.datasets import load_iris | |
from sklearn.model_selection import train_test_split | |
from sklearn.preprocessing import StandardScaler | |
from sklearn.decomposition import PCA | |
from sklearn.pipeline import Pipeline | |
from sklearn.externals import joblib | |
from sklearn.linear_model import LogisticRegression | |
from sklearn import svm | |
from sklearn import tree |
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
""" | |
Checks a corpus created from a Wikipedia dump file. | |
""" | |
import sys, time | |
def check_corpus(input_file): | |
"""Reads some lines of corpus from text file""" |
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
""" | |
Creates a corpus from Wikipedia dump file. | |
Inspired by: | |
https://github.com/panyang/Wikipedia_Word2vec/blob/master/v1/process_wiki.py | |
""" | |
import sys | |
from gensim.corpora import WikiCorpus |
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
Practice | Outcome | |
---|---|---|
0 | 0 | |
0.3 | 0 | |
1 | 0 | |
1.2 | 0 | |
2 | 0 | |
2.2 | 0 | |
2.6 | 0 | |
3 | 0 | |
3.1 | 0 |
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
Temperature | Cola | |
---|---|---|
1 | 1 | |
2 | 1 | |
3 | 1 | |
4 | 1 | |
5 | 1 | |
6 | 1 | |
7 | 1 | |
8 | 1 | |
9 | 2 |
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
from keras.models import Sequential | |
from keras.layers import Dense, Activation | |
dims = X_train.shape[1] | |
print(dims, 'dims') | |
print("Building model...") | |
nb_classes = Y_train.shape[1] | |
print(nb_classes, 'classes') |
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
## Simple Linear Regression using R | |
#Install Package | |
install.packages("hydroGOF") | |
library("hydroGOF") | |
#Read data from .csv file | |
data = read.csv("Cola.csv", header = T) | |
head(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
#Loading the mice package | |
library(mice) | |
#Loading the following package for looking at the missing values | |
library(VIM) | |
library(lattice) | |
data(nhanes) | |
# First look at the data | |
str(nhanes) |
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
import numpy as np | |
import pandas as pd | |
from sklearn.preprocessing import LabelEncoder, OneHotEncoder | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import confusion_matrix | |
from keras.models import Sequential | |
from keras.layers import Dense |