Implicit Heterogeneous Features Embedding in Deep Knowledge Tracing决策树实现
Implicit Heterogeneous Features Embedding in Deep Knowledge Tracing决策树实现
论文
Implicit Heterogeneous Features Embedding in Deep Knowledge Tracing
Haiqin Yang1 ·Lap Pong Cheung2
数据集下载地址(需要科学的上网)
link
我已经下好了的数据集和论文的下载链接,点这里
代码
import pandas as pd
import numpy as np
from sklearn.tree import DecisionTreeClassifier
from sklearn.tree import export_graphviz
# 读取指定列索引字段的数据
# usedclos=['original', 'attempt_count','ms_first_response','answer_text','assistment_id','type','hint_count','hint_total',
# 'overlap_time','first_action','opportunity','tutor_mode','correct']
usedclos=['original', 'attempt_count','ms_first_response','assistment_id','hint_count','hint_total',
'overlap_time','first_action','opportunity','correct']
csv_data = pd.read_csv("./skill_builder_data.csv", usecols=usedclos,encoding='utf-8')
print(csv_data.columns)
Y=csv_data['correct']
#删除correct列
del csv_data['correct']
print(csv_data.columns)
X=csv_data
feature =csv_data.columns
classname =['incorrect','correct']
#max_depth是最大层数
tree_clf = DecisionTreeClassifier(max_depth=4)
tree_clf.fit(X, Y)
export_graphviz(
tree_clf,
out_file=("DecisionTreeClassifier.dot"),
feature_names=feature,
class_names=classname,
rounded=True,
filled=True,
)
print('成功!')
'''
apt-get install graphviz
生成决策树的命令
dot -Tpng DecisionTreeClassifier.dot -o 123.png
'''
实现结果
本博客所有文章除特别声明外,均采用 CC BY 4.0 CN协议 许可协议。转载请注明出处!