title: Can we create custom Estimators
body: <p>I want to create my own Estimator for Spark ml pipeline purpose so that I can use my own custom business logic.</p>
  <p>If any one can guide me in this using Java will be very helpful.</p>
  <p><strong>Update:</strong> <br>
  I created one Estimator after Matt suggestion but not sure I am doing in proper way or not please suggest.<br></p>
  <pre><code>public class CustomPredictors extends Predictor&lt;Vector, LogisticRegression, LogisticRegressionModel&gt; {
  
      private static final long serialVersionUID = -6860916159403147252L;
      
      private String uid;
  
      public String getUid() {
          if(uid==null) {
              uid=Identifiable.randomUID(&quot;CustomPredictors&quot;);
          }
          return uid;
      }
  
      @Override
      public String uid() {
          return getUid();
      }
  
      public static MLReader&lt;CustomPredictors&gt; read() {
          return new DefaultParamsReader&lt;&gt;();
      }
  
      @Override
      public LogisticRegression copy(ParamMap extra) {
          return defaultCopy(extra);
      }
  
      @Override
      public LogisticRegressionModel train(Dataset&lt;?&gt; dataset) {
          System.out.println(&quot;CustomPredictors&quot;);
          //TODO put business logic
          return null;
      }   
  }
  </code></pre>