原创 使用隨機森林判定特徵的重要性

  from sklearn.ensemble import RandomForestClassifier feat_labels = X.columns[0:] forest = RandomForestClassifier(n_es

原创 TensorFlow學習——基本概念

(Python+TensorFlow機器學習實戰) 1.Tensor(張量)         最基本的概念,也是TensorFlow中最主要的數據結構。用於在計算圖中進行數據傳遞,不會立即在計算圖中增加該張量,而需要將該張量複製給一個變量

原创 python錯誤原因及解決方法:TypeError: write() argument must be str, not bytes

今天運行了一個GitHub上的源碼出現TypeError: write() argument must be str, not bytes錯誤,主要是因爲源碼是python2實現的,而我使用的是python3。 python2寫入或讀取二

原创 python錯誤:TypeError: pivot_table() got an unexpected keyword argument 'rows'

data = df1.pivot_table("source",rows='enrollment_id',cols="event",aggfunc='count',fill_value=0) 運行上述代碼時總是出現TypeError:

原创 python 錯誤 SyntaxError: invalid character in identifier

python運行出現SyntaxError: invalid character in identifier錯誤卻有找不出明顯的錯誤。 python是對空格、tab等十分敏感的語言,所以檢查代碼行內沒有夾雜中文的空格,tab等,非文字字符

原创 使用yum安裝計劃任務功能出錯

使用yum安裝計劃任務功能出錯,如下: Another app is currently holding the yum lock; waiting for it to exit...   The other application is