问题:如何在不手动跟踪输入线性回归的特征顺序的情况下找出输出系数属于哪个特征
我有一个具有以下功能的数据集。
awk 'match($0, /[(]/) {print substr($0, 1,RSTART-1)}' file
hackeur -euse
huppe
huque
hure
包含 #include <windows.h>
#include <mmsystem.h>
int main ()
{
PlaySound(TEXT("my.wav"), NULL, SND_FILENAME);
}
和 ||=== Build: Debug in sound test (compiler: GNU GCC Compiler) ===|
||Warning: resolving _SetUnhandledExceptionFilter@4 by linking to _SetUnhandledExceptionFilter|
||Warning: resolving _ExitProcess@4 by linking to _ExitProcess|
||Warning: resolving _GetModuleHandleA@4 by linking to _GetModuleHandleA|
||Warning: resolving _GetProcAddress@8 by linking to _GetProcAddress|
||Warning: resolving _FreeLibrary@4 by linking to _FreeLibrary|
||Warning: resolving _PlaySoundA@12 by linking to _PlaySoundA|
||Warning: resolving _GetCommandLineA@0 by linking to _GetCommandLineA|
||Warning: resolving _EnterCriticalSection@4 by linking to _EnterCriticalSection|
||Warning: resolving _TlsGetValue@4 by linking to _TlsGetValue|
||Warning: resolving _GetLastError@0 by linking to _GetLastError|
||Warning: resolving _LeaveCriticalSection@4 by linking to _LeaveCriticalSection|
||Warning: resolving _DeleteCriticalSection@4 by linking to _DeleteCriticalSection|
||Warning: resolving _InitializeCriticalSection@4 by linking to _InitializeCriticalSection|
||Warning: resolving _VirtualQuery@12 by linking to _VirtualQuery|
||Warning: resolving _VirtualProtect@16 by linking to _VirtualProtect|
||Warning: resolving _FindFirstFileA@8 by linking to _FindFirstFileA|
||Warning: resolving _FindNextFileA@8 by linking to _FindNextFileA|
||Warning: resolving _FindClose@4 by linking to _FindClose|
c:\mingw\bin\..\lib\gcc\mingw32\6.3.0\crtbegin.o:cygming-crtbegin.c|| undefined reference to `LoadLibraryA@4'|
||error: ld returned 1 exit status|
||=== Build failed: 2 error(s), 18 warning(s) (0 minute(s), 0 second(s)) ===|
。
我usertype
数据。
Subscriber
我使用 sklearn Customer
进行预处理并适合线性回归
train_test_split
我在用 feature = ['age','usertype','gender']
X = citibike_dropped[feature]
y = citibike_dropped['tripduration']
X_train, X_test, y_train, y_test = train_test_split(X,y,random_state=123)
拟合 Pipeline
后检查系数
ct = ColumnTransformer(
[('ohe',OneHotEncoder(handle_unknown = 'ignore'),['usertype']),
('scaler',MinMaxScaler(),['age'])],
remainder = 'passthrough')
lr = LinearRegression()
Input = [('transformer',ct),('clf',lr)]
pipe = Pipeline(Input)
输出
pipe
如何知道上述系数属于哪个特征?**