Python sklearn logistic regression

python

#1

Hi
I’m a beginner with Cloud9

Im trying to use python sklearn to do logistic regression for Udacity Google course on Deep Learning (assignment 1)

so its quite a big training dataset (unzipped = about 1 Go)

on my laptop PC, the following ran fine

(samples, width, height) = train_dataset.shape
X = np.reshape(train_dataset,(samples,widthheight))
(samples, width, height) = test_dataset.shape
Xtest=np.reshape(test_dataset,(samples,width
height))

Y=train_labels
Ytest=test_labels

from sklearn import datasets, neighbors, linear_model

logistic = linear_model.LogisticRegression(C=0.001)
knn = neighbors.KNeighborsClassifier()

import time
t1 = time.time()
print(‘KNN score: %f’ % knn.fit(X,Y).score(Xtest,Ytest))
print(‘LogisticRegression score: %f’
% logistic.fit(X,Y).score(Xtest,Ytest))
t2 = time.time()

print(“Time: %0.2fs” % (t2 - t1))
However, running the same code on Cloud9, i get the laconic output “Killed”

Is it some kind of RAM problem ? how can do some controls to see what the problem is ?

how can i see the available RAM and other similar info on Cloud 9

thanks


#2

Hi,

Yes, this seems like the process consumed all the RAM available to your workspace and got killed.

In order to view RAM usage, you can click on the Stats menu near the top right of the IDE (to the left of ‘Share’). If you click it open, you’ll see graphs showing the history of RAM / Disk / CPU consumption by processes running on your workspace.

Regards,
​Mutahhir