Space weather forecasting and heliophysics increasingly rely on machine learning models that process heterogeneous inputs such as multi-viewpoint multi-wavelength solar images and rasters, multivariate time series, spatial annotations, and tabular event-level data. However, explainability workflows remain fragmented across libraries, model interfaces, and output formats, limiting reuse and reproducibility. We present SWXAI, an open-source library that unifies explainable AI (XAI) workflows for image, time-series, and tabular data in space weather forecasting and heliophysics. SWXAI provides a common, extensible interface across commonly used vision, time-series, and tabular learning models, with validation, adaptation, and persistent explanation objects. It also includes domain-grounded examples, reproducible notebooks, tests, and documentation, enabling users to inspect outputs, swap models or explainers, and extend workflows to new heliophysics datasets. SWXAI reduces modality-specific engineering overhead and supports comparable, reusable explanations across heterogeneous scientific machine learning pipelines. A benchmark against direct backend implementations shows that SWXAI substantially reduces the code users write to produce an explanation, with no practical runtime cost.
Molecular line lists disagree at a level that measurably shifts retrieved C/O, so retrievals conditioned on a single list omit a dominant systematic from their error bars. Classical marginalization re-runs a full retrieval under K opacity realizations per object. We move that cost into simulation: while generating the training set we randomize opacities (smooth multiplicative Fourier fields in log(nu) plus a discrete line-list mixture, under a deliberately broad prior informed by measured inter-list differences), so a neural posterior estimator learns an already-marginalized posterior. On perturbed held-out spectra (n=2048) a standard NPE covers nominal 90% C/O intervals 43.3% of the time against 82.4% for a compute-matched marginalized network; three-seed control ensembles reach 93.2% on clean data but 61.4% under perturbation, against 89.4% marginalized, isolating the deficit as opacity-induced (TARP joint expected-coverage deviation 0.005 against 0.035 for a single control network). An axis ablation traces the gain to the continuous field (45.4% for the discrete swaps alone, 79.3% for the field alone). In simulation, real JWST bad-pixel masks with median filling cut the marginalized ensemble's C/O coverage from 0.894 to 0.683; an ensemble retrained with mask augmentation holds 0.918 under the full deployment preprocessing (n=1024). We apply the networks to one pipeline-combined JWST/NIRSpec G395H spectrum each of 14 late-T and Y dwarfs. The recommended mask-augmented ensemble returns C/O medians between 0.24 and 0.62 and contains the Hood et al. (2024) value of 0.53 for the T8 benchmark 2MASS J0415-0935, which every fixed-opacity control network excludes. With 90% intervals spanning about 0.43 of the prior width, this is a consistency check, not a validation.
Accurately predicting fast solar wind conditions is challenging, as uncertainties are large and unquantified by traditional single-value prediction models. In particular, the risks of high-speed solar wind streams (HSSs), which can cause damage to technological infrastructure, cannot be reliably assessed without probabilistic forecasts. We present PROSWIN, a probabilistic machine learning model that forecasts the hourly solar wind speed (SWS) at Earth with a four-day lead time. The approach combines solar images and magnetograms using a deep neural network coupled to a distributional regression algorithm. Because standard error metrics underweight the relevance of HSS peaks, we further introduce the prediction score, a model-selection metric that jointly rewards timeline and HSS peak accuracy. On 14 years of data, our forecast achieves very well-calibrated uncertainties (<1% average deviation). Using the continuous ranked probability score (CRPS), a metric that assesses distributional accuracy, we obtain a timeline CRPS of 41.0 km/s, an HSS peak CRPS of 45.3 km/s, and a prediction score of 42.3 km/s. We find that the 171 {\AA} channel is an important complement to the typically used 193 {\AA} and 211 {\AA} channels and that the prediction score for model selection improves the applicability of the model. Compared to selected models from the literature, ours is the only one that is accurate for both timeline and HSS peak values, rather than trading one off against the other. These results support the advantages of probabilistic over single-value solar wind models. The introduced methods are also transferable to other forecasting problems.
We propose a generative learner for estimating conditional average treatment effects and characterizing the full distribution of these effects. The learner takes the form of a multi-head feed-forward neural network with three jointly estimated subnetworks: the propensity score, the conditional quantile function of the baseline outcome, and the conditional quantile treatment effect. Each quantile-indexed subnetwork combines a covariate representation with cosine quantile embeddings through element-wise multiplication. We then recover the conditional average treatment effect as an integral over conditional quantile treatment effects. Under the classical causal assumptions within the Neyman--Rubin potential outcomes framework, we find that the proposed generative learner reduces out-of-sample mean squared error relative to the generalized random forest, double machine learning, and generative adversarial networks, with gains ranging from 5.4% to 93.5% on average across experimental designs. In an empirical application, we formalize the Stefan--Boltzmann law within a unidirectional causal model and apply the method to publicly available stellar data. The estimated effects satisfy the restrictions the law implies.
Space weather is the study of the near-Earth impact of the processes on the Sun. In a this era of technology, space weather emerges as a crucial area of study wherein the state of the near-Earth conditions need to be modeled and forecasted. Crucially, the advent of machine learning provides us with opportunities to study this subject in a rather comprehensive manner. In this chapter, we treat the the processes arising from Sun to the impact on the ground as a set of coupled systems, which can be studied in isolation or in a coupled manner. We define these individual systems in terms of their state vector $\vec{S}$, which provides us with an opportunity to define the physical variables determining the system. This also allows us to consider the systems in terms of their observables, obtained through the action of operators as $\vec{O}[\vec{S}]$. In such a formalism, the machine learning algorithms serve as {\it learned operators}, defined generally as inference ($\mathcal{I}$), propagation ($\mathcal{P}$), and emulation ($\mathcal{E}$). Through such a formalism, we present how machine learning helps advance our understanding of the physical systems under study, while also accelerating the development of operational models for space weather forecasting.