Class: Rust::Models::Regression::LinearRegressionModel

Inherits:
RegressionModel show all
Defined in:
lib/rust/models/regression.rb

Class Method Summary collapse

Methods inherited from RegressionModel

#actuals, #coefficients, #fitted, #initialize, #load_in_r_as, #method_missing, #model, #mse, #r_2, #r_2_adjusted, #r_hash, #residuals, #summary

Methods inherited from RustDatatype

#load_in_r_as, pull_priority, #r_hash, #r_mirror, #r_mirror_to

Constructor Details

This class inherits a constructor from Rust::Models::Regression::RegressionModel

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Rust::Models::Regression::RegressionModel

Class Method Details

.can_pull?(type, klass) ⇒ Boolean

Returns:

  • (Boolean)


105
106
107
# File 'lib/rust/models/regression.rb', line 105

def self.can_pull?(type, klass)
    return type == "list" && klass == "lm"
end

.generate(dependent_variable, independent_variables, data, **options) ⇒ Object



115
116
117
118
119
120
121
122
123
124
# File 'lib/rust/models/regression.rb', line 115

def self.generate(dependent_variable, independent_variables, data, **options)
    RegressionModel.generate(
        LinearRegressionModel,
        "lm", 
        dependent_variable, 
        independent_variables, 
        data, 
        **options
    )
end

.pull_variable(variable, type, klass) ⇒ Object



109
110
111
112
113
# File 'lib/rust/models/regression.rb', line 109

def self.pull_variable(variable, type, klass)
    model = Rust::RustDatatype.pull_variable(variable, Rust::List)
    
    return LinearRegressionModel.new(model)
end