精华内容
下载资源
问答
  • python逻辑回归模型.zip

    2020-09-15 15:32:23
    python逻辑回归模型
  • python 逻辑回归 Python中的逻辑回归-局限性 (Logistic Regression in Python - Limitations) Advertisements 广告 Previous Page 上一页 Next Page 下一页 As you have seen from the above example,...
    python 逻辑回归

    python 逻辑回归

    Python中的逻辑回归-局限性 (Logistic Regression in Python - Limitations)

    As you have seen from the above example, applying logistic regression for machine learning is not a difficult task. However, it comes with its own limitations. The logistic regression will not be able to handle a large number of categorical features. In the example we have discussed so far, we reduced the number of features to a very large extent.

    从上面的示例中可以看出,将逻辑回归应用于机器学习并不是一项艰巨的任务。 但是,它有其自身的局限性。 逻辑回归将无法处理大量分类特征。 在到目前为止讨论的示例中,我们在很大程度上减少了特征数量。

    However, if these features were important in our prediction, we would have been forced to include them, but then the logistic regression would fail to give us a good accuracy. Logistic regression is also vulnerable to overfitting. It cannot be applied to a non-linear problem. It will perform poorly with independent variables which are not correlated to the target and are correlated to each other. Thus, you will have to carefully evaluate the suitability of logistic regression to the problem that you are trying to solve.

    但是,如果这些功能在我们的预测中很重要,我们将不得不将它们包括在内,但是逻辑回归将无法为我们提供良好的准确性。 Logistic回归也容易过拟合。 它不能应用于非线性问题。 在与目标不相关且彼此相关的自变量下,其性能会很差。 因此,您将必须仔细评估逻辑回归对您要解决的问题的适用性。

    There are many areas of machine learning where other techniques are specified devised. To name a few, we have algorithms such as k-nearest neighbours (kNN), Linear Regression, Support Vector Machines (SVM), Decision Trees, Naive Bayes, and so on. Before finalizing on a particular model, you will have to evaluate the applicability of these various techniques to the problem that we are trying to solve.

    在机器学习的许多领域中,还设计了其他技术。 仅举几例,我们有算法,例如k最近邻(kNN),线性回归,支持向量机(SVM),决策树,朴素贝叶斯等等。 在最终确定特定模型之前,您必须评估这些各种技术对我们要解决的问题的适用性。

    翻译自: https://www.tutorialspoint.com/logistic_regression_in_python/logistic_regression_in_python_limitations.htm

    python 逻辑回归

    展开全文
  • python 逻辑回归 Python中的逻辑回归-摘要 (Logistic Regression in Python - Summary) Advertisements 广告 Previous Page 上一页 Next Page 下一页 Logistic Regression is a statistical technique...
    python 逻辑回归

    python 逻辑回归

    Python中的逻辑回归-摘要 (Logistic Regression in Python - Summary)

    Logistic Regression is a statistical technique of binary classification. In this tutorial, you learned how to train the machine to use logistic regression. Creating machine learning models, the most important requirement is the availability of the data. Without adequate and relevant data, you cannot simply make the machine to learn.

    Logistic回归是二进制分类的一种统计技术。 在本教程中,您学习了如何训练机器以使用逻辑回归。 创建机器学习模型时,最重要的要求是数据的可用性。 没有足够的相关数据,您将无法简单地学习机器。

    Once you have data, your next major task is cleansing the data, eliminating the unwanted rows, fields, and select the appropriate fields for your model development. After this is done, you need to map the data into a format required by the classifier for its training. Thus, the data preparation is a major task in any machine learning application. Once you are ready with the data, you can select a particular type of classifier.

    拥有数据后,下一个主要任务是清除数据,消除不需要的行,字段,并为模型开发选择适当的字段。 完成此操作后,您需要将数据映射为分类器训练所需的格式。 因此,数据准备是任何机器学习应用程序中的主要任务。 一旦准备好数据,就可以选择特定类型的分类器。

    In this tutorial, you learned how to use a logistic regression classifier provided in the sklearn library. To train the classifier, we use about 70% of the data for training the model. We use the rest of the data for testing. We test the accuracy of the model. If this is not within acceptable limits, we go back to selecting the new set of features.

    在本教程中,您学习了如何使用sklearn库中提供的逻辑回归分类器。 为了训练分类器,我们使用大约70%的数据来训练模型。 我们将其余数据用于测试。 我们测试模型的准确性。 如果这不在可接受的范围内,我们将返回选择新的功能集。

    Once again, follow the entire process of preparing data, train the model, and test it, until you are satisfied with its accuracy. Before taking up any machine learning project, you must learn and have exposure to a wide variety of techniques which have been developed so far and which have been applied successfully in the industry.

    再一次,遵循准备数据,训练模型和测试的整个过程,直到您对它的准确性感到满意为止。 在进行任何机器学习项目之前,您必须学习并接触到目前为止已经开发并且已经在行业中成功应用的多种技术。

    翻译自: https://www.tutorialspoint.com/logistic_regression_in_python/logistic_regression_in_python_summary.htm

    python 逻辑回归

    展开全文
  • python 逻辑回归 Python中的逻辑回归-测试 (Logistic Regression in Python - Testing) Advertisements 广告 Previous Page 上一页 Next Page 下一页 We need to test the above created classifier ...
    python 逻辑回归

    python 逻辑回归

    Python中的逻辑回归-测试 (Logistic Regression in Python - Testing)

    We need to test the above created classifier before we put it into production use. If the testing reveals that the model does not meet the desired accuracy, we will have to go back in the above process, select another set of features (data fields), build the model again, and test it. This will be an iterative step until the classifier meets your requirement of desired accuracy. So let us test our classifier.

    在投入生产使用之前,我们需要测试上面创建的分类器。 如果测试表明模型不符合期望的精度,我们将不得不返回上述过程,选择另一组特征(数据字段),再次构建模型并进行测试。 这将是一个迭代步骤,直到分类器满足您的所需精度要求为止。 因此,让我们测试分类器。

    预测测试数据 (Predicting Test Data)

    To test the classifier, we use the test data generated in the earlier stage. We call the predict method on the created object and pass the X array of the test data as shown in the following command −

    为了测试分类器,我们使用在较早阶段生成的测试数据。 我们在创建的对象上调用预报方法,并传递测试数据的X数组,如以下命令所示-

    
    In [24]: predicted_y = classifier.predict(X_test)
    
    

    This generates a single dimensional array for the entire training data set giving the prediction for each row in the X array. You can examine this array by using the following command −

    这将为整个训练数据集生成一维数组,从而为X数组中的每一行提供预测。 您可以使用以下命令检查此数组-

    
    In [25]: predicted_y
    
    

    The following is the output upon the execution the above two commands −

    以下是执行以上两个命令后的输出-

    
    Out[25]: array([0, 0, 0, ..., 0, 0, 0])
    
    

    The output indicates that the first and last three customers are not the potential candidates for the Term Deposit. You can examine the entire array to sort out the potential customers. To do so, use the following Python code snippet −

    输出表明前三个客户不是定期存款的潜在候选人。 您可以检查整个阵列以找出潜在客户。 为此,请使用以下Python代码段-

    
    In [26]: for x in range(len(predicted_y)):
       if (predicted_y[x] == 1):
          print(x, end="\t")
    
    

    The output of running the above code is shown below −

    运行上面的代码的输出如下所示-

    Term Deposit

    The output shows the indexes of all rows who are probable candidates for subscribing to TD. You can now give this output to the bank’s marketing team who would pick up the contact details for each customer in the selected row and proceed with their job.

    输出显示所有可能预订TD的行的索引。 现在,您可以将此输出提供给银行的营销团队,该团队将为选定行中的每个客户选择详细联系信息,然后继续他们的工作。

    Before we put this model into production, we need to verify the accuracy of prediction.

    在将此模型投入生产之前,我们需要验证预测的准确性。

    验证准确性 (Verifying Accuracy)

    To test the accuracy of the model, use the score method on the classifier as shown below −

    要测试模型的准确性,请在分类器上使用评分方法,如下所示-

    
    In [27]: print('Accuracy: {:.2f}'.format(classifier.score(X_test, Y_test)))
    
    

    The screen output of running this command is shown below −

    运行此命令的屏幕输出如下所示-

    
    Accuracy: 0.90
    
    

    It shows that the accuracy of our model is 90% which is considered very good in most of the applications. Thus, no further tuning is required. Now, our customer is ready to run the next campaign, get the list of potential customers and chase them for opening the TD with a probable high rate of success.

    它表明我们模型的精度为90%,在大多数应用中被认为是非常好的。 因此,不需要进一步的调整。 现在,我们的客户已准备好进行下一个广告系列,获取潜在客户列表,并追逐他们以可能的高成功率打开TD。

    翻译自: https://www.tutorialspoint.com/logistic_regression_in_python/logistic_regression_in_python_testing.htm

    python 逻辑回归

    展开全文
  • python 逻辑回归案例 Python中的逻辑回归-案例研究 (Logistic Regression in Python - Case Study) Advertisements 广告 Previous Page 上一页 Next Page 下一页 Consider that a bank approaches you...
    python 逻辑回归案例

    python 逻辑回归案例

    Python中的逻辑回归-案例研究 (Logistic Regression in Python - Case Study)

    Consider that a bank approaches you to develop a machine learning application that will help them in identifying the potential clients who would open a Term Deposit (also called Fixed Deposit by some banks) with them. The bank regularly conducts a survey by means of telephonic calls or web forms to collect information about the potential clients. The survey is general in nature and is conducted over a very large audience out of which many may not be interested in dealing with this bank itself. Out of the rest, only a few may be interested in opening a Term Deposit. Others may be interested in other facilities offered by the bank. So the survey is not necessarily conducted for identifying the customers opening TDs. Your task is to identify all those customers with high probability of opening TD from the humongous survey data that the bank is going to share with you.

    考虑到一家银行会与您联系,开发一种机器学习应用程序,这将帮助他们确定可能与他们一起开立定期存款(某些银行也称为定期存款)的潜在客户。 银行定期通过电话或网络表格进行调查,以收集有关潜在客户的信息。 该调查本质上是一般性的,针对的受众非常广泛,其中许多人可能不愿与该银行本身打交道。 在其余的帐户中,只有少数几个有兴趣开设定期存款。 其他人可能会对银行提供的其他服务感兴趣。 因此,不一定需要进行调查来识别开通TD的客户。 您的任务是从银行将与您共享的庞大调查数据中识别出所有可能开通TD的客户。

    Fortunately, one such kind of data is publicly available for those aspiring to develop machine learning models. This data was prepared by some students at UC Irvine with external funding. The database is available as a part of UCI Machine Learning Repository and is widely used by students, educators, and researchers all over the world. The data can be downloaded from here.

    幸运的是,有这样一种数据可供有志开发机器学习模型的人使用。 该数据是由加州大学欧文分校的一些学生在外部资助下准备的。 该数据库可作为UCI机器学习存储库的一部分获得,并被全世界的学生,教育者和研究人员广泛使用。 数据可以从这里下载。

    In the next chapters, let us now perform the application development using the same data.

    在下一章中,让我们现在使用相同的数据执行应用程序开发。

    翻译自: https://www.tutorialspoint.com/logistic_regression_in_python/logistic_regression_in_python_case_study.htm

    python 逻辑回归案例

    展开全文
  • python 逻辑回归

    2017-12-09 20:54:38
    逻辑回归模型所做的假设是: 相应的决策函数为: y=1,if P(y=1|x)>0.5 (实际应用时特定的情况可以选择不同阈值,如果对正例的判别准确性要求高,可以选择阈值大一些,对正例的召回要求高,则可以选择阈值小一些) ...
  • python逻辑回归

    千次阅读 2018-06-25 16:28:01
    逻辑回归的概念 逻辑回归是大数据技术的机器学习一种方法,它借助对某个事件的历史数据结果进行分析,从而预测某个事件未来发生的概率,是一种概率型非线性回归。其中概率取值只有“是”和“否”两种可能,并分别记...
  • Python逻辑回归

    千次阅读 2016-11-20 21:43:00
    介绍 回归分析是确定预测属性(数值型)与其他变量间相互依赖的定量关系最常用的统计学方法。 逻辑回归是概率型非线性回归,有2分类和多分类。2分类就是y的取值为0,1 即是 或 否 。
  • 本文介绍回归模型的原理知识,包括线性回归、多项式回归和逻辑回归,并详细介绍Python Sklearn机器学习库的LinearRegression和LogisticRegression算法及回归分析实例。进入基础文章,希望对您有所帮助。
  • 学完线性回归,逻辑回归建模+评估模型的过程就相对好理解很多。其实就是换汤不换药。逻辑回归不是回归算法,而是分类算法,准确来说,叫逻辑分类逻辑分类本质上是二分分类,即分类结果标签只有两个逻辑回归建模-评估...
  • 本文首先介绍这两种方法的区别和联系,然后对分类方法中逻辑回归的用法进行较详细的说明(包括其基本原理及评估指标),最后结合案例介绍如何利用Python进行逻辑回归分析。一、分类与回归1.1什么是分类和回归回归...
  • 主要介绍了Python利用逻辑回归模型解决MNIST手写数字识别问题,结合实例形式详细分析Python MNIST手写识别问题原理及逻辑回归模型解决MNIST手写识别问题相关操作技巧,需要的朋友可以参考下
  • python建立逻辑回归模型

    千次阅读 2018-11-18 21:57:32
    利用Scikit-Learn对数据进行逻辑回归分析 ...表现在随机逻辑回归模型上(书上程序中使用的) 对训练数据进行多次采样拟合回归模型,即在不同的数据子集和特征子集上运行特征算法,不断重复,最终选择得分高的重要...
  • 逻辑回归(Logistic Regression)是机器学习中的一种分类模型逻辑回归是一种分类算法,虽然名字中带有回归,但是它与回归之间有一定的联系。由于算法的简单和高效,在实际中应用非常广泛。 广告点击率 是否为垃圾...
  • 面对不同类型、偏好的消费者以及他们之前的消费数据作为基础,利用逻辑回归算法和随机森林回归算法构建模型,在已知数据的基础上进行拟合和调试,得出最优化的规律,并根据这一规律预测消费者的动机,此项研究在编程...
  • python 逻辑回归 程序解析

    千次阅读 2015-08-17 15:22:32
    python《机器学习实战》逻辑回归部分,用全部样本多次进行梯度上升的程序如下: # coding=utf-8 __author__ = 'Administrator' from numpy import * #从文本中加载数据,文档中保存了100个坐标为X,Y的数据 def ...
  • [Python] 逻辑回归分析

    千次阅读 2018-06-10 11:57:57
    数据示例 ...建立模型:利用筛选后的特征建立逻辑回归模型 输出平均正确率 实现代码 #-*- coding: utf-8 -*- #逻辑回归 自动建模 import pandas as pd #参数初始化 filename = '../data/ban...
  • Python逻辑回归实现多分类

    千次阅读 2019-07-11 10:19:59
    多分类介绍 多分类由二分类问题推广而来,我们可以把N分类问题分解为N个2分类问题。下面我们用代码实现一个简单三分类问题,其中y为n行3列的矩阵,其中0表示不属于该类1表示属于该类。代码中用到的矩阵乘法,不会的...
  • 6、python逻辑回归代码案例实现

    千次阅读 2018-12-11 10:09:46
    逻辑回归(Logistic Regression)  针对因变量为分类变量而进行回归分析的一种统计方法,属于概率性非线性回归。    优点:算法容易实现和部署,执行效率和准确度高。    缺点:离散类型的自变量数据需要通过...
  • Python实现逻辑回归

    千次阅读 2016-03-19 21:13:49
    Python实现逻辑回归
  • #逻辑回归 自动建模 import numpy as np import pandas as pd from sklearn.linear_model import LogisticRegression as LR from sklearn.linear_model import RandomizedLogisticRegression ...
  • 这是我的多分类回归代码: <p><img alt="" height="297" src="https://img-ask.csdnimg.cn/upload/1615361942036.png" width="559" /></p> 三分类模型,得到了三个不同的回归系数和截距   我用了...
  • 逻辑回归 pythonClassification techniques are an essential part of machine learning and data science applications. Approximately 70% of problems in machine learning are classification problems. There ...
  • 问题: ...(4)逻辑回归模型预测,以及最终的评估 另外还有很多需要注意的,比如数据处理,缺失值异常值的怎样处理,等等 下面开始一步步进行实现 首先导入在整个过程中需要用到的模块 import pandas...
  • #用训练好的模型在测试集上进行评分(0~1)1代表最好 print(clf.score(X_test,y_test))
  • 文章目录逻辑回归优缺点sigmoid 函数逻辑回归模型的数学推导Python 实现逻辑回归定义模型参数初始化函数:模型主体部分定义基于梯度下降的参数更新训练过程:定义对测试数据的预测函数:模型训练和测试:对数据进行...
  • 商业背景:随着三大运营商和民营企业的迅猛发展,移动市场竞争激烈,市场日趋饱和,...本案例只展示核心步骤及相关代码,使用工具为Python,主要算法和技术为LR、RandomForest、交叉验证法、网格搜索调优参数。 ...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 35,749
精华内容 14,299
关键字:

python逻辑回归模型

python 订阅