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 | |
from keras.models import Sequential | |
from keras.layers.core import Activation, Dense | |
training_data = np.array([[0,0],[0,1],[1,0],[1,1]], "float32") | |
target_data = np.array([[0],[1],[1],[0]], "float32") | |
model = Sequential() | |
model.add(Dense(32, input_dim=2, activation='relu')) | |
model.add(Dense(1, activation='sigmoid')) |
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 Queue | |
class UndirectedGraph(object): | |
""" | |
Undirected Graph, with graph represented as an adjacency matrix | |
""" | |
def __init__(self, vertices): | |
self.adjacency_matrix = [] | |
for i in range(vertices): |
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 Queue | |
class DirectedGraph(object): | |
""" | |
Directed Graph, with graph represented as an adjacency list | |
""" | |
def __init__(self): | |
self.adjacency_list = {} |
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 | |
X = np.array([ [0,0,1], [0,1,1], [1,0,1], [1,1,1] ]) | |
y = np.array([ [0, 1, 1, 0] ]) | |
w1 = np.random.random((3, 4)) - 0.5 | |
w2 = np.random.random((4, 1)) - 0.5 | |
for i in range(45000): | |
l1 = 1/(1+ np.exp(-(np.dot(X, w1)))) | |
l2 = 1/(1+ np.exp(-(np.dot(l1,w2)))) | |
delta_l2 = (y - l2) * (l2*(1-l2)) | |
delta_l1 = delta_l2.dot(w2.T) * (l1*(1-l1)) |
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
#include <bits/stdc++.h> | |
using namespace std; | |
#ifndef ONLINE_JUDGE | |
bool debug = false; | |
#else | |
bool debug = true; | |
#endif | |
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
## Sublime Text 3 Serial key build is 3176 | |
The license key | |
----- BEGIN LICENSE ----- | |
sgbteam | |
Single User License | |
EA7E-1153259 | |
8891CBB9 F1513E4F 1A3405C1 A865D53F | |
115F202E 7B91AB2D 0D2A40ED 352B269B |
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 seaborn as sns | |
from sklearn import preprocessing, ensemble | |
from scipy.stats import kendalltau | |
import pandas as pd | |
import random | |
#todo change module name | |
from tqdm import tqdm | |
import numpy as np | |
import pandas as pd |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# This way we have randomness and are able to reproduce the behaviour within this cell. | |
np.random.seed(13) | |
def impact_coding(data, feature, target='y'): | |
''' | |
In this implementation we get the values and the dictionary as two different steps. | |
This is just because initially we were ignoring the dictionary as a result variable. | |
In this implementation the KFolds use shuffling. If you want reproducibility the cv | |
could be moved to a parameter. |
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 dataset | |
dataset <- read.csv('ASD.csv') | |
# Taking care of missing data | |
# Fixing ethnicity | |
dataset[dataset == "?"] <- NA | |
summary(dataset) | |
#install.packages('DescTools') | |
library(DescTools) |
OlderNewer