diff --git a/.obsidian/app.json b/.obsidian/app.json new file mode 100644 index 000000000..e609a07e7 --- /dev/null +++ b/.obsidian/app.json @@ -0,0 +1,3 @@ +{ + "promptDelete": false +} \ No newline at end of file diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json new file mode 100644 index 000000000..990f3376e --- /dev/null +++ b/.obsidian/appearance.json @@ -0,0 +1,3 @@ +{ + "baseFontSize": 16 +} \ No newline at end of file diff --git a/.obsidian/core-plugins.json b/.obsidian/core-plugins.json new file mode 100644 index 000000000..26bc70e71 --- /dev/null +++ b/.obsidian/core-plugins.json @@ -0,0 +1,14 @@ +[ + "file-explorer", + "global-search", + "switcher", + "graph", + "backlink", + "page-preview", + "note-composer", + "command-palette", + "markdown-importer", + "word-count", + "open-with-default-app", + "file-recovery" +] \ No newline at end of file diff --git a/.obsidian/hotkeys.json b/.obsidian/hotkeys.json new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/.obsidian/hotkeys.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.obsidian/workspace b/.obsidian/workspace new file mode 100644 index 000000000..df36320f8 --- /dev/null +++ b/.obsidian/workspace @@ -0,0 +1,98 @@ +{ + "main": { + "id": "731fd8afe9620a72", + "type": "split", + "children": [ + { + "id": "63d81b5aba5c1586", + "type": "leaf", + "state": { + "type": "empty", + "state": {} + } + } + ], + "direction": "vertical" + }, + "left": { + "id": "4e6049485ed0fcb5", + "type": "split", + "children": [ + { + "id": "8af0e59d77a84c39", + "type": "tabs", + "children": [ + { + "id": "7c1d92dd06ec9f6d", + "type": "leaf", + "state": { + "type": "file-explorer", + "state": {} + } + }, + { + "id": "a9c30d0784d03f60", + "type": "leaf", + "state": { + "type": "search", + "state": { + "query": "", + "matchingCase": false, + "explainSearch": false, + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical" + } + } + } + ] + } + ], + "direction": "horizontal", + "width": 300 + }, + "right": { + "id": "b1986aea2deb0dcd", + "type": "split", + "children": [ + { + "id": "c7f342607fa31e90", + "type": "tabs", + "children": [ + { + "id": "05d535f47fbf04a3", + "type": "leaf", + "state": { + "type": "backlink", + "state": { + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + } + } + } + ] + } + ], + "direction": "horizontal", + "width": 300, + "collapsed": true + }, + "active": "63d81b5aba5c1586", + "lastOpenFiles": [ + "logo.png", + "CONTRIBUTING.md", + "CODE_OF_CONDUCT.md", + "README.md", + "snippets/regularised_beta.md", + "snippets/pearson_correlation.md", + "snippets/convolution.md", + "snippets/beta.md", + "snippet-template.md", + "snippets/sliding_window.md" + ] +} \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 0e3d4ccc7..7e28edb1d 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,73 +1,73 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -education, socio-economic status, nationality, personal appearance, race, -religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at [mst10041967@gmail.com]. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -[homepage]: https://www.contributor-covenant.org +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +education, socio-economic status, nationality, personal appearance, race, +religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at [mst10041967@gmail.com]. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 40f60e496..8cdc2d14b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,42 +1,42 @@ -# Contribution Guidelines - -**30 seconds of code** is powered by the community, so feel free to contribute in any way you can to help us! - -## How you can help - -- Submit pull requests with new snippets (see guidelines below) or snippet updates (tags, descriptions, explanations, typos, examples, code improvements). -- Open issues for things you want to see added, modified, discuss ideas or help out with existing issues. - -## Ground rules - -Breaking any of these rules will result in your pull request being closed. Please follow these guidelines above all else: - -- **Always be polite and respectful to others** and try to follow the advice of the moderators/collaborators/owners. -- **Only modify snippet files**, never modify the generated files in the `snippet_data` directory. -- **Use the snippet template** to create new snippets, ensure they have the correct name and are in the correct location. -- **Follow snippet format exactly**, otherwise your snippets will not be recognized correctly by the tools responsible for publishing them on the website. This includes such things as spacing and empty lines - if you accidentally make a mistake, consult the repository's [snippet template](snippet-template.md). -- **Snippets should solve real-world problems**, no matter how simple and should be abstract enough to be applied to different scenarios. - -## Snippet creation - -In order to create a new snippet, you should follow the steps below: - -- Create a copy of the [snippet template](snippet-template.md) in the `snippets` directory. -- Change the name of the newly created file to the name of your snippet. -- Edit the file, adding your snippet based on the guidelines. - -## Snippet guidelines - -- Snippets must have all their frontmatter sections (title, tags etc.) filled. -- Snippet titles must correspond to the filename and follow the language and repository's naming conventions. -- Snippet tags must be comma-separated, contain a primary tag as seen on the website as their first tag and an expertise tag (`beginner`, `intermediate` or `advanced`) as their last tag. -- Snippets must have their `firstSeen` dates formatted using [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601). -- Snippet descriptions must be short and to the point. Explain *what* the snippet does and detail *how* the snippet works and the language features used in it. -- Snippet code and examples must be enclosed in appropriate, language-tagged blocks as shown in the snippet template, be short and use modern techniques and features. Also make sure to test your code before submitting. -- If your snippet contains arguments with default parameters, explain what happens if they are omitted when calling the function and what the default case is. Specify default parameters for arguments only if necessary. -- If your snippet uses recursion, use the `recursion` tag and explain the base cases. -- Try to strike a balance between readability, brevity, and performance. -- Always use soft tabs (2 spaces), never hard tabs. -- Leave a single space after a comma (`,`) character (both in the description and code). -- Define multiple variables on the same line, if possible. Use meaningful names (e.g. `letter` instead of `lt`) and follow existing conventions as seen in other snippets. Do not use trailing or leading underscores in variable names. -- Snippet should only use native `python 3.6` modules. Snippets using external modules will be disqualified immediately. +# Contribution Guidelines + +**30 seconds of code** is powered by the community, so feel free to contribute in any way you can to help us! + +## How you can help + +- Submit pull requests with new snippets (see guidelines below) or snippet updates (tags, descriptions, explanations, typos, examples, code improvements). +- Open issues for things you want to see added, modified, discuss ideas or help out with existing issues. + +## Ground rules + +Breaking any of these rules will result in your pull request being closed. Please follow these guidelines above all else: + +- **Always be polite and respectful to others** and try to follow the advice of the moderators/collaborators/owners. +- **Only modify snippet files**, never modify the generated files in the `snippet_data` directory. +- **Use the snippet template** to create new snippets, ensure they have the correct name and are in the correct location. +- **Follow snippet format exactly**, otherwise your snippets will not be recognized correctly by the tools responsible for publishing them on the website. This includes such things as spacing and empty lines - if you accidentally make a mistake, consult the repository's [snippet template](snippet-template.md). +- **Snippets should solve real-world problems**, no matter how simple and should be abstract enough to be applied to different scenarios. + +## Snippet creation + +In order to create a new snippet, you should follow the steps below: + +- Create a copy of the [snippet template](snippet-template.md) in the `snippets` directory. +- Change the name of the newly created file to the name of your snippet. +- Edit the file, adding your snippet based on the guidelines. + +## Snippet guidelines + +- Snippets must have all their frontmatter sections (title, tags etc.) filled. +- Snippet titles must correspond to the filename and follow the language and repository's naming conventions. +- Snippet tags must be comma-separated, contain a primary tag as seen on the website as their first tag and an expertise tag (`beginner`, `intermediate` or `advanced`) as their last tag. +- Snippets must have their `firstSeen` dates formatted using [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601). +- Snippet descriptions must be short and to the point. Explain *what* the snippet does and detail *how* the snippet works and the language features used in it. +- Snippet code and examples must be enclosed in appropriate, language-tagged blocks as shown in the snippet template, be short and use modern techniques and features. Also make sure to test your code before submitting. +- If your snippet contains arguments with default parameters, explain what happens if they are omitted when calling the function and what the default case is. Specify default parameters for arguments only if necessary. +- If your snippet uses recursion, use the `recursion` tag and explain the base cases. +- Try to strike a balance between readability, brevity, and performance. +- Always use soft tabs (2 spaces), never hard tabs. +- Leave a single space after a comma (`,`) character (both in the description and code). +- Define multiple variables on the same line, if possible. Use meaningful names (e.g. `letter` instead of `lt`) and follow existing conventions as seen in other snippets. Do not use trailing or leading underscores in variable names. +- Snippet should only use native `python 3.6` modules. Snippets using external modules will be disqualified immediately. diff --git a/README.md b/README.md index 862c8f2c0..cc0ed938d 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,13 @@ -[![Logo](/logo.png)](https://30secondsofcode.org/python/p/1) +# 30 seconds of ML -# 30 seconds of code - -> Short Python code snippets for all your development needs - -* Visit [our website](https://30secondsofcode.org) to view our snippet collection. -* Use the [Search page](https://30secondsofcode.org/search) to find snippets that suit your needs. You can search by name, tag, language or using a snippet's description. Just start typing a term and see what comes up. -* Browse the [Python Snippet collection](https://30secondsofcode.org/python/p/1) to see all the snippets in this project or click individual tags at the top of the same page to narrow down your search to a specific tag. -* Click on each snippet card to view the whole snippet, including code, explanation and examples. -* You can use the button at the bottom of a snippet card to copy the code to clipboard. -* If you like the project, give it a star. It means a lot to the people maintaining it. +> Short Python code snippets for all your machine learning needs ## Want to contribute? * If you want to help us improve, take a minute to read the [Contribution Guidelines](/CONTRIBUTING.md) first. * Use the [Snippet Template](/snippet-template.md) to add new snippets to the collection. -* If you find a problem with a specific snippet, please [open an issue](https://github.com/30-seconds/30-seconds-of-python/issues/new). -* If you find a problem with the website, please [report it in the web repository](https://github.com/30-seconds/30-seconds-web/issues/new). +* If you find a problem with a specific snippet, please [open an issue](https://github.com/treeai/30-seconds-of-ml/issues/new). ## Credits -* This repository is maintained by the [30 seconds of code organization on GitHub](https://github.com/30-seconds). -* All snippets are licensed under the CC0-1.0 License, unless explicitly stated otherwise. -* Logos, names and trademarks are not to be used without the explicit consent of the owners of the 30 seconds of code GitHub organization. -* Our website is powered by [Netlify](https://www.netlify.com/), [Next.js](https://nextjs.org/) & [GitHub](https://github.com/). +* This repository is heavily inspired by the [30 seconds of code organization on GitHub](https://github.com/30-seconds). diff --git a/logo.png b/logo.png deleted file mode 100644 index a7661d15e..000000000 Binary files a/logo.png and /dev/null differ diff --git a/snippet-template.md b/snippet-template.md index 458ad256e..ccae483b6 100644 --- a/snippet-template.md +++ b/snippet-template.md @@ -1,21 +1,29 @@ ---- -title: function_name -tags: utility,intermediate -firstSeen: 2021-06-13T05:00:00-04:00 ---- - -Explain briefly what the snippet does. - -- Explain briefly how the snippet works. -- Use bullet points for your snippet's explanation. -- Try to explain everything briefly but clearly. - -```py -def function_name(args): - # code - return 0 -``` - -```py -function_name(val) # result -``` +--- +title: function_name +tags: utility,intermediate +firstSeen: 2021-06-13T05:00:00-04:00 +--- + +# `function_name.py` + +- Explain Function in Brief + +```py +def function_name(params): + """ + Short Docstring Description + """ + +``` + +## Explanation +- Explain Function Extensively +- Explain Use Cases + +```py +def function_name(params): + """ + Proper Docstring, with elaboration on params + """ + +```