The Best Guide On How To Implement Decision Tree In Python

55 The Best Guide On How To Implement Decision Tree In Python のメモ

  1. Building a Decision Tree in Python における、データの取得
    url='https://raw.githubusercontent.com/SarahFahadDSA/Loan-Repayment-Prediction-using-Decision-Tree/refs/heads/main/Loans_Dataset.csv'
    
    balance_data = pd.read_csv(url)
    balance_data
    
    2. Load the data set using the read_csv() function in pandas.
    result 列が5列目にあるのに注意
    url='https://raw.githubusercontent.com/SarahFahadDSA/Loan-Repayment-Prediction-using-Decision-Tree/refs/heads/main/Loans_Dataset.csv'
    
    balance_data = pd.read_csv(url)
    balance_data
    
    2. Load the data set using the read_csv() function in pandas.
    result 列が5列目にあるのに注意
    X = balance_data.values[:, 0:4]
    Y = balance_data.values[:,5]
          
    4. Separate the independent and dependent variables using the slicing method.
    result列の位置が変わっているので、X,Y の列の指定を変更する。

坂本直志 <sakamoto@c.dendai.ac.jp>
東京電機大学工学部情報通信工学科