65add949bbcd61e2b1c3b8dc33390ac15d19cd84,linearmodels/shared/linalg.py,,has_constant,#Any#Any#,9
Before Change
has_const = has_const or rank < min(x.shape)
loc = None
if has_const:
out = lstsq(x, np.ones((n, 1)), rcond=None)
beta = out[0].ravel()
loc = int(np.argmax(np.abs(beta) * x.var(0)))
return bool(has_const), loc
After Change
loc = None
if has_const:
normed_var = x.var(0) / np.abs(x).max(0)
loc = int(np.argmin(normed_var))
return bool(has_const), loc
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: bashtage/linearmodels
Commit Name: 65add949bbcd61e2b1c3b8dc33390ac15d19cd84
Time: 2021-02-22
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/shared/linalg.py
Class Name:
Method Name: has_constant
Project Name: Pinafore/qb
Commit Name: 9d22742baeeb608bac5594c3ece96f62f0734dce
Time: 2017-05-13
Author: sjtufs@gmail.com
File Name: qanta/buzzer/trainer.py
Class Name: Trainer
Method Name: test
Project Name: wenwei202/iss-rnns
Commit Name: 00d47eb3923d8722f75d56ba15139ad6821e2f50
Time: 2016-08-29
Author: seominjoon@gmail.com
File Name: basic/evaluator.py
Class Name: AccuracyEvaluator2
Method Name: compare