Coder Social home page Coder Social logo

ethen8181 / machine-learning Goto Github PK

View Code? Open in Web Editor NEW
3.1K 129.0 647.0 453.64 MB

:earth_americas: machine learning tutorials (mainly in Python3)

License: MIT License

R 0.06% HTML 73.14% Python 0.15% Jupyter Notebook 26.62% CSS 0.01% Dockerfile 0.01% CMake 0.01% C++ 0.01% Cython 0.01%
machine-learning data-science jupyter-notebook python3 deep-learning python

machine-learning's People

Contributors

dependabot[bot] avatar ethen8181 avatar jackkuipers avatar jakubczakon avatar jiaxiangbu avatar juholehtonen avatar naereen avatar phantom1472 avatar spekulatius avatar tyt51685168 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

machine-learning's Issues

Minor calculation mistake in "compute_calibration_error"

The formula for ECE (expected calibration error) includes the size of each bin as weight in the weighted average of the squared errors (|Bm|/n)

The function that uses this formula in the code is called "compute_calibration_error":
https://github.com/ethen8181/machine-learning/blob/master/model_selection/prob_calibration/calibration_module/utils.py#L66

(Link to the code line that sums the errors without weight for each bin size)

Although the bins are created so that they are of approximately equal size, they might differ slightly, and the code does not take this into account, i think the bin_error should be multiplied by the bin size, and the sum of all the errors divided by the number of samples (len of y_true for example) instead of the number of bins (in line 68).

I hope my issue is clear and easy to understand, if not, feel free to ask me for clarification.

Why does Logistic Regression Solver impact the conclusion?

Ethen, I have an interesting finding.

If we change the solver of LogisticRegression from 'liblinear' to the default 'lbfgs', theeffect will not be significant with pvalue=0.1605910849805837. What the reason behind this change? why you choose 'liblinear' instead of any other solver? Thanks!

it may be an error in torch transformer.

class MultiHeadAttention(nn.Module):

in this class, it does not implement the scale of the multiplication of Query and Key.
and in the forward function, it seems that the funcation should return linear_proj , not output?

Columns and DataType Not Explicitly Set on line 290 of utils.py

Hello!

I found an AI-Specific Code smell in your project.
The smell is called: Columns and DataType Not Explicitly Set

You can find more information about it in this paper: https://dl.acm.org/doi/abs/10.1145/3522664.3528620.

According to the paper, the smell is described as follows:

Problem If the columns are not selected explicitly, it is not easy for developers to know what to expect in the downstream data schema. If the datatype is not set explicitly, it may silently continue the next step even though the input is unexpected, which may cause errors later. The same applies to other data importing scenarios.
Solution It is recommended to set the columns and DataType explicitly in data processing.
Impact Readability

Example:

### Pandas Column Selection
import pandas as pd
df = pd.read_csv('data.csv')
+ df = df[['col1', 'col2', 'col3']]

### Pandas Set DataType
import pandas as pd
- df = pd.read_csv('data.csv')
+ df = pd.read_csv('data.csv', dtype={'col1': 'str', 'col2': 'int', 'col3': 'float'})

You can find the code related to this smell in this link: https://github.com/ethen8181/machine-learning/blob/916fc7fe0e5e788a1cc8b8f4d24d44f05c492d5e/model_selection/prob_calibration/calibration_module/utils.py#L280-L300.

I also found instances of this smell in other files, such as:

File: https://github.com/ethen8181/machine-learning/blob/master/big_data/sparkml/get_data.py#L21-L31 Line: 26
File: https://github.com/ethen8181/machine-learning/blob/master/data_science_is_software/src/features/build_features.py#L4-L14 Line: 9
File: https://github.com/ethen8181/machine-learning/blob/master/deep_learning/contrastive/clip/clip/utils.py#L5-L15 Line: 10
File: https://github.com/ethen8181/machine-learning/blob/master/model_selection/partial_dependence/partial_dependence.py#L307-L317 Line: 312
.

I hope this information is helpful!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.