-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when i use the code, the print is always the iris.data' result although i change the data. #5
Comments
Have you used iris dataset in above code ? Does /Users/lee/Desktop/data-xy015.csv refer to iris dataset ? |
Hi shreevaths1, I didn't use the iris dataset. "/Users/lee/Desktop/data-xy015.csv" is about my experiment data. import pandas as pd class MyDecisionTree:
def importdata(): def splitdataset(balance_data): def train_using_gini(X_train, X_test, y_train): def prediction(X_test, clf_object): def cal_accuracy(y_test, y_pred): def build_decision_tree(X, clf_object): def main(): if name == "main": |
Hi ChawlaAvi, when i use the code, the print is always the iris.data' result although i change the data.
`import pandas as pd
import numpy as np
import interactive_decision_tree as idt ## local module
from sklearn.tree import DecisionTreeClassifier
data = pd.read_csv('/Users/lee/Desktop/data-xy015.csv')
X = data.iloc[:, 0:31]
y = data.iloc[:, 38]
clf = DecisionTreeClassifier()
clf = clf.fit(X, y)
idt.create_tree(tree_model=clf,
X=X,
target_names=np.unique(y),
save_path='C:/Users/lee/Desktop/PY01/tree_template.html')
idt.create_sankey(tree_model=clf,
X=X,
target_names=np.unique(y),
save_path='C:/Users/lee/Desktop/PY01/sankey_template.html')
`
The text was updated successfully, but these errors were encountered: