Skip to content

Extend output result & minor fixes #81

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

Merged
merged 27 commits into from
Aug 4, 2021
Merged

Conversation

OnlyDeniko
Copy link
Contributor

No description provided.

@OnlyDeniko OnlyDeniko marked this pull request as ready for review July 20, 2021 13:15
@OnlyDeniko OnlyDeniko requested a review from RukhovichIV as a code owner July 29, 2021 08:08
@RukhovichIV
Copy link

Pep8 is also important. There's an extra space somewhere :)

@RukhovichIV RukhovichIV self-requested a review July 29, 2021 11:11
@OnlyDeniko OnlyDeniko changed the title Minor fixes Extend output result & minor fixes Aug 2, 2021
@OnlyDeniko OnlyDeniko requested a review from RukhovichIV August 2, 2021 09:26
bench.py Outdated
return str(data.dtypes[0])
elif hasattr(data, 'values'):
if hasattr(data, 'values'):
return data.values.dtype
else:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just raise an exception here, without else

bench.py Outdated
else:
return optimal_cache_size_bytes
return max_cache_bytes if optimal_cache_size_bytes > max_cache_bytes \
else optimal_cache_size_bytes

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An extra comma at the end of line 175 'Now avalible for scikit-learn benchmarks'),

bench.py Outdated
y = convert_to_numpy(y)
yp = convert_to_numpy(yp)
if y.ndim + yp.ndim > 2:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that code really useless? does sklearn_accuracy work same?

bench.py Outdated
try:
res = sklearn_log_loss(y, yp)
except Exception:
res = None

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handling exceptions like this is a bad practice: every mistake will be hidden by this code
Is log_loss always properly called?
Is it always given probabilities and not labels?
Is the argument order right?
Same questions should be answered for other metrics

acc = davies_bouldin_score(X, labels)
try:
acc = davies_bouldin_score(X, labels)
except Exception:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to have all scoring functions in the same place (bench.py)
And again, such handling is a bad practice

@OnlyDeniko OnlyDeniko requested a review from ShvetsKS as a code owner August 2, 2021 14:21
data=[X], alg_instance=dbscan)


if __name__ == "__main__":
parser = argparse.ArgumentParser(description='scikit-learn DBSCAN benchmark')
parser.add_argument('-e', '--eps', '--epsilon', type=float, default=10.,
parser.add_argument('-e', '--eps', '--epsilon', type=float, default=0.5,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you change it? this will not affect the measurements of the current configs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is default value in sklearn

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will not affect the measurements of the current configs?

bench.py Outdated
try:
res = sklearn_dbs(y_true, y_pred)
except ValueError:
res = "Number of labels is 1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for example: y _pred= [1, 1, 1, 1, 1, 1, 1,] ? Or?

data=[X], alg_instance=dbscan)


if __name__ == "__main__":
parser = argparse.ArgumentParser(description='scikit-learn DBSCAN benchmark')
parser.add_argument('-e', '--eps', '--epsilon', type=float, default=10.,
parser.add_argument('-e', '--eps', '--epsilon', type=float, default=0.5,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will not affect the measurements of the current configs?

Copy link
Contributor

@PetrovKP PetrovKP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no concerns from my side

Copy link

@RukhovichIV RukhovichIV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!
Let's fix the CodeFactor CI asap

res = sklearn_dbs(X, labels)
except ValueError as ex:
res = ex
return res

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm slightly concerned about such exception handling. My opinion is - our own configs shouldn't cause any exceptions.
And I would have rather removed every handling from the code

@RukhovichIV RukhovichIV merged commit 972efac into IntelPython:master Aug 4, 2021
RukhovichIV added a commit that referenced this pull request Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants