12,203 reputation
13566
bio website fromthebottomoftheheap.net
location Regina, Canada
age 38
visits member for 4 years, 6 months
seen 28 mins ago

I'm Quantitative Environmental Scientist in the Institute of Environmental Change & Society, at the University of Regina, Canada. I undertake research on environmental problems, including climate change and atmospheric pollution, affecting lakes. I use lake sediments to look back in time at the history of lakes to look at what organisms are present and how the species in the lake have changed through time and how lakes evolve and respond to pollution and perturbations.

I'm also an Adjunct Professor in the Department of Biology at the University of Regina.


1h
reviewed Close lmer syntax for a two-way model with one fixed and one random factor
4h
comment Applying randomforest algorithm (fit) on new data without recomputing the fit
Sorry, there was an error in my last comment; to load the serialised object you need readRDS(), not loadRDS(). I've clarified this in an answer. I suspect this Q will get closed as it is OT for Cross Validated, though it may well be migrated to Stack Overflow.
4h
answered Applying randomforest algorithm (fit) on new data without recomputing the fit
4h
comment Applying randomforest algorithm (fit) on new data without recomputing the fit
You don't have recreate fit before wanting to predict from it. Just save (serialise) fit to disk and load the serialised object before you want to do the predictions. I would do: saveRDS(fit, "my-rf-object.rds"). Then when you want to do predictions, load randomForest then do fit <- loadRDS("my-rf-object.rds"). Then you can do predict(fit, testing) as if you'd just fitted the RF. For future reference, what would have clarified your Q (for me) would have been some mention of wanting to do predictions in new/other R sessions.
5h
comment Applying randomforest algorithm (fit) on new data without recomputing the fit
That is what the predict() method does! The fit object contains and the trees of the forest and each of these has the rules. This is stored in a format that allows fast Fortran (or C) code to apply the rules to the new observations. Is your question how to do this outside of R? If you want to do this in R, predict() does everything you want to do. Outside of R, you may be out of luck. You should be able to extract the model structure in a PMML and then perhaps you can do something with that outside of R.
5h
comment “Error in plot.new() : figure margins too large” when plotting multiple histograms in a window
This is not a statistical problem and hence is OT here, but the error you are getting is a common problem when you try to plot several figures on a single device. The error means that after you split the device into several regions, and applied the margins around the plot in that region, there is no room left to draw the actual plot. The expedient solution is to increase the size of the device (if on screen, make the window bigger, if a file device, increase the height and width), and/or decrease the size of the plot margins with par().
5h
reviewed Close subtraction mean from nonstationary time series
5h
reviewed Leave Open Equal Prior Probablility and Linear Decision Boundary, a Simple Calculation Problem?
5h
reviewed Close Gaussian mixture models restriction?
5h
comment Applying randomforest algorithm (fit) on new data without recomputing the fit
The predict() method doesn't refit the random Forest model at all, but instead uses the information in fit to generate predictions for new observations provided to argument newdata. Hence I am somewhat confused as to what you mean by this question. Is this just a misunderstanding of what the predict() method is doing or is your question more subtle than that? If the latter you will need to rephrase your question with more detail of what you foresee as your problem.
Mar
26
reviewed Leave Closed ParagraphVector od doc2vec for classification tasks
Mar
26
reviewed Close clustering evaluation with mixed data
Mar
26
reviewed Edit Difficulty plotting regression in R
Mar
26
revised Difficulty plotting regression in R
fix up the markup
Mar
26
reviewed Close How many random voting machines must be validated to be certain they are not biased?
Mar
25
comment Is there any argument in GAM function (R software) to tell the model which variables are categorical or continuous?
If you coerce categorical variables to factors (via factor() or ordered()) in a data processing step before you fit the model, gam() or any other R modelling function that uses a formula and works via model.frame() and model.matrix() (i.e. most of them!) will work all this out for you. Just get your data types in order first, then fit the model. This isn't something you should be declaring at model-fitting time.
Mar
25
comment Doesn't Factor Analysis always overfit on a theoretical basis
Why PCA in the title but then Factor analysis in the question. To my mind these are not the same thing.
Mar
24
awarded  Constituent
Mar
22
reviewed Leave Open How to define the maximum number of hidden neurons in neural networks?
Mar
22
reviewed Close Are the IREP and RIPPER algorithms considered Inductive Logic Programming?