Hi I have seen some examples of machine learning implementations that uses as_matrix with dataframes as inputs to machine learning algorithms. I wonder if it is OK to use tuples, which are output of .as_matrix as inputs to machine learning algorithms such as below. Thanks
trainArr_All = df.as_matrix(cols_attr) # training array
trainRes_All = df.as_matrix(col_class) # training results
trainArr, x_test, trainRes, y_test = train_test_split(trainArr_All, trainRes_All, test_size=0.20, random_state=42)
rf = RandomForestClassifier(n_estimators=20, criterion='gini', random_state=42) # 100 decision trees
y_score = rf.fit(trainArr, trainRes.ravel()).predict(x_test)
y_score = y_score.tolist()