libpyhat.regression package
Submodules
libpyhat.regression.cv module
libpyhat.regression.local_regression module
- class libpyhat.regression.local_regression.LocalRegression(params, n_neighbors=250, verbose=True, n_jobs=-1)[source]
Bases:
object
This class implements “local” regression. Given a set of training data and a set of unknown data,
iterate through each unknown spectrum, find the nearest training spectra, and generate a model. Each of these local models is optimized using built-in cross validation methods from scikit.
libpyhat.regression.local_rmsep module
;+ ;This function is used to calculate the RMSEP on-the-fly as a function of predicted composition. ;It uses the test set results to create a plot of RMSEP vs composition. This is then smoothed and extrapolated ;and re-sampled to be used as a look-up table for the predictions of unknown targets. ; ;Inputs: ; predicts = Array containing the predicted compositions that need RMSEPs ; test_predicts = Hash containing the predicted compositions for the test set ; test_actuals = Hash containing the actual compositions for the test set ; elems = string array containing major oxide names ; makeplot = Optional keyword that produces plots of RMSEP vs composition ;Outputs: ; rmseps = Array of RMSEP values calculated for each of the predictions in “predicts” ;-
- libpyhat.regression.local_rmsep.generate_dummy(test_predicts, test_actuals, minval, win, xmax)[source]
- libpyhat.regression.local_rmsep.local_rmse_calc(test_predicts, test_actuals, unk_predicts, windowsize=0.0, min_rmsep_num=40, sigma=10, extrapolate=True, full_fit=False, xmax=120)[source]
libpyhat.regression.regression module
libpyhat.regression.sm module
Created on Sat Mar 26 20:15:46 2016
@author: [username deleted]