📅  最后修改于: 2022-03-11 14:46:18.048000             🧑  作者: Mango
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
hashdata = pd.read_csv("filename.csv")
X = hashdata.drop(columns=["output_column_name"])
y = hashdata.drop(columns=["input_column_name"])
model=DecisionTreeClassifier()
model.fit(X,y)
predictions=model.predict([[input]])
print(predictions)