JackyXu-Cool / Team-2130-Machine-Learning-Roulette

Georgia Tech Junior Design Project
8 stars 5 forks source link

Decision Tree Algorithm fail to run #56

Closed JackyXu-Cool closed 1 year ago

JackyXu-Cool commented 1 year ago

I ran the decision tree algorithm with the X_test.csv and Y_test.csv in /testdata folder, but I got this error

  File "C:\JackyXu\GT\Spring 2022\Junior Design\code\mlr_backend\run.py", line 90, in trainData       
    dtree_accuracy = metrics.calculateAccuracy(prediction, Ytest)
  File "C:\JackyXu\GT\Spring 2022\Junior Design\code\mlr_backend\metrics.py", line 6, in calculateAccuracy
    model_output = [int(row[0]) for row in y.tolist()]
  File "C:\JackyXu\GT\Spring 2022\Junior Design\code\mlr_backend\metrics.py", line 6, in <listcomp>   
    model_output = [int(row[0]) for row in y.tolist()]
TypeError: 'float' object is not subscriptable

Can you take a look at it @ruokun-niu

ruokun-niu commented 1 year ago

Gonna take a look later today

JackyXu-Cool commented 1 year ago

Resolved! Thanks Tommy for fixing this!