Skip to content
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

[ImgBot] Optimize images #109

Merged
merged 2 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/source/_static/404.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/skscope-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/source/_static/skscope-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/skscope-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/source/_static/skscope-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/skscope.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/contribute/figure/architecture-scope.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/first_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/gallery/image/filtering.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/gallery/image/graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/gallery/image/ic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/gallery/image/linear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/gallery/image/mis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/gallery/image/survival.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/userguide/figure/nonlinear_variable_selection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/userguide/figure/portfolio_selection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/userguide/figure/precision_matrix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/userguide/figure/tf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/userguide/figure/trend_filter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/userguide/figure/variable_selection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 26 additions & 12 deletions skscope/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ def check_y_survival(y_or_event, *args, allow_all_censored=False):
if len(args) == 0:
y = y_or_event

if not isinstance(y, np.ndarray) or y.dtype.fields is None or len(y.dtype.fields) != 2:
if (
not isinstance(y, np.ndarray)
or y.dtype.fields is None
or len(y.dtype.fields) != 2
):
raise ValueError(
"y must be a structured array with the first field"
" being a binary class event indicator and the second field"
Expand All @@ -47,7 +51,9 @@ def check_y_survival(y_or_event, *args, allow_all_censored=False):

event = check_array(y_event, ensure_2d=False)
if not np.issubdtype(event.dtype, np.bool_):
raise ValueError(f"elements of event indicator must be boolean, but found {event.dtype}")
raise ValueError(
f"elements of event indicator must be boolean, but found {event.dtype}"
)

if not (allow_all_censored or np.any(event)):
raise ValueError("all samples are censored")
Expand All @@ -60,7 +66,9 @@ def check_y_survival(y_or_event, *args, allow_all_censored=False):

yt = check_array(yt, ensure_2d=False)
if not np.issubdtype(yt.dtype, np.number):
raise ValueError(f"time must be numeric, but found {yt.dtype} for argument {i + 2}")
raise ValueError(
f"time must be numeric, but found {yt.dtype} for argument {i + 2}"
)

return_val.append(yt)

Expand Down Expand Up @@ -195,7 +203,9 @@ def logistic_loss(params):
The SIC is calculated using the formula:
SIC = 2 * objective_value + effective_params_num * np.log(np.log(train_size)) * np.log(dimensionality)
"""
return 2 * objective_value + effective_params_num * np.log(np.log(train_size)) * np.log(dimensionality)
return 2 * objective_value + effective_params_num * np.log(
np.log(train_size)
) * np.log(dimensionality)


def GIC(
Expand Down Expand Up @@ -231,7 +241,9 @@ def logistic_loss(params):
The GIC is calculated using the formula:
GIC = 2 * objective_value + effective_params_num * np.log(np.log(train_size)) * np.log(dimensionality)
"""
return 2 * objective_value + effective_params_num * np.log(np.log(train_size)) * np.log(dimensionality)
return 2 * objective_value + effective_params_num * np.log(
np.log(train_size)
) * np.log(dimensionality)


def EBIC(
Expand Down Expand Up @@ -266,7 +278,9 @@ def logistic_loss(params):
The E is calculated using the formula:
EBIC = 2 * objective_value + effective_params_num * (np.log(train_size) + 2 * np.log(dimensionality))
"""
return 2 * objective_value + effective_params_num * (np.log(train_size) + 2 * np.log(dimensionality))
return 2 * objective_value + effective_params_num * (
np.log(train_size) + 2 * np.log(dimensionality)
)


def LinearSIC(
Expand Down Expand Up @@ -303,9 +317,9 @@ def linear_loss(params):
The LinearSIC is calculated using the formula:
LinearSIC = train_size * np.log(objective_value) + 2 * effective_params_num * np.log(np.log(train_size)) * np.log(dimensionality)
"""
return train_size * np.log(objective_value) + 2 * effective_params_num * np.log(np.log(train_size)) * np.log(
dimensionality
)
return train_size * np.log(objective_value) + 2 * effective_params_num * np.log(
np.log(train_size)
) * np.log(dimensionality)


def LinearGIC(
Expand Down Expand Up @@ -343,6 +357,6 @@ def linear_loss(params):
The LinearGIC is calculated using the formula:
LinearGIC = train_size * np.log(objective_value) + 2 * effective_params_num * np.log(np.log(train_size)) * np.log(dimensionality)
"""
return train_size * np.log(objective_value) + 2 * effective_params_num * np.log(np.log(train_size)) * np.log(
dimensionality
)
return train_size * np.log(objective_value) + 2 * effective_params_num * np.log(
np.log(train_size)
) * np.log(dimensionality)
Loading