1. 程式人生 > >svm使用出現FutureWarning: The default value of gamma will change from 'auto' to 'scale' in version 0.22

svm使用出現FutureWarning: The default value of gamma will change from 'auto' to 'scale' in version 0.22

 G:/workspace/Firmware-url-Detection/url_classfication/trainer_zgd.py
C:\Users\zgd\AppData\Roaming\Python\Python27\site-packages\sklearn\svm\base.py:196: FutureWarning: The default value of gamma will change from 'auto' to 'scale' in version 0.22 to account better for unscaled features. Set gamma explicitly to 'auto' or 'scale' to avoid this warning. "avoid this warning.", FutureWarning)

 雖然這個警告資訊並不影響正常結果的輸出,但是看起來讓人覺得很不舒服。於是就想著一個方法把這個警告資訊給去了。

使用下面這兩行程式碼直接解決:

import warnings

warnings.filterwarnings("ignore", category=FutureWarning, module="sklearn", lineno=196)

其中ignore表示忽略這個警告資訊,category表示要忽略的警告資訊的類別,module表示要處理的模組資訊,lineno表示要處理第XX行程式碼出現警告的地方。具體資訊可以參考上面一個截圖,對照修改就行。

相關推薦

svm使用出現FutureWarning: The default value of gamma will change from 'auto' to 'scale' in version 0.22

 G:/workspace/Firmware-url-Detection/url_classfication/trainer_zgd.py C:\Users\zgd\AppData\Roaming\Python\Python27\site-packages\sklearn\s

python pandas進行條件篩選時出現ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().”

  在使用pandas進行條件篩選時,使用瞭如下的程式碼:          fzd_index=data[(data['實際輻照度']<mi)or(data['實際輻照度']>ma)].index     原本以為,並沒有太大的問題。但是出現了ValueError: The truth valu

Type of the default value for 'searches' prop must be a function 如何解決vue中報出的這種錯誤

https://google.com/#q=vue%2Frequire-valid-default-prop  Type of the default value for 'searches' prop must be a function     src/base/s

Python異常:ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.an

Python跑了一個策略,報了個異常:ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().這句換的大概意思是:“”陣列的真實值不明確“”

Liferay:Please set the environment variable ANT_OPTS to the recommended value of

Liferay在編譯時會出現的問題記憶體不夠提示: Please set the environment variable ANT_OPTS to  The recommended value of “-Xmx1024m -XX:MaxPersize=512m”.  這個提示

The Value of 'Free Will' in a Digital Age

Human consciousness provides individuals with a capacity that non-conscious AI cannot acquire. Despite this fact, one of the most debated topics in the fie

The Value of ‘Free Willin a Digital Age

The Value of ‘Free Will’ in a Digital AgeHuman consciousness provides individuals with a capacity that non-conscious AI cannot acquire. Despite this fact,

We're Missing the Real Value of Self-Driving Cars

Two car accident victims stumble into a bar. The first tells the bartender, “it came out of nowhere.” The second has, before arriving, already sent pre-cra

Sizing The Market Value Of Artificial Intelligence

These and many other fascinating findings and insights are from a recent McKinsey Global Institute (MGI) Discussion Paper, Notes from the AI frontier: Appl

ECShop後臺站點地圖關於 Deprecated: Assigning the return value of new by reference is deprecated的錯誤的解決辦法

今天對後臺系統進行一些簡單的操作,當點選  系統設定---站點地圖  時發現提示: Deprecated: Assigning the return value of new by reference is deprecated 的錯誤,如下圖: 起先以為是程式碼的問題,

Change the Subnet Mask for the Default Subnet of Your Default VPC

Amazon Web Services is Hiring. Amazon Web Services (AWS) is a dynamic, growing business unit within Amazon.com. We are currently hiring So

Chang the default encoding of notepad

http://www.2cto.com/os/201205/132710.html 改Windows記事本(notepad)預設編碼為Unicode或UTF-8的方法 Windows記事本預設編碼ANSI無法滿足需求, 每次都得“另存為”然後選擇編碼方式。 找

The Metamorphosis of Silicon Valley CEOs: From Big to Boring

This story is for Medium members.Continue with FacebookContinue with GoogleMedium curates expert stories from leading publishers exclusively for members (w

成功解決This module was deprecated in version 0.18 in favor of the model_selection module into which all

解決問題:This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions

Upgrade the OS of an EC2 Instance Running Windows to a Newer Version

Amazon Web Services is Hiring. Amazon Web Services (AWS) is a dynamic, growing business unit within Amazon.com. We are currently hiring So

Evolution of Application Data Caching : From RAM to SSD

Evolution of Application Data Caching : From RAM to SSDIn 2013, we introduced EVCache a distributed in-memory caching solution based on memcached that offe

identifier of an instance of bean was altered from 1 to 2(持久化物件ID變更)

今天遇到個怪問題,hibernate修改外來鍵id時出現: org.springframework.orm.hibernate3.HibernateSystemException: identifier of an instance of xx altered from 2

leetcode-Evaluate the value of an arithmetic expression in Reverse Polish Notation

ret i++ value reverse alua style 執行 掃描 span leetcode 逆波蘭式求解 Evaluate the value of an arithmetic expression in Reverse Polish Notation. Va

解決錯誤:Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.

context 錯誤 com sta spa can src 直接 代碼 原因是代碼直接放在默認包裏邊,比如src\main\java目錄下 應該在src\main\java下建立子目錄,比如src\main\java\com\test 這樣的話,代碼就在com.tes

Django:創建用戶模型報錯: (admin.E108) The value of 'list_display[4]'解決方案

png str 行數 div bool 解析 創建 delet sts 參考資料:蟲師-《web接口開發與自動化測試:基於python語言》 日常學習Django框架中,創建了用戶模型,但是頁面功能驗證時候,提示不能進行列表字段操作,debug好久,才找到問題原因,心累。。