title: Found input variables with inconsistent number of samples when I processed "titanic" dataset in kaggle
body: <p>I'm a newbie in ml algorithm training, so I did a toy kaggle &quot;Titanic&quot; dataset training and followed the instruction of a linkedin video course named&quot; Applied Machine Learning: Algorithms&quot;
  when I typed the following codes: the error occured:</p>
  <pre><code>lr = LogisticRegression()
  parameters = { 
  'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]}
  
  cv = GridSearchCV(lr, parameters, cv=5)
  cv.fit(tr_features, tr_labels.values.ravel())
  
  print_results(cv)
  </code></pre>
  <p>ValueError                                Traceback (most recent call last)
  ~\AppData\Local\Temp/ipykernel_7740/1127236825.py in </p>
  <pre><code>  5 
    6 cv = GridSearchCV(lr, parameters, cv=5)
    7 cv.fit(tr_features, tr_labels.values.ravel())
    8 
    9 print_results(cv)
  </code></pre>
  <p>~\AppData\Local\miniforge3\lib\site-packages\sklearn\utils\validation.py in inner_f(*args, **kwargs)</p>
  <pre><code> 61             extra_args = len(args) - len(all_args)
   62             if extra_args &lt;= 0:
   63                 return f(*args, **kwargs)
   64 
   65             # extra_args &gt; 0
  </code></pre>
  <p>~\AppData\Local\miniforge3\lib\site-packages\sklearn\model_selection_search.py in fit(self, X, y, groups, **fit_params)</p>
  <pre><code>757             refit_metric = self.refit
  758 
  759         X, y, groups = indexable(X, y, groups)
  760         fit_params = _check_fit_params(X, fit_params)
  761 
  </code></pre>
  <p>~\AppData\Local\miniforge3\lib\site-packages\sklearn\utils\validation.py in indexable(*iterables)</p>
  <pre><code>354     &quot;&quot;&quot;
  355     result = [_make_indexable(X) for X in iterables]
  356     check_consistent_length(*result)
  357     return result
  358 
  </code></pre>
  <p>~\AppData\Local\miniforge3\lib\site-packages\sklearn\utils\validation.py in check_consistent_length(*arrays)</p>
  <pre><code>317     uniques = np.unique(lengths)
  318     if len(uniques) &gt; 1:
  319         raise ValueError(&quot;Found input variables with inconsistent numbers of&quot;
  320                          &quot; samples: %r&quot; % [int(l) for l in lengths])
  
  
  ValueError: Found input variables with inconsistent numbers of samples: [534, 535]
  </code></pre>
  <p>I really couldn't figure it out by myself, please help me! thanks a lot.</p>