title: Data Fitting and Prediction in Machine learning models
body: <p>In classification or Regression we need our model to learn from the input data(Training Data). Like for Example, finding best possible model parameter value (in linear Regression).</p>
  
  <p>While I was going through Classification Part in machine learning I met this code given below(a model to classify "Not-5" in MNIST Dataset): </p>
  
  <p>This code is from <a href="https://github.com/ageron/handson-ml" rel="nofollow noreferrer">Github-Aurelien Geron</a> handson-ml-master/03_Classification.ipynb</p>
  
  <pre><code>from sklearn.base import BaseEstimator
  class Never5Classifier(BaseEstimator):
  def fit(self, X, y=None): # fit the data
      pass
  def predict(self, X):
      print(X.shape)
      print(len(X))
      return np.zeros((len(X), 1), dtype=bool)
  </code></pre>
  
  <p>And below is the code to perform Cross validation on the model.</p>
  
  <pre><code>never_5_clf = Never5Classifier()
  
  cross_val_score(never_5_clf, X_train, y_train_5, cv=3, scoring="accuracy")
  </code></pre>
  
  <p>Well this is custom made model and so I want to know that how data is fitted (what Happens inside the black box). Although I came across many models, but there were some mathematical proof/way to determine the parameter value. </p>