I have been trying to read in csv files from the MNIST dataset that have already been split into features and target variables. I believe the code to be correct, as no error message appears and in VSC it also compiles fine. The issue is that I just don’t get an output. It just skips to the next cell. When giving it a simpler operation like 2x4 it shows the output fine. Any suggestions?
Here’s the code:
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split
from joblib import dump
df = pd.read_csv(‘./data/mnist_target.csv’, index_col = 0)
target = pd.read_csv(‘data/mnist_target.csv’, index_col = 0)
tree_clf = DecisionTreeClassifier()
df_train, df_test, target_train, target_test = train_test_split(df, target, test_size=0.2, random_state=0) tree_clf.fit(df_train, target_train) predictions = tree_clf.predict(df_test) print(predictions[:10])
Thanks in Advance!