我应该如何修复这个弃用警告?

时间:2018-05-02 04:25:46

标签: python scikit-learn

%matplotlib笔记本

/home/abdul/anaconda3/lib/python3.6/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.
        "This module will be removed in 0.20.", DeprecationWarning)

警告

<?php
  session_start();
  if(isset($_SESSION['directaccess']))
  {
    if(isset($_POST['logoutbtn']))
    {
        session_destroy();
        header("location: loginform.php");
    }
  /* Your code goes here */

  }
  else{
     exit('Access denied');
   }
  ?>

 <form class="myform" action="" method="post">  
 <input name="logoutbtn" type="submit" value="logout" class="sbbtn" 
  id="logout_btn" class="test"/>
 </form>
  </div>
 </body>
  </html>

我正在使用jupytor笔记本和上面的代码行。发生弃用警告,我该如何解决?

1 个答案:

答案 0 :(得分:1)

弃用意味着该模块已标记为过期或已弃用,因此当时不会超出某个特定点的任何官方维护。 (在这种情况下版本0.20)。如果您计划升级到这一点,则必须在代码中修复此问题。

在你的特殊情况下,而不是

  

from sklearn.cross_validation import train_test_split

你可以使用,

  

from sklearn.model_selection import train_test_split