title: How to use SMAPE evaluation metric on train dataset?
body: <p>I am using SMAPE (Symmetric mean absolute percentage error) evaluation metric. </p>
  
  <p>Formula: <a href="https://en.wikipedia.org/wiki/Symmetric_mean_absolute_percentage_error" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Symmetric_mean_absolute_percentage_error</a></p>
  
  <pre><code>def smape(A, F):
      return 100/len(A) * np.sum(2 * np.abs(F - A) / (np.abs(A) + np.abs(F)))
  </code></pre>
  
  <p>I am using above function for calculating SMAPE.</p>
  
  <p>Now I am trying to evaluate my model using SMAPE above code but I am not able to understand how to use it on train dataset for evaluation and then predict values for test dataset.</p>
  
  <p>My code:</p>
  
  <pre><code>from sklearn.ensemble import RandomForestRegressor
  from sklearn.model_selection import train_test_split
  from sklearn.preprocessing import StandardScaler
  
  # Train and test data split 70-30 
  X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)
  
  # Establish model
  model = RandomForestRegressor(n_jobs=-1)
  
  model.fit(X_train, y_train)
  </code></pre>
  
  <p>Now how to use SMAPE with above randomforest regressor ? Should I use <code>model.score</code> i.e <code>model.score(X_test, y_test)</code> or <code>model.smape(X_test, y_test)</code></p>
  
  <p>If I use <code>model.score(X_test, y_test)</code> I am getting <code>-0.4678402626438</code> score. Please suggest me how to use SMAPE metric with my random forest regressor model.</p>