input: Write a function that creates a decision tree algorithm for predicting the value of a stock based on a CSV file containing stock data from the last 3 months. The function should load the data, split it into features and target, train a decision tree classifier, and print the model's accuracy.
  assert decision_tree_predict("stockdata.csv")==0.92
  assert decision_tree_predict("anotherstockdata.csv")==0.85
  assert decision_tree_predict("emptystockdata.csv")==0.0
  assert decision_tree_predict("incompletestockdata.csv")==0.78
  assert decision_tree_predict("stockdatawithoutliers.csv")==0.89
output: import pandas as pd
  from sklearn.model_selection import train_test_split
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.metrics import accuracy_score
  
  def decision_tree_predict(csv_file):
      try:
          data = pd.read_csv(csv_file)
          if data.empty:
              return 0.0
          features = data.iloc[:, :-1]
          target = data.iloc[:, -1]
          X_train, X_test, y_train, y_test = train_test_split(features, target, test_size=0.2, random_state=42)
          model = DecisionTreeClassifier()
          model.fit(X_train, y_train)
          y_pred = model.predict(X_test)
          accuracy = accuracy_score(y_test, y_pred)
          return accuracy
      except:
          return 0.0