Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dependencies.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Note all install methods after "main" take
<main>
<h5py/>
<numpy>1.26</numpy>
<scipy>1.12</scipy>
<scikit-learn>1.1</scikit-learn>
<scipy>1.14</scipy>
<scikit-learn>1.3</scikit-learn>
<pandas/>
<!-- Note most versions of xarray work, but some (such as 0.20) don't -->
<xarray/>
Expand Down
4 changes: 2 additions & 2 deletions ravenframework/SupervisedLearning/ARMA.py
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ def _trainFourier(self, pivotValues, periods, values, masks=None,target=None):
# 1: cos(2pi*t/period[0]),
# 2: sin(2pi*t/period[1]),
# 3: cos(2pi*t/period[1]), ...
fourierEngine = sklearn.linear_model.LinearRegression(normalize=False)
fourierEngine = sklearn.linear_model.LinearRegression()
fourierSignals = fourierSignalsFull[masks, :]
values = values[masks]
# check collinearity
Expand All @@ -1209,7 +1209,7 @@ def _trainFourier(self, pivotValues, periods, values, masks=None,target=None):
coeffs = np.zeros(F2)
for fn in range(F2):
fSignal = fourierSignals[:,fn]
eng = sklearn.linear_model.LinearRegression(normalize=False)
eng = sklearn.linear_model.LinearRegression()
eng.fit(fSignal.reshape(H,1), signalToFit)
thisIntercept = eng.intercept_
thisCoeff = eng.coef_[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LinearRegression(ScikitLearnBase):
"""
Ordinary least squares Linear Regression.
"""
info = {'problemtype':'regression', 'normalize':False}
info = {'problemtype':'regression'}

def __init__(self):
"""
Expand Down Expand Up @@ -70,9 +70,7 @@ class cls.
descr=r"""Whether the intercept should be estimated or not. If False,
the data is assumed to be already centered.""", default=True))
specs.addSub(InputData.parameterInputFactory("normalize", contentType=InputTypes.BoolType,
descr=r"""This parameter is ignored when fit_intercept is set to False. If True,
the regressors X will be normalized before regression by subtracting the mean and
dividing by the l2-norm.""", default=False))
descr=r"""This parameter is deprecated and ignored."""))
# New in sklearn version 0.24
# specs.addSub(InputData.parameterInputFactory("positive", contentType=InputTypes.BoolType,
# descr=r"""When set to True, forces the coefficients to be positive.""", default=False))
Expand All @@ -85,7 +83,11 @@ def _handleInput(self, paramInput):
@ Out, None
"""
super()._handleInput(paramInput)
settings, notFound = paramInput.findNodesAndExtractValues(['fit_intercept','normalize'])
settings, notFound = paramInput.findNodesAndExtractValues(['fit_intercept'])
# notFound must be empty
assert(not notFound)
oldSettings, oldNotFound = paramInput.findNodesAndExtractValues(['normalize'])
if not oldNotFound:
self.raiseAWarning("Deprecated setting found: "+str(oldSettings))
self.raiseAnError(IOError,"Deprecated setting found: "+str(oldSettings))
self.initializeModel(settings)
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def _localNormalizeData(self,values,names,feat):
@ In, feat, string, feature to (not) normalize
@ Out, None
"""
if not self.info['normalize']:
if 'normalize' in self.info and not self.info['normalize']:
self.muAndSigmaFeatures[feat] = (0.0,1.0)
else:
super()._localNormalizeData(values,names,feat)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<Features>x1,x2</Features>
<Target>ans</Target>
<fit_intercept>True</fit_intercept>
<normalize>True</normalize>
</ROM>
<PostProcessor name="pp1" subType="CrossValidation">
<SciKitLearn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<Features>x1,x2</Features>
<Target>ans</Target>
<fit_intercept>True</fit_intercept>
<normalize>True</normalize>
</ROM>
<PostProcessor name="pp1" subType="CrossValidation">
<SciKitLearn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<Features>x1,x2</Features>
<Target>ans</Target>
<fit_intercept>True</fit_intercept>
<normalize>True</normalize>
</ROM>
<PostProcessor name="pp1" subType="CrossValidation">
<SciKitLearn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<Features>x1,x2</Features>
<Target>ans</Target>
<fit_intercept>True</fit_intercept>
<normalize>True</normalize>
</ROM>
<PostProcessor name="pp1" subType="CrossValidation">
<SciKitLearn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<Features>x1,x2</Features>
<Target>ans</Target>
<fit_intercept>True</fit_intercept>
<normalize>True</normalize>
</ROM>
<PostProcessor name="pp1" subType="CrossValidation">
<SciKitLearn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<Features>x1,x2</Features>
<Target>ans</Target>
<fit_intercept>True</fit_intercept>
<normalize>True</normalize>
</ROM>
<PostProcessor name="pp1" subType="CrossValidation">
<SciKitLearn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<Features>x1,x2</Features>
<Target>ans</Target>
<fit_intercept>True</fit_intercept>
<normalize>True</normalize>
</ROM>
<PostProcessor name="pp1" subType="CrossValidation">
<SciKitLearn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<Features>x1,x2</Features>
<Target>ans</Target>
<fit_intercept>True</fit_intercept>
<normalize>True</normalize>
</ROM>
<PostProcessor name="pp1" subType="CrossValidation">
<SciKitLearn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<Features>x1,x2</Features>
<Target>ans</Target>
<fit_intercept>True</fit_intercept>
<normalize>True</normalize>
</ROM>
<PostProcessor name="pp1" subType="CrossValidation">
<SciKitLearn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<Features>x1,x2</Features>
<Target>ans</Target>
<fit_intercept>True</fit_intercept>
<normalize>True</normalize>
</ROM>
<PostProcessor name="pp1" subType="CrossValidation">
<SciKitLearn>
Expand Down