Skip to content

Instantly share code, notes, and snippets.

public class Bean {
private String field;
public String getField() {
return field;
}
public synchronized void setField(String field) {
this.field = field;
}
@ktisha
ktisha / wine.csv
Created February 18, 2018 14:58
ML2018 homework # 1
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
# 1. Class 1/2/3
# 2. Alcohol
# 3. Malic acid
# 4. Ash
# 5. Alcalinity of ash
# 6. Magnesium
# 7. Total phenols
# 8. Flavanoids
# 9. Nonflavanoid phenols
# 10. Proanthocyanins
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 1 column, instead of 9 in line 9.
# 1. Number of times pregnant
# 2. Plasma glucose concentration a 2 hours in an oral glucose tolerance test
# 3. Diastolic blood pressure (mm Hg)
# 4. Triceps skin fold thickness (mm)
# 5. 2-Hour serum insulin (mu U/ml)
# 6. Body mass index (weight in kg/(height in m)^2)
# 7. Diabetes pedigree function
# 8. Age (years)
# 9. Class variable (0 or 1)
6,148,72,35,0,33.6,0.627,50,1
ham Go until jurong point, crazy.. Available only in bugis n great world la e buffet... Cine there got amore wat...
ham Ok lar... Joking wif u oni...
spam Free entry in 2 a wkly comp to win FA Cup final tkts 21st May 2005. Text FA to 87121 to receive entry question(std txt rate)T&C's apply 08452810075over18's
ham U dun say so early hor... U c already then say...
ham Nah I don't think he goes to usf, he lives around here though
spam FreeMsg Hey there darling it's been 3 week's now and no word back! I'd like some fun you up for it still? Tb ok! XxX std chgs to send, £1.50 to rcv
ham Even my brother is not like to speak with me. They treat me like aids patent.
ham As per your request 'Melle Melle (Oru Minnaminunginte Nurungu Vettam)' has been set as your callertune for all Callers. Press *9 to copy your friends Callertune
spam WINNER!! As a valued network customer you have been selected to receivea £900 prize reward! To claim call 09061701461. Claim code KL341. Valid 12 hours only.
spam Had your mobile 11 months
bone_length rotting_flesh hair_length has_soul color type
0.3545121845821541 0.35083902671065004 0.4657608918291205 0.78114166586219 clear Ghoul
0.5755599050254655 0.42586843221058457 0.5314013787091408 0.43989887703728897 green Goblin
0.467875498742323 0.3543304203917748 0.8116160896689244 0.7912249733377691 black Ghoul
0.7766524606554741 0.5087225499432287 0.6367655799597881 0.8844636920976973 black Ghoul
0.56611660205779 0.8758617955062562 0.4185936708748797 0.6364378187279373 green Ghost
0.40567974489188297 0.253277496666039 0.4414196710726873 0.2803238199213896 green Goblin
0.39933085086043796 0.5689517671030597 0.6183910202674578 0.4679008345210921 white Goblin
0.5162238981116547 0.5364287456984622 0.6127761465851604 0.4680482696484728 clear Ghoul
0.31429527592019163 0.6712796900808566 0.4172669166262837 0.2275475750972251 blue Ghost
import numpy
from PIL import Image
def scale_to_unit_interval(ndar, eps=1e-8):
ndar = ndar.copy()
ndar -= ndar.min()
ndar *= 1.0 / (ndar.max() + eps)
return ndar
from matplotlib.mlab import find
import numpy as np
import matplotlib.pyplot as pl
def visualize(clf, X, y):
border = .5
h = .02
x_min, x_max = X[:, 0].min() - border, X[:, 0].max() + border
y_min, y_max = X[:, 1].min() - border, X[:, 1].max() + border