-
- Notifications
You must be signed in to change notification settings - Fork 48.8k
added my code in 'machine_learning' and 'neural_network' folder #10243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper
commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper review
to trigger the checks for only added pull request files@algorithms-keeper review-all
to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
x, y, test_size=0.3, random_state=3) | ||
| ||
# Creating the decision tree classifier | ||
decTree = DecisionTreeClassifier(criterion="entropy", max_depth=4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable and function names should follow the snake_case
naming convention. Please update the following name accordingly: decTree
decTree.fit(x_train, y_train) | ||
| ||
# Predicting the values | ||
predTree = decTree.predict(x_test) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable and function names should follow the snake_case
naming convention. Please update the following name accordingly: predTree
neural_network/simple_adaline.py Outdated
@@ -0,0 +1,81 @@ | |||
def wght_cng_or(wgt, T, al): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file neural_network/simple_adaline.py
, please provide doctest for the function wght_cng_or
Please provide return type hint for the function: wght_cng_or
. If the function does not return a value, please provide the type hint as: def function() -> None:
Please provide type hint for the parameter: wgt
Please provide type hint for the parameter: T
Please provide descriptive name for the parameter: T
Please provide type hint for the parameter: al
neural_network/simple_adaline.py Outdated
def wght_cng_or(wgt, T, al): | ||
O = wgt[0]*0+wgt[1]*0 | ||
if O <= T: | ||
Ol = wgt[0]*0+wgt[1]*1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable and function names should follow the snake_case
naming convention. Please update the following name accordingly: Ol
neural_network/simple_adaline.py Outdated
if O <= T: | ||
Ol = wgt[0]*0+wgt[1]*1 | ||
if Ol >= T: | ||
Ole = wgt[0]*1+wgt[1]*0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable and function names should follow the snake_case
naming convention. Please update the following name accordingly: Ole
neural_network/simple_adaline.py Outdated
def wght_cng_and(wgt, T, al): | ||
O = wgt[0]*0+wgt[1]*0 | ||
if O <= T: | ||
Ol = wgt[0]*0+wgt[1]*1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable and function names should follow the snake_case
naming convention. Please update the following name accordingly: Ol
neural_network/simple_adaline.py Outdated
if O <= T: | ||
Ol = wgt[0]*0+wgt[1]*1 | ||
if Ol <= T: | ||
Ole = wgt[0]*1+wgt[1]*0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable and function names should follow the snake_case
naming convention. Please update the following name accordingly: Ole
neural_network/simple_adaline.py Outdated
if Ol <= T: | ||
Ole = wgt[0]*1+wgt[1]*0 | ||
if Ole <= T: | ||
Ola = wgt[0]*1+wgt[1]*1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable and function names should follow the snake_case
naming convention. Please update the following name accordingly: Ola
neural_network/simple_adaline.py Outdated
return wght_cng_and(wgt, T, al) | ||
| ||
| ||
def and_gate(wgt, A, B, T, al): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file neural_network/simple_adaline.py
, please provide doctest for the function and_gate
Please provide return type hint for the function: and_gate
. If the function does not return a value, please provide the type hint as: def function() -> None:
Please provide type hint for the parameter: wgt
Please provide type hint for the parameter: A
Please provide descriptive name for the parameter: A
Please provide type hint for the parameter: B
Please provide descriptive name for the parameter: B
Please provide type hint for the parameter: T
Please provide descriptive name for the parameter: T
Please provide type hint for the parameter: al
neural_network/simple_adaline.py Outdated
return 0 | ||
| ||
| ||
def or_gate(wgt, A, B, T, al): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file neural_network/simple_adaline.py
, please provide doctest for the function or_gate
Please provide return type hint for the function: or_gate
. If the function does not return a value, please provide the type hint as: def function() -> None:
Please provide type hint for the parameter: wgt
Please provide type hint for the parameter: A
Please provide descriptive name for the parameter: A
Please provide type hint for the parameter: B
Please provide descriptive name for the parameter: B
Please provide type hint for the parameter: T
Please provide descriptive name for the parameter: T
Please provide type hint for the parameter: al
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper
commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper review
to trigger the checks for only added pull request files@algorithms-keeper review-all
to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
neural_network/simple_adaline.py Outdated
| ||
from typing import List, Tuple | ||
| ||
def weight_change_or(weight: List[float], threshold: float, learning_rate: float) -> List[float]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file neural_network/simple_adaline.py
, please provide doctest for the function weight_change_or
neural_network/simple_adaline.py Outdated
return weight_change_or(weight, threshold, learning_rate) | ||
| ||
| ||
def weight_change_and(weight: List[float], threshold: float, learning_rate: float) -> List[float]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file neural_network/simple_adaline.py
, please provide doctest for the function weight_change_and
neural_network/simple_adaline.py Outdated
return weight_change_and(weight, threshold, learning_rate) | ||
| ||
| ||
def and_gate(weight: List[float], input_a: int, input_b: int, threshold: float, learning_rate: float) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file neural_network/simple_adaline.py
, please provide doctest for the function and_gate
neural_network/simple_adaline.py Outdated
return 0 | ||
| ||
| ||
def or_gate(weight: List[float], input_a: int, input_b: int, threshold: float, learning_rate: float) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file neural_network/simple_adaline.py
, please provide doctest for the function or_gate
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper
commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper review
to trigger the checks for only added pull request files@algorithms-keeper review-all
to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
neural_network/simple_adaline.py Outdated
@@ -0,0 +1,108 @@ | |||
# This program implements the AND and OR gates using the Adaline algorithm. | |||
def weight_change_or(weight: list[float], threshold: float, learning_rate: float) -> list[float]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file neural_network/simple_adaline.py
, please provide doctest for the function weight_change_or
neural_network/simple_adaline.py Outdated
return weight_change_or(weight, threshold, learning_rate) | ||
| ||
| ||
def weight_change_and(weight: list[float], threshold: float, learning_rate: float) -> list[float]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file neural_network/simple_adaline.py
, please provide doctest for the function weight_change_and
neural_network/simple_adaline.py Outdated
return weight_change_and(weight, threshold, learning_rate) | ||
| ||
| ||
def and_gate(weight: list[float], input_a: int, input_b: int, threshold: float, learning_rate: float) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file neural_network/simple_adaline.py
, please provide doctest for the function and_gate
neural_network/simple_adaline.py Outdated
return 0 | ||
| ||
| ||
def or_gate(weight: list[float], input_a: int, input_b: int, threshold: float, learning_rate: float) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file neural_network/simple_adaline.py
, please provide doctest for the function or_gate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper
commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper review
to trigger the checks for only added pull request files@algorithms-keeper review-all
to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
neural_network/simple_adaline.py Outdated
@@ -0,0 +1,108 @@ | |||
# This program implements the AND and OR gates using the Adaline algorithm. | |||
def weight_change_or(weight: list[float], threshold: float, learning_rate: float) -> list[float]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file neural_network/simple_adaline.py
, please provide doctest for the function weight_change_or
neural_network/simple_adaline.py Outdated
return weight_change_or(weight, threshold, learning_rate) | ||
| ||
| ||
def weight_change_and(weight: list[float], threshold: float, learning_rate: float) -> list[float]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file neural_network/simple_adaline.py
, please provide doctest for the function weight_change_and
neural_network/simple_adaline.py Outdated
return weight_change_and(weight, threshold, learning_rate) | ||
| ||
| ||
def and_gate(weight: list[float], input_a: int, input_b: int, threshold: float, learning_rate: float) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file neural_network/simple_adaline.py
, please provide doctest for the function and_gate
neural_network/simple_adaline.py Outdated
return 0 | ||
| ||
| ||
def or_gate(weight: list[float], input_a: int, input_b: int, threshold: float, learning_rate: float) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file neural_network/simple_adaline.py
, please provide doctest for the function or_gate
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
I cannot understand why it is failing the test. Please help me understanding this. I worked a lot to make my programs good for this repository. |
* [x] This PR only changes one algorithm file. |
Describe your change:
added my code in 'machine_learning' and 'neural_network' folder
Checklist: