This dissertation explores new machine learning techniques and adapts them to mine scientific data, specifically data from solar physics and space weather studies. The dissertation tackles three important problems in heliophysics: solar flare prediction, coronal mass ejection (CME) prediction and Stokes inversion. First, the dissertation presents a long short-term memory (LSTM) network for predicting whether an active region (AR) would produce a certain class of solar flare within the next 24 hours. The essence of this approach is to model data samples in an AR as time series and use LSTMs to capture temporal information of the data samples. The LSTM network consists of an LSTM layer, an attention layer, two fully connected layers and an ou...