<div dir="ltr">Sorry, should have been model_selection, not model_evaluation. cross_validation is now deprecated.</div><br><div class="gmail_quote"><div dir="ltr">On Sat, 16 Jun 2018 at 18:28, Alexandra Metallinou Log <<a href="mailto:alexandra.log@sintef.no">alexandra.log@sintef.no</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div id="m_-2901531863667486719divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Thank you, this worked. The error message was: undefined keyword: 'score-func'</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I also changed the line of code from </p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">scores = cross_validation.cross_val_score(model, X, Y, cv = 10, score_func = metrics.mean_squared_error)</span><br>
</p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px"><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">to</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px"><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">scores = cross_validation.cross_val_score(model,
X, Y, cv = 10, scores = 'mean_squared_error')</span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px"><br>
</span></span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">the code runs with this (I recieve
negative outputs though, so I took the abolute value of these afterwards). However the following deprecation warning is displayed:</span></span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px"><br>
</span></span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px"></span></span></p>
<div>C:\Python27\lib\site-packages\sklearn\cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface
of the new CV iterators are different from that of this module. This module will be removed in 0.20.</div>
<div> "This module will be removed in 0.20.", DeprecationWarning)</div>
<div>C:\Python27\lib\site-packages\sklearn\grid_search.py:42: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. This module will be removed in
0.20.</div>
<div> DeprecationWarning)</div>
<br>
<p></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">When I changed the code to:</span></span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px"><br>
</span></span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px"><span style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px"><span style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont;font-size:15px">model_evaluation.cross_val_score(model,
X, y, scoring=<span>'neg_mean_squared_error'</span>)</span></span></span><span style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont;font-size:15px">,</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont;font-size:15px"><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont;font-size:15px">the code runs fine ('neg_mse' was not an acceptable keyword).
I still get the same deprecation warning, though I don't understand why as I am using model_evaluation now. Regardless, I think the problem is fixed.</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont;font-size:15px"><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont;font-size:15px">Once again, thank you for your help!</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont;font-size:15px"><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont;font-size:15px">Kind regards, </span></p>
<p style="margin-top:0;margin-bottom:0"><span style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont;font-size:15px"><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont;font-size:15px">Alexandra</span></p>
</div>
<hr style="display:inline-block;width:98%">
<div id="m_-2901531863667486719divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Fra:</b> scikit-learn <scikit-learn-bounces+alexandra.log=<a href="mailto:sintef.no@python.org" target="_blank">sintef.no@python.org</a>> på vegne av Joel Nothman <<a href="mailto:joel.nothman@gmail.com" target="_blank">joel.nothman@gmail.com</a>><br>
<b>Sendt:</b> fredag 15. juni 2018 01.57.31<br>
<b>Til:</b> Scikit-learn user and developer mailing list<br>
<b>Emne:</b> Re: [scikit-learn] help</font>
<div> </div>
</div>
<div>
<div dir="auto">model_evaluation.cross_val_score(model, X, y, scoring='neg_mse') will produce the same, but negated so that greater is better.</div>
</div>
</div>
_______________________________________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scikit-learn</a><br>
</blockquote></div>