class_docstr: LogisticRegression is a linear model that is used to model probability of
  occurrence of certain events, for example probability of success or fail of
  an event.
  
  cuML's dask Logistic Regression (multi-node multi-gpu) expects dask cuDF
  DataFrame and provides an algorithms, L-BFGS, to fit the logistic model. It
  currently supports single class, l2 regularization, and sigmoid loss.
  
  Note that, just like in Scikit-learn, the bias will not be regularized.
  
  Examples
  --------
  
  .. code-block:: python
  
      >>> from dask_cuda import LocalCUDACluster
      >>> from dask.distributed import Client
      >>> import dask_cudf
      >>> import cudf
      >>> import numpy as np
      >>> from cuml.dask.linear_model import LogisticRegression
  
      >>> cluster = LocalCUDACluster(CUDA_VISIBLE_DEVICES="0,1")
      >>> client = Client(cluster)
  
      >>> X = cudf.DataFrame()
      >>> X['col1'] = np.array([1,1,2,2], dtype = np.float32)
      >>> X['col2'] = np.array([1,2,2,3], dtype = np.float32)
      >>> y = cudf.Series(np.array([0.0, 0.0, 1.0, 1.0], dtype=np.float32))
  
      >>> X_ddf = dask_cudf.from_cudf(X, npartitions=2)
      >>> y_ddf = dask_cudf.from_cudf(y, npartitions=2)
  
      >>> reg = LogisticRegression()
      >>> reg.fit(X_ddf, y_ddf)
      LogisticRegression()
  
      >>> print(reg.coef_)
               0         1
      0  0.69861  0.570058
      >>> print(reg.intercept_)
      0   -2.188068
      dtype: float32
  
      >>> X_new = cudf.DataFrame()
      >>> X_new['col1'] = np.array([1,5], dtype = np.float32)
      >>> X_new['col2'] = np.array([2,5], dtype = np.float32)
      >>> X_new_ddf = dask_cudf.from_cudf(X_new, npartitions=2)
      >>> preds = reg.predict(X_new_ddf)
  
      >>> print(preds.compute())
      0    0.0
      1    1.0
      dtype: float32
  
  Parameters
  ----------
  tol : float (default = 1e-4)
      Tolerance for stopping criteria.
      The exact stopping conditions depend on the L-BFGS solver.
      Check the solver's documentation for more details:
  
        * :class:`Quasi-Newton (L-BFGS)<cuml.QN>`
  
  C : float (default = 1.0)
      Inverse of regularization strength; must be a positive float.
  fit_intercept : boolean (default = True)
      If True, the model tries to correct for the global mean of y.
      If False, the model expects that you have centered the data.
  max_iter : int (default = 1000)
      Maximum number of iterations taken for the solvers to converge.
  linesearch_max_iter : int (default = 50)
      Max number of linesearch iterations per outer iteration used in the
      solver.
  verbose : int or boolean, default=False
      Sets logging level. It must be one of `cuml.common.logger.level_*`.
      See :ref:`verbosity-levels` for more info.
  output_type : {'input', 'array', 'dataframe', 'series', 'df_obj',         'numba', 'cupy', 'numpy', 'cudf', 'pandas'}, default=None
      Return results and set estimator attributes to the indicated output
      type. If None, the output type set at the module level
      (`cuml.global_settings.output_type`) will be used. See
      :ref:`output-data-type-configuration` for more info.
  
  Attributes
  ----------
  coef_: dev array, dim (n_classes, n_features) or (n_classes, n_features+1)
      The estimated coefficients for the linear regression model.
  intercept_: device array (n_classes, 1)
      The independent term. If `fit_intercept` is False, will be 0.
  
  Notes
  -----
  cuML's LogisticRegression uses a different solver that the equivalent
  Scikit-learn, except when there is no penalty and `solver=lbfgs` is
  used in Scikit-learn. This can cause (smaller) differences in the
  coefficients and predictions of the model, similar to
  using different solvers in Scikit-learn.
  
  For additional information, see `Scikit-learn's LogisticRegression
  <https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html>`_.
class_docstr_tok: ["LogisticRegression","is","a","linear","model","that","is","used","to","model","probability","of","occurrence","of","certain","events",",","for","example","probability","of","success","or","fail","of","an","event",".","cuML","'s","dask","Logistic","Regression","(","multi-node","multi-gpu",")","expects","dask","cuDF","DataFrame","and","provides","an","algorithms",",","L-BFGS",",","to","fit","the","logistic","model",".","It","currently","supports","single","class",",","l2","regularization",",","and","sigmoid","loss",".","Note","that",",","just","like","in","Scikit-learn",",","the","bias","will","not","be","regularized",".","Examples","--","--","--","--","..","code-block",":",":","python",">",">",">","from","dask_cuda","import","LocalCUDACluster",">",">",">","from","dask.distributed","import","Client",">",">",">","import","dask_cudf",">",">",">","import","cudf",">",">",">","import","numpy","as","np",">",">",">","from","cuml.dask.linear_model","import","LogisticRegression",">",">",">","cluster","=","LocalCUDACluster","(","CUDA_VISIBLE_DEVICES=","''","0,1","''",")",">",">",">","client","=","Client","(","cluster",")",">",">",">","X","=","cudf.DataFrame","(",")",">",">",">","X","[","'col1","'","]","=","np.array","(","[","1,1,2,2","]",",","dtype","=","np.float32",")",">",">",">","X","[","'col2","'","]","=","np.array","(","[","1,2,2,3","]",",","dtype","=","np.float32",")",">",">",">","y","=","cudf.Series","(","np.array","(","[","0.0",",","0.0",",","1.0",",","1.0","]",",","dtype=np.float32",")",")",">",">",">","X_ddf","=","dask_cudf.from_cudf","(","X",",","npartitions=2",")",">",">",">","y_ddf","=","dask_cudf.from_cudf","(","y",",","npartitions=2",")",">",">",">","reg","=","LogisticRegression","(",")",">",">",">","reg.fit","(","X_ddf",",","y_ddf",")","LogisticRegression","(",")",">",">",">","print","(","reg.coef_",")","0","1","0","0.69861","0.570058",">",">",">","print","(","reg.intercept_",")","0","-2.188068","dtype",":","float32",">",">",">","X_new","=","cudf.DataFrame","(",")",">",">",">","X_new","[","'col1","'","]","=","np.array","(","[","1,5","]",",","dtype","=","np.float32",")",">",">",">","X_new","[","'col2","'","]","=","np.array","(","[","2,5","]",",","dtype","=","np.float32",")",">",">",">","X_new_ddf","=","dask_cudf.from_cudf","(","X_new",",","npartitions=2",")",">",">",">","preds","=","reg.predict","(","X_new_ddf",")",">",">",">","print","(","preds.compute","(",")",")","0","0.0","1","1.0","dtype",":","float32","Parameters","--","--","--","--","--","tol",":","float","(","default","=","1e-4",")","Tolerance","for","stopping","criteria",".","The","exact","stopping","conditions","depend","on","the","L-BFGS","solver",".","Check","the","solver","'s","documentation","for","more","details",":","*",":","class",":","`","Quasi-Newton","(","L-BFGS",")","<","cuml.QN",">","`","C",":","float","(","default","=","1.0",")","Inverse","of","regularization","strength",";","must","be","a","positive","float",".","fit_intercept",":","boolean","(","default","=","True",")","If","True",",","the","model","tries","to","correct","for","the","global","mean","of","y",".","If","False",",","the","model","expects","that","you","have","centered","the","data",".","max_iter",":","int","(","default","=","1000",")","Maximum","number","of","iterations","taken","for","the","solvers","to","converge",".","linesearch_max_iter",":","int","(","default","=","50",")","Max","number","of","linesearch","iterations","per","outer","iteration","used","in","the","solver",".","verbose",":","int","or","boolean",",","default=False","Sets","logging","level",".","It","must","be","one","of","`","cuml.common.logger.level_","*","`",".","See",":","ref",":","`","verbosity-levels","`","for","more","info",".","output_type",":","{","'input","'",",","'array","'",",","'dataframe","'",",","'series","'",",","'df_obj","'",",","'numba","'",",","'cupy","'",",","'numpy","'",",","'cudf","'",",","'pandas","'","}",",","default=None","Return","results","and","set","estimator","attributes","to","the","indicated","output","type",".","If","None",",","the","output","type","set","at","the","module","level","(","`","cuml.global_settings.output_type","`",")","will","be","used",".","See",":","ref",":","`","output-data-type-configuration","`","for","more","info",".","Attributes","--","--","--","--","--","coef_",":","dev","array",",","dim","(","n_classes",",","n_features",")","or","(","n_classes",",","n_features+1",")","The","estimated","coefficients","for","the","linear","regression","model",".","intercept_",":","device","array","(","n_classes",",","1",")","The","independent","term",".","If","`","fit_intercept","`","is","False",",","will","be","0",".","Notes","--","--","-","cuML","'s","LogisticRegression","uses","a","different","solver","that","the","equivalent","Scikit-learn",",","except","when","there","is","no","penalty","and","`","solver=lbfgs","`","is","used","in","Scikit-learn",".","This","can","cause","(","smaller",")","differences","in","the","coefficients","and","predictions","of","the","model",",","similar","to","using","different","solvers","in","Scikit-learn",".","For","additional","information",",","see","`","Scikit-learn","'s","LogisticRegression","<","https",":","\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.linear_model.LogisticRegression.html",">","`","_","."]
code: def __init__(self, **kwargs):
      super().__init__(**kwargs)
  
file_path: cuml/python/cuml/dask/linear_model/logistic_regression.py
imports: from cuml.dask.common.base import BaseEstimator
  from cuml.dask.common.base import DelayedPredictionMixin
  from cuml.dask.common.base import mnmg_import
  from cuml.dask.common.base import SyncFitMixinLinearModel
  from cuml.dask.linear_model import LinearRegression
  from raft_dask.common.comms import get_raft_comm_state
  from dask.distributed import get_worker
  from cuml.common.sparse_utils import is_sparse, has_scipy
  from cuml.dask.common import parts_to_ranks
  from cuml.dask.common.input_utils import DistributedDataHandler, concatenate
  from raft_dask.common.comms import Comms
  from cuml.dask.common.utils import wait_and_raise_from_futures
  from cuml.internals.safe_imports import cpu_only_import
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 1 to create a new LogisticRegression object from inherited base classes: LinearRegression with example: obj = LogisticRegression()