I am just starting to learn python and apologize if this is really a basic question / mistake.
I am doing a Kaggle biological response tutorial. I get this error
C: \ Anaconda \ Lib \ site-packages \ sklearn \ cross_validation.py: 65: DeprecationWarning: the index parameter is outdated and will be removed (assumed True) in 0.17 stacklevel = 1) Results: 0.458614231133
Does anyone know what that means? I killed him to death and did not find the answer.
script I run:
from sklearn.ensemble import RandomForestClassifier
from sklearn import cross_validation
import logloss
import numpy as np
def main():
dataset = np.genfromtxt(open('train.csv','r'), delimiter=',', dtype='f8')[1:]
target = np.array([x[0] for x in dataset])
train = np.array([x[1:] for x in dataset])
cfr = RandomForestClassifier(n_estimators=100)
cv = cross_validation.KFold(len(train), n_folds=5, indices=False)
results = []
for traincv, testcv in cv:
probas = cfr.fit(train[traincv], target[traincv]).predict_proba(train[testcv])
results.append( logloss.llfun(target[testcv], [x[1] for x in probas]) )
print "Results: " + str( np.array(results).mean() )
if __name__=="__main__":
main()
I believe this is called:
__author__ = 'nickd'
import scipy as sp
def llfun(act, pred):
epsilon = 1e-15
pred = sp.maximum(epsilon, pred)
pred = sp.minimum(1-epsilon, pred)
ll = sum(act*sp.log(pred) + sp.subtract(1,act)*sp.log(sp.subtract(1,pred)))
ll = ll * -1.0/len(act)
return ll
Once again, it is unfortunate if this is the main material. I really have never done this before.
source
share