openGPMP
Open Source Mathematics Package
ml.py
Go to the documentation of this file.
1 # This file was automatically generated by SWIG (https://www.swig.org).
2 # Version 4.1.0
3 #
4 # Do not make changes to this file unless you know what you are doing - modify
5 # the SWIG interface file instead.
6 
7 from sys import version_info as _swig_python_version_info
8 # Import the low-level C/C++ module
9 if __package__ or "." in __name__:
10  from . import _ml
11 else:
12  import _ml
13 
14 try:
15  import builtins as __builtin__
16 except ImportError:
17  import __builtin__
18 
19 def _swig_repr(self):
20  try:
21  strthis = "proxy of " + self.this.__repr__()
22  except __builtin__.Exception:
23  strthis = ""
24  return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
25 
26 
27 def _swig_setattr_nondynamic_instance_variable(set):
28  def set_instance_attr(self, name, value):
29  if name == "this":
30  set(self, name, value)
31  elif name == "thisown":
32  self.this.own(value)
33  elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
34  set(self, name, value)
35  else:
36  raise AttributeError("You cannot add instance attributes to %s" % self)
37  return set_instance_attr
38 
39 
40 def _swig_setattr_nondynamic_class_variable(set):
41  def set_class_attr(cls, name, value):
42  if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
43  set(cls, name, value)
44  else:
45  raise AttributeError("You cannot add class attributes to %s" % cls)
46  return set_class_attr
47 
48 
49 def _swig_add_metaclass(metaclass):
50  """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
51  def wrapper(cls):
52  return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
53  return wrapper
54 
55 
56 class _SwigNonDynamicMeta(type):
57  """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
58  __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)
59 
60 
61 class SwigPyIterator(object):
62  thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
63 
64  def __init__(self, *args, **kwargs):
65  raise AttributeError("No constructor defined - class is abstract")
66  __repr__ = _swig_repr
67  __swig_destroy__ = _ml.delete_SwigPyIterator
68 
69  def value(self):
70  return _ml.SwigPyIterator_value(self)
71 
72  def incr(self, n=1):
73  return _ml.SwigPyIterator_incr(self, n)
74 
75  def decr(self, n=1):
76  return _ml.SwigPyIterator_decr(self, n)
77 
78  def distance(self, x):
79  return _ml.SwigPyIterator_distance(self, x)
80 
81  def equal(self, x):
82  return _ml.SwigPyIterator_equal(self, x)
83 
84  def copy(self):
85  return _ml.SwigPyIterator_copy(self)
86 
87  def next(self):
88  return _ml.SwigPyIterator_next(self)
89 
90  def __next__(self):
91  return _ml.SwigPyIterator___next__(self)
92 
93  def previous(self):
94  return _ml.SwigPyIterator_previous(self)
95 
96  def advance(self, n):
97  return _ml.SwigPyIterator_advance(self, n)
98 
99  def __eq__(self, x):
100  return _ml.SwigPyIterator___eq__(self, x)
101 
102  def __ne__(self, x):
103  return _ml.SwigPyIterator___ne__(self, x)
104 
105  def __iadd__(self, n):
106  return _ml.SwigPyIterator___iadd__(self, n)
107 
108  def __isub__(self, n):
109  return _ml.SwigPyIterator___isub__(self, n)
110 
111  def __add__(self, n):
112  return _ml.SwigPyIterator___add__(self, n)
113 
114  def __sub__(self, *args):
115  return _ml.SwigPyIterator___sub__(self, *args)
116  def __iter__(self):
117  return self
118 
119 # Register SwigPyIterator in _ml:
120 _ml.SwigPyIterator_swigregister(SwigPyIterator)
121 class LinearRegression(object):
122  thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
123  __repr__ = _swig_repr
124  x = property(_ml.LinearRegression_x_get, _ml.LinearRegression_x_set)
125  y = property(_ml.LinearRegression_y_get, _ml.LinearRegression_y_set)
126  coeff = property(_ml.LinearRegression_coeff_get, _ml.LinearRegression_coeff_set)
127  constant = property(_ml.LinearRegression_constant_get, _ml.LinearRegression_constant_set)
128  sum_xy = property(_ml.LinearRegression_sum_xy_get, _ml.LinearRegression_sum_xy_set)
129  sum_x = property(_ml.LinearRegression_sum_x_get, _ml.LinearRegression_sum_x_set)
130  sum_y = property(_ml.LinearRegression_sum_y_get, _ml.LinearRegression_sum_y_set)
131  sum_x_square = property(_ml.LinearRegression_sum_x_square_get, _ml.LinearRegression_sum_x_square_set)
132  sum_y_square = property(_ml.LinearRegression_sum_y_square_get, _ml.LinearRegression_sum_y_square_set)
133  x_train = property(_ml.LinearRegression_x_train_get, _ml.LinearRegression_x_train_set)
134  y_train = property(_ml.LinearRegression_y_train_get, _ml.LinearRegression_y_train_set)
135  x_test = property(_ml.LinearRegression_x_test_get, _ml.LinearRegression_x_test_set)
136  y_test = property(_ml.LinearRegression_y_test_get, _ml.LinearRegression_y_test_set)
137 
138  def __init__(self):
139  _ml.LinearRegression_swiginit(self, _ml.new_LinearRegression())
140 
142  return _ml.LinearRegression_calculate_coeffecient(self)
143 
145  return _ml.LinearRegression_calculate_constant(self)
146 
147  def data_size(self):
148  return _ml.LinearRegression_data_size(self)
149 
151  return _ml.LinearRegression_return_coeffecient(self)
152 
153  def return_constant(self):
154  return _ml.LinearRegression_return_constant(self)
155 
156  def best_fit(self):
157  return _ml.LinearRegression_best_fit(self)
158 
159  def get_input(self, *args):
160  return _ml.LinearRegression_get_input(self, *args)
161 
162  def split_data(self, test_size, seed, shuffle):
163  return _ml.LinearRegression_split_data(self, test_size, seed, shuffle)
164 
165  def show_data(self):
166  return _ml.LinearRegression_show_data(self)
167 
168  def predict(self, *args):
169  return _ml.LinearRegression_predict(self, *args)
170 
171  def error_in(self, *args):
172  return _ml.LinearRegression_error_in(self, *args)
173 
174  def error_square(self):
175  return _ml.LinearRegression_error_square(self)
176 
177  def mse(self, x_data, y_data):
178  return _ml.LinearRegression_mse(self, x_data, y_data)
179 
180  def r_sqrd(self, x_data, y_data):
181  return _ml.LinearRegression_r_sqrd(self, x_data, y_data)
182 
183  def num_rows(self, input):
184  return _ml.LinearRegression_num_rows(self, input)
185  __swig_destroy__ = _ml.delete_LinearRegression
186 
187 # Register LinearRegression in _ml:
188 _ml.LinearRegression_swigregister(LinearRegression)
189 
def mse(self, x_data, y_data)
Definition: ml.py:177
def return_constant(self)
Definition: ml.py:153
def return_coeffecient(self)
Definition: ml.py:150
def calculate_constant(self)
Definition: ml.py:144
def split_data(self, test_size, seed, shuffle)
Definition: ml.py:162
def get_input(self, *args)
Definition: ml.py:159
def error_square(self)
Definition: ml.py:174
def predict(self, *args)
Definition: ml.py:168
def num_rows(self, input)
Definition: ml.py:183
def error_in(self, *args)
Definition: ml.py:171
def r_sqrd(self, x_data, y_data)
Definition: ml.py:180
def calculate_coeffecient(self)
Definition: ml.py:141