从github中load数据
library(RCurl)
x <- getURL("https://raw.github.com/aronlindberg/latent_growth_classes/master/LGC_data.csv")
y <- read.csv(text = x)
From UCI
## Not run:
# Download UCI Archived Dataset from URL:
# http://archive.ics.uci.edu/ml/machine-learning-databases/00217/C50.zip
# Reuter 50 DataSet
URL = "http://archive.ics.uci.edu/ml/machine-learning-databases/00217/C50.zip"
folder = getwd()
loadURLData(URL, folder, unzip = TRUE)
download.file("http://archive.ics.uci.edu/ml/machine-learning-databases/statlog/german/german.data","./german.data") #下载文件german.data
read.table(german.data)
ggplot(sim1, aes(x, resid)) +
geom_ref_line(h = 0) +
geom_point()
python from uci
import numpy as np
import urllib
# url with dataset
url = "http://archive.ics.uci.edu/ml/machine-learning-databases/pima-indians-diabetes/pima-indians-diabetes.data"
# download the file
raw_data = urllib.urlopen(url)
# load the CSV file as a numpy matrix
dataset = np.loadtxt(raw_data, delimiter=",")
# separate the data from the target attributes
X = dataset[:,0:7]
y = dataset[:,8]