python(针对文本分类问题的sciket学习)

python(针对文本分类问题的sciket学习),python,python-3.x,scikit-learn,Python,Python 3.x,Scikit Learn,我得到以下错误: File "<ipython-input-2-c2b8a0449401>", line 3 news_train = skd.load_files('C:\Users\ahmir\Downloads\Compressed\SkdLearnDataSet\20news-bydate-train', ^ SyntaxError: (unicode error) 'unicodeescape' cod

我得到以下错误:

 File "<ipython-input-2-c2b8a0449401>", line 3
    news_train = skd.load_files('C:\Users\ahmir\Downloads\Compressed\SkdLearnDataSet\20news-bydate-train',
                               ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

用“/”替换“\”,用“/”替换“\”
import sklearn.datasets as skd
categories = ['alt.atheism', 'soc.religion.christian','comp.graphics', 'sci.med']
news_train = skd.load_files('C:\Users\ahmir\Downloads\Compressed\SkdLearnDataSet\20news-bydate-train', 
                            categories= categories, encoding= 'UTF-8')
news_test = skd.load_files('C:\Users\ahmir\Downloads\Compressed\SkdLearnDataSet\20news-bydate-test',categories= categories, encoding= 'ISO-8859-1')