|
3 | 3 | { |
4 | 4 | "cell_type": "markdown", |
5 | 5 | "id": "1e8f20b9-a562-4dac-9a57-e887e9372651", |
6 | | - "metadata": {}, |
| 6 | + "metadata": { |
| 7 | + "editable": true, |
| 8 | + "slideshow": { |
| 9 | + "slide_type": "" |
| 10 | + }, |
| 11 | + "tags": [] |
| 12 | + }, |
7 | 13 | "source": [ |
8 | 14 | "(ch_linear_models)=\n", |
9 | 15 | "# Common Algorithms II - Linear Models\n", |
|
521 | 527 | { |
522 | 528 | "cell_type": "markdown", |
523 | 529 | "id": "7449485c-b8a1-4b0b-8147-e910cedd2dd2", |
524 | | - "metadata": {}, |
| 530 | + "metadata": { |
| 531 | + "editable": true, |
| 532 | + "slideshow": { |
| 533 | + "slide_type": "" |
| 534 | + }, |
| 535 | + "tags": [] |
| 536 | + }, |
525 | 537 | "source": [ |
526 | 538 | "## Logistic Regression\n", |
527 | 539 | "Logistic regression, despite its name, is not used for regression tasks. Instead, it is a classification algorithm, primarily used when the dependent variable is binary or categorical. It is a powerful statistical method used to model the probability of a certain class or event existing. Like linear regression, logistic regression models the relationship between a set of independent variables and a dependent variable. However, instead of fitting a line to the data, it uses a logistic function to output a probability value that is used for classification.\n", |
|
545 | 557 | "\n", |
546 | 558 | "$$\n", |
547 | 559 | "P(y=1 ∣ x) = \\sigma(z) = \\frac{1}{1+e^{−(\\beta_0 + \\beta_1 x_1 + \\beta_2 x_2 + ... + \\beta_n x_n)}}\n", |
548 | | - "$$" |
| 560 | + "$$\n" |
549 | 561 | ] |
550 | 562 | }, |
551 | 563 | { |
552 | 564 | "cell_type": "markdown", |
553 | 565 | "id": "ca77c983-394d-45cf-8d75-cdc5983ab2ef", |
554 | | - "metadata": {}, |
| 566 | + "metadata": { |
| 567 | + "editable": true, |
| 568 | + "slideshow": { |
| 569 | + "slide_type": "" |
| 570 | + }, |
| 571 | + "tags": [] |
| 572 | + }, |
555 | 573 | "source": [ |
556 | 574 | "### Decision Boundary\n", |
557 | 575 | "\n", |
|
573 | 591 | { |
574 | 592 | "cell_type": "markdown", |
575 | 593 | "id": "1111984d-e34a-4d53-8eda-d0e29fa32f01", |
576 | | - "metadata": {}, |
| 594 | + "metadata": { |
| 595 | + "editable": true, |
| 596 | + "slideshow": { |
| 597 | + "slide_type": "" |
| 598 | + }, |
| 599 | + "tags": [] |
| 600 | + }, |
577 | 601 | "source": [ |
578 | 602 | "### Simple Example: Student Exam Results\n", |
579 | 603 | "\n", |
|
792 | 816 | { |
793 | 817 | "cell_type": "markdown", |
794 | 818 | "id": "c0030f29-00a3-4253-8e59-39018398b838", |
795 | | - "metadata": {}, |
| 819 | + "metadata": { |
| 820 | + "editable": true, |
| 821 | + "slideshow": { |
| 822 | + "slide_type": "" |
| 823 | + }, |
| 824 | + "tags": [] |
| 825 | + }, |
796 | 826 | "source": [ |
797 | 827 | "### Pros, Cons, Caveats\n", |
798 | 828 | "\n", |
799 | | - "#### Pros:\n", |
| 829 | + "**Pros:**\n", |
800 | 830 | "\n", |
801 | 831 | "- **Interpretability:** Logistic regression provides clear and interpretable coefficients that indicate the strength and direction of the relationship between independent variables and the dependent variable.\n", |
802 | 832 | "- **Efficiency:** It is computationally efficient and scales well with large datasets.\n", |
803 | 833 | "- **Probabilistic Outputs:** Provides probabilistic predictions, which can be useful for decision-making processes that incorporate uncertainty.\n", |
804 | 834 | "\n", |
805 | | - "#### Cons:\n", |
| 835 | + "**Cons:**\n", |
806 | 836 | "\n", |
807 | 837 | "- **Linearity Assumption:** Assumes a linear relationship between the independent variables and the log-odds of the dependent variable, which may not hold in all cases.\n", |
808 | 838 | "- **Not Suitable for Complex Relationships:** Logistic regression may not perform well when the relationship between the independent and dependent variables is highly complex and non-linear.\n", |
|
812 | 842 | { |
813 | 843 | "cell_type": "markdown", |
814 | 844 | "id": "c0c11fb1-e115-4f74-ae33-b1dae5a54d73", |
815 | | - "metadata": {}, |
| 845 | + "metadata": { |
| 846 | + "editable": true, |
| 847 | + "slideshow": { |
| 848 | + "slide_type": "" |
| 849 | + }, |
| 850 | + "tags": [] |
| 851 | + }, |
816 | 852 | "source": [ |
817 | 853 | "## Hands-on Example: Logistic Regression\n", |
818 | 854 | "\n", |
|
0 commit comments