%global __brp_check_rpaths %{nil} %global __requires_exclude ^libmpi %global packname ale %global packver 0.5.0 %global rlibdir /usr/local/lib/R/library Name: R-CRAN-%{packname} Version: 0.5.0 Release: 1%{?dist}%{?buildtag} Summary: Interpretable Machine Learning and Statistical Inference with Accumulated Local Effects (ALE) License: MIT + file LICENSE URL: https://cran.r-project.org/package=%{packname} Source0: %{url}&version=%{packver}#/%{packname}_%{packver}.tar.gz BuildRequires: R-devel >= 4.2.0 Requires: R-core >= 4.2.0 BuildArch: noarch BuildRequires: R-CRAN-broom BuildRequires: R-CRAN-cli BuildRequires: R-CRAN-dplyr BuildRequires: R-CRAN-furrr BuildRequires: R-CRAN-future BuildRequires: R-CRAN-ggplot2 BuildRequires: R-CRAN-insight BuildRequires: R-methods BuildRequires: R-CRAN-patchwork BuildRequires: R-CRAN-progressr BuildRequires: R-CRAN-purrr BuildRequires: R-CRAN-rlang BuildRequires: R-CRAN-S7 BuildRequires: R-CRAN-staccuracy BuildRequires: R-stats BuildRequires: R-CRAN-stringr BuildRequires: R-CRAN-tidyr BuildRequires: R-CRAN-univariateML BuildRequires: R-utils Requires: R-CRAN-broom Requires: R-CRAN-cli Requires: R-CRAN-dplyr Requires: R-CRAN-furrr Requires: R-CRAN-future Requires: R-CRAN-ggplot2 Requires: R-CRAN-insight Requires: R-methods Requires: R-CRAN-patchwork Requires: R-CRAN-progressr Requires: R-CRAN-purrr Requires: R-CRAN-rlang Requires: R-CRAN-S7 Requires: R-CRAN-staccuracy Requires: R-stats Requires: R-CRAN-stringr Requires: R-CRAN-tidyr Requires: R-CRAN-univariateML Requires: R-utils %description Accumulated Local Effects (ALE) were initially developed as a model-agnostic approach for global explanations of the results of black-box machine learning algorithms. ALE has a key advantage over other approaches like partial dependency plots (PDP) and SHapley Additive exPlanations (SHAP): its values represent a clean functional decomposition of the model. As such, ALE values are not affected by the presence or absence of interactions among variables in a mode. Moreover, its computation is relatively rapid. This package reimplements the algorithms for calculating ALE data and develops highly interpretable visualizations for plotting these ALE values. It also extends the original ALE concept to add bootstrap-based confidence intervals and ALE-based statistics that can be used for statistical inference. For more details, see Okoli, Chitu. 2023. “Statistical Inference Using Machine Learning and Classical Techniques Based on Accumulated Local Effects (ALE).” arXiv. . %prep %setup -q -c -n %{packname} # fix end of executable files find -type f -executable -exec grep -Iq . {} \; -exec sed -i -e '$a\' {} \; # prevent binary stripping [ -d %{packname}/src ] && find %{packname}/src -type f -exec \ sed -i 's@/usr/bin/strip@/usr/bin/true@g' {} \; || true [ -d %{packname}/src ] && find %{packname}/src/Make* -type f -exec \ sed -i 's@-g0@@g' {} \; || true # don't allow local prefix in executable scripts find -type f -executable -exec sed -Ei 's@#!( )*/usr/local/bin@#!/usr/bin@g' {} \; %build %install mkdir -p %{buildroot}%{rlibdir} %{_bindir}/R CMD INSTALL -l %{buildroot}%{rlibdir} %{packname} test -d %{packname}/src && (cd %{packname}/src; rm -f *.o *.so) rm -f %{buildroot}%{rlibdir}/R.css # remove buildroot from installed files find %{buildroot}%{rlibdir} -type f -exec sed -i "s@%{buildroot}@@g" {} \; %files %{rlibdir}/%{packname}