我只是学习阅读python源代码。这是我正在研究的代码:
from __future__ import division, print_function
import numpy as np
from sklearn import datasets
from utils import train_test_split, accuracy_score, Plot
from random_forest.random_forest_model import RandomForest
def main():
data = datasets.load_digits()
X = data.data
y = data.target
......
我跑步时
from utils import train_test_split, accuracy_score, Plot
我有以下错误:
Traceback (most recent call last):
File "<input>", line 1, in <module>
ImportError: cannot import name 'train_test_split'
即使安装软件包utils,此错误仍然会发生。 我该怎么办?