docstr: Performs a greedy linear search - moves the continuous features in CFs towards original values in
  query_instance greedily until the prediction class changes, or it reaches the maximum number of steps
code: def do_linear_search(
      self,
      diff,
      decimal_prec,
      query_instance,
      cf_ix,
      feature,
      final_cfs_sparse,
      current_pred_orig,
      limit_steps_ls,
  ):
      """Performs a greedy linear search - moves the continuous features in CFs towards original values in
      query_instance greedily until the prediction class changes, or it reaches the maximum number of steps
      """
  
      old_diff = diff
      change = (
          10 ** -decimal_prec[feature]
      )  # the minimal possible change for a feature
      current_pred = current_pred_orig
      count_steps = 0
      if self.model.model_type == ModelTypes.Classifier:
          while (
              (abs(diff) > 10e-4)
              and (np.sign(diff * old_diff) > 0)
              and self.is_cf_valid(current_pred)
          ) and (count_steps < limit_steps_ls):
              old_val = final_cfs_sparse.at[cf_ix, feature]
              final_cfs_sparse.at[cf_ix, feature] += (
                  np.sign(diff) * change
              )
              current_pred = self.predict_fn_for_sparsity(
                  final_cfs_sparse.loc[[cf_ix]][
                      self.data_interface.feature_names
                  ]
              )
              old_diff = diff
  
              if not self.is_cf_valid(current_pred):
                  final_cfs_sparse.at[cf_ix, feature] = old_val
                  return final_cfs_sparse
  
              diff = (
                  query_instance[feature].iat[0]
                  - final_cfs_sparse.at[cf_ix, feature]
              )
  
              count_steps += 1
  
      return final_cfs_sparse
  
imports: import pickle
  from abc import ABC, abstractmethod
  from collections.abc import Iterable
  from typing import Any, List
  import numpy
  import pandas
  from raiutils.exceptions import UserConfigValidationException
  from sklearn.neighbors import KDTree
  from tqdm import tqdm
  from dice_ml.constants import ModelTypes, _PostHocSparsityTypes
  from dice_ml.counterfactual_explanations import CounterfactualExplanations
label_desc: Use image node_id 14 for calling the ExplainerBase obj's underlying member method code with example usage: obj.do_linear_search(diff, decimal_prec, query_instance, cf_ix, feature, final_cfs_sparse, current_pred_orig, limit_steps_ls) and returns: final_cfs_sparse, final_cfs_sparse