Kaggle競賽題目之——Predicting a Biological Response,kagglepredicting

來源:互聯網
上載者:User

Kaggle競賽題目之——Predicting a Biological Response,kagglepredicting
Predict a biological response of molecules from their chemical properties
從分子的化學屬性中預測其生物反應。
The objective of the competition is to help us build as good a model as possible so that we can, as optimally as this data allows, relate molecular information, to an actual biological response.

We have shared the data in the comma separated values (CSV) format. Each row in this data set represents a molecule. The first column contains experimental data describing an actual biological response; the molecule was seen to elicit this response (1), or not (0). The remaining columns represent molecular descriptors (d1 through d1776), these are calculated properties that can capture some of the characteristics of the molecule - for example size, shape, or elemental constitution. The descriptor matrix has been normalized.

簡述:給定CSV檔案,每行代表一個分子。第一列代表真實的生物反應,有反應(1),無反應(0)。第2列到第1777列代表分子的屬性,例如,大小、形狀或元素等。

這個題目的比賽早就結束了,但是仍然可以提交5次結果,查看自己的得分排名。只要提交一個csv格式的結果檔案就可以了。

看到0、1,可以確定這是一個二分類問題。

對於這樣一個二分類,多屬性的問題,首先想到用羅吉斯迴歸來試一下。

下面是使用Logistic Regression做預測的python代碼:

#!/usr/bin/env python#coding:utf-8'''Created on 2014年11月24日@author: zhaohf'''from sklearn.linear_model import LogisticRegressionfrom numpy import genfromtxt,savetxtdef main():    dataset = genfromtxt(open('../Data/train.csv','r'),delimiter=',',dtype='f8')[1:]    test = genfromtxt(open('../Data/test.csv','r'),delimiter=',',dtype='f8')[1:]    target = [x[0] for x in dataset]    train = [x[1:] for x in dataset]    lr = LogisticRegression()    lr.fit(train, target)    predicted_probs = [[index+1,x[1]] for index,x in enumerate(lr.predict_proba(test))]    savetxt('../Submissions/lr_benchmark.csv',predicted_probs,delimiter=',',fmt='%d,%f',header='Molecule,PredictedProbability',comments='')    if __name__ == '__main__':    main()

通過損失函數檢驗,最後的public score是0.59425,這算是一個非常差的分數了。排名數百名開外。

下面使用SVM來試一下。代碼非常相似。

#!/usr/bin/env python#coding:utf-8'''Created on 2014年11月24日@author: zhaohf'''from sklearn import svmfrom numpy import genfromtxt,savetxtdef main():    dataset = genfromtxt(open('../Data/train.csv','r'),delimiter=',',dtype='f8')[1:]    test = genfromtxt(open('../Data/test.csv','r'),delimiter=',',dtype='f8')[1:]    target = [x[0] for x in dataset]    train = [x[1:] for x in dataset]    svc = svm.SVC(probability=True)    svc.fit(train,target)    predicted_probs = [[index+1,x[1]] for index,x in enumerate(svc.predict_proba(test))]    savetxt('../Submissions/svm_benchmark.csv',predicted_probs,delimiter=',',fmt='%d,%f',header='MoleculeId,PredictedProbability',comments='')    if __name__ == '__main__':    main()

SVM的得分是0.52553。比起LR略好。

熱門排行榜上做到最好的分數是0.37356,要想參加比賽取得成績還是要做些努力的。


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.