manufacture

import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
train = pd.read_excel(r"C:\Users\Administrator\Desktop\jimsir\天池大赛\manufacture\data_first\train.xlsx")
# 数据概览
train.head()
IDTOOL_ID210X1210X2210X3210X4210X5210X6210X7210X8...750X1444750X1445750X1446750X1447750X1448750X1449750X1450750X1451750X1452Y
0ID001N102.050.4650.271.43067.454.620-0.54-1.05...0.000720.0007225.70.000720.0007225.70.000720.000722.400000e+122.945079
1ID002M100.950.8050.223.47762.083.412-2.121.02...0.000720.0007225.50.000720.0007225.50.000720.000722.400000e+122.955092
2ID003L98.560.5550.241.17256.703.080-2.250.88...0.000640.0006425.20.000640.0006425.20.000640.000642.400000e+122.741264
3ID004M100.350.9010.223.63162.253.949-1.980.82...0.000720.0007226.40.000720.0007226.40.000720.000722.400000e+122.799336
4ID005M100.250.8540.233.42961.423.630-1.891.02...0.000720.0007226.40.000720.0007226.40.000720.000722.400000e+122.692093

5 rows × 8029 columns

train.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 500 entries, 0 to 499
Columns: 8029 entries, ID to Y
dtypes: float64(6279), int64(1739), object(11)
memory usage: 30.6+ MB
train.describe() # 可以观察空值的数量
210X1210X2210X3210X4210X5210X6210X7210X8210X9210X10...750X1444750X1445750X1446750X1447750X1448750X1449750X1450750X1451750X1452Y
count500.000000500.000000500.000000500.000000500.000000500.000000500.000000500.000000500.000000500.000000...486.000000486.000000486.000000486.000000486.000000486.000000486.000000486.0000004.860000e+02500.000000
mean92.2724200.5119320.2324201.62622857.1261603.424444-0.4285800.267060-0.02754025.854000...0.0006940.00069426.0107000.0006940.00069426.0107000.0006940.0006942.400000e+122.846187
std27.4714340.2332650.1045361.09026718.2241571.1484601.1887661.0928230.1202681.908069...0.0000450.0000450.3494450.0000450.0000450.3494450.0000450.0000450.000000e+000.200970
min0.0000000.0000000.0000000.0000000.0000000.000000-2.450000-1.920000-0.2200000.000000...0.0005400.00054024.9000000.0005400.00054024.9000000.0005400.0005402.400000e+122.326846
25%100.1000000.3657500.2100001.01975056.5750003.242000-1.912500-0.670000-0.14000024.400000...0.0006700.00067025.8000000.0006700.00067025.8000000.0006700.0006702.400000e+122.705686
50%101.3000000.5060000.2400001.29300062.1300003.616000-0.1850000.400000-0.01500026.000000...0.0006900.00069026.0000000.0006900.00069026.0000000.0006900.0006902.400000e+122.840442
75%101.7500000.6122500.2700001.92575067.2500003.8642500.2850001.2200000.08000027.000000...0.0007300.00073026.3000000.0007300.00073026.3000000.0007300.0007302.400000e+122.980399
max102.8000000.9700000.4100003.89100071.9800005.1730002.1900002.2300000.17000029.400000...0.0008800.00088027.1000000.0008800.00088027.1000000.0008800.0008802.400000e+123.454556

8 rows × 8018 columns

train_describe = train.describe()
np.sum(train_describe.loc['count'] != 500)
2238
sns.distplot(train_describe.loc['count'])
<matplotlib.axes._subplots.AxesSubplot at 0xf464088>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-s7qxMm7P-1571391706490)(output_6_1.png)]

train_describe.loc['count'] == 0
210X1       False
210X2       False
210X3       False
210X4       False
210X5       False
            ...  
750X1449    False
750X1450    False
750X1451    False
750X1452    False
Y           False
Name: count, Length: 8018, dtype: bool
print('all missing',np.sum(train_describe.loc['count'] == 0),'\nSeriously missing',np.sum(((train_describe.loc['count'] <=250)&(train_describe.loc['count'] > 0))))
all missing 62 
Seriously missing 136
print(np.sum(((train_describe.loc['count'] == 222))))
135
train_cols_allnull = train_describe.columns[train_describe.loc['count'] == 0]
train_cols_allnull
Index(['220X150', '220X151', '340X12', '340X14', '340X16', '340X32', '340X50',
       '340X52', '340X54', '340X56', '340X58', '340X60', '340X62', '340X64',
       '340X66', '340X68', '340X70', '340X72', '340X74', '340X76', '340X78',
       '340X80', '340X82', '340X84', '340X86', '340X88', '340X90', '340X92',
       '340X94', '340X96', '340X98', '340X100', '340X102', '340X104',
       '340X106', '340X112', '340X114', '340X116', '340X118', '340X120',
       '340X122', '340X131', '340X142', '340X144', '340X146', '340X148',
       '340X150', '340X152', '340X154', '340X156', '340X158', '340X160',
       '340X162', '340X164', '340X166', '340X168', '340X170', '340X172',
       '340X174', '340X176', '340X178', '340X180'],
      dtype='object')
list(set(train.columns) - set(train_cols_allnull))
['330X1069',
 '330X393',
 '750X1150',
 '312X707',
 '344X184',
 '360X643',
 '400X217',
 '750X290',
 '360X185',
 '360X1257',
 '220X376',
   ......
 '750X1261',
 '330X496',
 '311X160',
 '750X616',
 '261X656',
 '312X531',
 '440AX33',
 '750X907',
 ...]
train_step2 = train[list(set(train.columns) - set(train_cols_allnull))] # 非全空的列
tmp = train_describe.columns[train_describe.loc['count'] == 222]
tmp
Index(['312X5', '312X10', '312X15', '312X20', '312X25', '312X30', '312X35',
       '312X40', '312X45', '312X50',
       ...
       '312X744', '312X750', '312X756', '312X762', '312X768', '312X774',
       '312X780', '312X786', '312X792', '312X798'],
      dtype='object', length=135)
null_222 = train_step2[tmp]
null_222
312X5312X10312X15312X20312X25312X30312X35312X40312X45312X50...312X744312X750312X756312X762312X768312X774312X780312X786312X792312X798
0NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
1NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
2NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
3NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
4NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
..................................................................
495NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
496100.0100.0100.0100.0100.0100.0100.0100.0100.0100.0...107.7110.025.0110.0110.1110.0101.5101.6101.5110.0
497100.0100.0100.0100.0100.0100.0100.0100.0100.0100.0...107.3110.025.0109.9110.0109.9101.9101.9101.7110.0
498100.0100.0100.0100.0100.0100.0100.0100.0100.0100.0...105.4110.025.0108.8108.9108.899.9100.099.8110.0
499100.0100.0100.0100.0100.0100.0100.0100.0100.0100.0...106.1110.025.0110.1110.1110.0101.8101.9101.7110.0

500 rows × 135 columns

np.sum(np.sum(null_222[null_222['312X5']>0].isnull()))
0
null_222[null_222['312X5']>0]

312X5312X10312X15312X20312X25312X30312X35312X40312X45312X50...312X744312X750312X756312X762312X768312X774312X780312X786312X792312X798
7100.0100.0100.0100.0100.0100.0100.0100.0100.0100.0...105.9110.025.0110.1110.2110.0100.4100.4100.3110.0
8100.0100.0100.0100.0100.0100.0100.0100.0100.0100.0...107.5110.025.0110.1110.2110.0100.6100.6100.5110.0
9100.0100.0100.0100.0100.0100.0100.0100.0100.0100.0...105.9110.025.0110.1110.1110.0101.6101.7101.6110.0
10100.0100.0100.0100.0100.0100.0100.0100.0100.0100.0...106.0110.025.0110.1110.1110.0101.4101.7101.2110.0
24100.0100.0100.0100.0100.0100.0100.0100.0100.0100.0...104.4110.025.0110.0110.1109.998.798.998.7110.0
..................................................................
490100.0100.0100.0100.0100.0100.0100.0100.0100.0100.0...104.3110.025.0106.4106.5106.399.999.999.8110.0
496100.0100.0100.0100.0100.0100.0100.0100.0100.0100.0...107.7110.025.0110.0110.1110.0101.5101.6101.5110.0
497100.0100.0100.0100.0100.0100.0100.0100.0100.0100.0...107.3110.025.0109.9110.0109.9101.9101.9101.7110.0
498100.0100.0100.0100.0100.0100.0100.0100.0100.0100.0...105.4110.025.0108.8108.9108.899.9100.099.8110.0
499100.0100.0100.0100.0100.0100.0100.0100.0100.0100.0...106.1110.025.0110.1110.1110.0101.8101.9101.7110.0

222 rows × 135 columns

train_step2_null_222 = train_step2.loc[null_222[null_222['312X5']>0].index]
train_step2.shape
(500, 7967)
train_step2_null_222.shape
(222, 7967)
tools = []
for col in train_step2.columns:
    if 'T' in col:
        tools.append(col)
tools
['TOOL (#2)',
 'Tool (#1)',
 'TOOL_ID (#3)',
 'TOOL_ID (#2)',
 'Tool',
 'Tool (#2)',
 'TOOL',
 'TOOL (#1)',
 'TOOL_ID',
 'TOOL_ID (#1)',
 'Tool (#3)']
for tool in tools:
    print('For tool', tool, train_step2[tool].nunique(),train_step2_null_222[tool].nunique())
For tool TOOL (#2) 2 2
For tool Tool (#1) 8 6
For tool TOOL_ID (#3) 2 2
For tool TOOL_ID (#2) 3 3
For tool Tool 2 2
For tool Tool (#2) 3 3
For tool TOOL 3 3
For tool TOOL (#1) 2 1
For tool TOOL_ID 6 6
For tool TOOL_ID (#1) 2 2
For tool Tool (#3) 10 10
train_step2_null_222['Tool (#1)'].unique()
array([ 530, 1113, 1018, 1110, 1245, 2823], dtype=int64)
train_step2['Tool (#1)'].unique()
array([ 329,  215,  530, 1113, 1018, 1110, 1245, 2823], dtype=int64)
np.sum(train_step2['Tool (#1)'] == 215)
141
np.sum(train_step2['Tool (#1)'] == 329)
137
500-278
222
test_A=pd.read_excel(r"C:\Users\Administrator\Desktop\jimsir\天池大赛\manufacture\data_first\testA.xlsx")
test_A['Tool (#1)'].unique()
array([2823,  215,  329, 1110,  530, 1113, 1245,  206, 1018], dtype=int64)
test_A[((test_A['Tool (#1)'] == 215) | (test_A['Tool (#1)'] == 329) |(test_A['Tool (#1)'] == 206) )].shape
(35, 8028)
np.sum(np.sum(test_A[(test_A['Tool (#1)'] == 215) | (test_A['Tool (#1)'] == 329) |(test_A['Tool (#1)'] == 206)][tmp].isnull()))
4725
4275/35
122.14285714285714
np.sum(np.sum(test_A[(test_A['Tool (#1)'] != 215) & (test_A['Tool (#1)'] != 329) &(test_A['Tool (#1)'] != 206)][tmp].isnull()))
0
sns.distplot(train_step2[train_step2['Tool (#1)'] == 215]['Y'])
<matplotlib.axes._subplots.AxesSubplot at 0xf464dc8>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-a5L44uzJ-1571391706493)(output_34_1.png)]

sns.distplot(train_step2[train_step2['Tool (#1)'] == 329]['Y'])
<matplotlib.axes._subplots.AxesSubplot at 0xf916688>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-YEQvZCnt-1571391706494)(output_35_1.png)]

sns.distplot(train_step2[((train_step2['Tool (#1)'] != 329) & (train_step2['Tool (#1)'] != 215))]['Y'])
<matplotlib.axes._subplots.AxesSubplot at 0x165d83c8>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-zhI7VJSm-1571391706494)(output_36_1.png)]

from sklearn.metrics import mean_squared_error
train['Y'].median()
2.8404417463190392
pred = train_step2['Y'].copy()
a=train_step2[train_step2['Tool (#1)'] == 329]
b = train_step2[train_step2['Tool (#1)'] == 215]
c = train_step2[((train_step2['Tool (#1)'] != 215)&(train_step2['Tool (#1)'] != 329))]
pred.loc[a.index] = a['Y'].median()
pred.loc[b.index] = b['Y'].median()
pred.loc[c.index] = c['Y'].median()
pred.value_counts()
2.779034    222
2.891122    141
2.882981    137
Name: Y, dtype: int64
mean_squared_error(train_step2['Y'], pred)
0.03848814140862121
mean_squared_error(y_pred=pred,y_true=train_step2['Y'])
0.03848814140862121
train_step2['Tool (#1)'].value_counts()
215     141
329     137
1110     59
2823     55
1245     46
1018     23
1113     22
530      17
Name: Tool (#1), dtype: int64
pred= train_step2['Y'].copy()
for val in train_step2['Tool (#1)'].unique():
    print(val, train_step2[train_step2['Tool (#1)'] == val].shape[0])
    pred.loc[train_step2[train_step2['Tool (#1)'] == val].index] = train_step2[train_step2['Tool (#1)'] == val]['Y'].mean()
329 137
215 141
530 17
1113 22
1018 23
1110 59
1245 46
2823 55
mean_squared_error(y_pred=pred, y_true=train_step2['Y'])
0.03805754994694719
np.sum(train_describe.loc['min'] == train_describe.loc['max'])
1041
train_cols_allsame = train_describe.columns[train_describe.loc['min'] == train_describe.loc['max']]
train_cols_allsame
Index(['210X17', '210X31', '210X38', '210X79', '210X103', '210X196', '210X197',
       '210X198', '210X227', '220X1',
       ...
       '750X1399', '750X1400', '750X1401', '750X1403', '750X1404', '750X1406',
       '750X1407', '750X1408', '750X1442', '750X1452'],
      dtype='object', length=1041)
test_A_describe = test_A.describe()
np.sum(test_A_describe.loc['min'] == test_A_describe.loc['max'])
1080
test_A_cols_allsame = test_A_describe.columns[test_A_describe.loc['min'] == test_A_describe.loc['max']]
train_minus_test = set(train_cols_allsame) - set(test_A_cols_allsame)
both_allsame = set(train_cols_allsame) - set(train_minus_test)
len(train_cols_allsame)
1041
len(test_A_cols_allsame)
1080
len(train_minus_test)
22
len(both_allsame)
1019
len(set(train_step2.columns))
7967
cols = set(train_step2.columns) - both_allsame
train_step3 = train_step2[list(cols)]
tools
['TOOL (#2)',
 'Tool (#1)',
 'TOOL_ID (#3)',
 'TOOL_ID (#2)',
 'Tool',
 'Tool (#2)',
 'TOOL',
 'TOOL (#1)',
 'TOOL_ID',
 'TOOL_ID (#1)',
 'Tool (#3)']
train_tool = train[tools]
from sklearn.preprocessing import LabelEncoder

labelEncoder = LabelEncoder()
a_list = ['a'] * 2 + ['b']*3 + ['c','b']
print(a_list)
labelEncoder.fit_transform(a_list)
['a', 'a', 'b', 'b', 'b', 'c', 'b']





array([0, 0, 1, 1, 1, 2, 1], dtype=int64)
from sklearn.preprocessing import LabelEncoder

for tool in tools:
    lb = LabelEncoder()
    lb.fit(train_tool[tool])
    train_tool.loc[:,tool] = lb.transform(train_tool[tool])
D:\Anaconda3\envs\python3\lib\site-packages\pandas\core\indexing.py:494: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  self.obj[item] = s
D:\Anaconda3\envs\python3\lib\site-packages\pandas\core\indexing.py:576: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  self.obj[item_labels[indexer[info_axis]]] = value
train.shape
(500, 8029)
train_describe.shape
(8, 8018)

#结合交叉验证,构建随机森林模型
from sklearn import model_selection
from sklearn.ensemble import RandomForestRegressor
from sklearn.model_selection import train_test_split
rf = RandomForestRegressor(n_estimators=200,min_samples_leaf=6,min_samples_split=6)
val = model_selection.cross_val_score(rf,train_tool,train['Y'].values,cv=10,scoring='neg_mean_squared_error')

# 评估
print(val)
print(np.mean(val))
[-0.03544356 -0.02205482 -0.03145397 -0.05643132 -0.02725092 -0.04143731
 -0.02598229 -0.03891663 -0.03350271 -0.03271177]
-0.03451853149088352
train_tool_dummy = train_tool.copy()
for tool in tools:
    train_tool_dummy = pd.get_dummies(data=train_tool_dummy, columns=[tool])
val = model_selection.cross_val_score(rf, train_tool_dummy,train['Y'].values,cv=10,scoring='neg_mean_squared_error')
np.mean(val)
-0.033536821368123956
# 利用train_test_split重新训练模型
from sklearn.model_selection import train_test_split
train_X, test_X, train_Y, test_Y = train_test_split(train_tool_dummy,train['Y'].values, test_size=0.3)
rf=RandomForestRegressor(n_estimators=200,min_samples_leaf=6,min_samples_split=6)
rf.fit(train_X, train_Y)
RandomForestRegressor(bootstrap=True, criterion='mse', max_depth=None,
                      max_features='auto', max_leaf_nodes=None,
                      min_impurity_decrease=0.0, min_impurity_split=None,
                      min_samples_leaf=6, min_samples_split=6,
                      min_weight_fraction_leaf=0.0, n_estimators=200,
                      n_jobs=None, oob_score=False, random_state=None,
                      verbose=0, warm_start=False)
#评估
pred = rf.predict(test_X)
mean_squared_error(y_pred=pred,y_true=test_Y)
0.03561266686805807
compare = pd.DataFrame({'y_pred':pred,'y_true':test_Y})
compare['diff'] = compare['y_true'] - compare['y_pred']
compare.sort_values('diff')
y_predy_truediff
532.9416842.485652-0.456033
1392.9849272.569413-0.415514
1452.7286782.350377-0.378301
842.8608192.491770-0.369049
1212.7579002.397770-0.360130
............
1132.8368993.2304930.393593
452.8285293.2321690.403640
1202.9029243.3214330.418509
202.7873063.2708210.483515
1252.7458933.2384020.492509

150 rows × 3 columns

train_X, test_X, train_Y, test_Y = train_test_split(train_tool_dummy,train['Y'].values, test_size=0.3)
rf=RandomForestRegressor(n_estimators=200,min_samples_leaf=6,min_samples_split=6)
rf.fit(train_X, train_Y)
RandomForestRegressor(bootstrap=True, criterion='mse', max_depth=None,
                      max_features='auto', max_leaf_nodes=None,
                      min_impurity_decrease=0.0, min_impurity_split=None,
                      min_samples_leaf=6, min_samples_split=6,
                      min_weight_fraction_leaf=0.0, n_estimators=200,
                      n_jobs=None, oob_score=False, random_state=None,
                      verbose=0, warm_start=False)
for i in range(len(train_tool.columns)):
    print(train_tool.columns[i],rf.feature_importances_[i])
TOOL (#2) 0.0
Tool (#1) 0.0
TOOL_ID (#3) 0.04977919950874401
TOOL_ID (#2) 0.034050966856127914
Tool 0.0006262455932305422
Tool (#2) 0.0
TOOL 0.00987126347542283
TOOL (#1) 0.002039560967227642
TOOL_ID 0.008330845725601452
TOOL_ID (#1) 0.01961358235658726
Tool (#3) 0.014775338277854095
train_corr = train_step3.corr()
strong_linear_fea=[]
for col in train_corr.columns:
    if np.abs(train_corr.loc['Y',col]) >=0.1 and col != 'Y':
        strong_linear_fea.append(col)
strong_linear_fea
['330X1069',
 '330X393',
 '750X1150',
 '360X185',
 '261X352',
 '330X300',
 '520X260',
 '310X176',
 '750X197',
  ...
 '360X726',
 '420X90',
 '750X153',
 '360X1059',
 '330X557',
 '261X241',
 '330X1072',
 '210X152',
 '750X1389',
 '330X853',
 '750X164',
 '330X599',
 '750X869',
 ...]
train_tool_linear = train_tool_dummy.copy()
for col in strong_linear_fea:
    train_tool_linear[col] = train_step3[col]
train_tool_linear.fillna(-100,inplace=True)
rf=RandomForestRegressor(n_estimators=200,min_samples_leaf=5,min_samples_split=5)
val = model_selection.cross_val_score(rf, train_tool_dummy,train['Y'].values,cv=10,scoring='neg_mean_squared_error')
np.mean(val)
-0.0335044546686339
from sklearn.svm import SVR
train_tool_linear = train_tool_dummy.copy()
for col in strong_linear_fea:
    if np.max(train_step3[col]) == np.min(train_step3[col]):
        continue
    train_tool_linear[col] = (train_step3[col] - np.min(train_step3[col]))/(np.max(train_step3[col])-np.min(train_step3[col]))
    
sv = SVR(C=2.5)
train_tool_linear.fillna(-1,inplace=True)
val = model_selection.cross_val_score(sv,train_tool_linear,train['Y'].values,cv=10,scoring='neg_mean_squared_error')

#评估
np.mean(val)
D:\Anaconda3\envs\python3\lib\site-packages\sklearn\svm\base.py:193: FutureWarning: The default value of gamma will change from 'auto' to 'scale' in version 0.22 to account better for unscaled features. Set gamma explicitly to 'auto' or 'scale' to avoid this warning.
  "avoid this warning.", FutureWarning)
D:\Anaconda3\envs\python3\lib\site-packages\sklearn\svm\base.py:193: FutureWarning: The default value of gamma will change from 'auto' to 'scale' in version 0.22 to account better for unscaled features. Set gamma explicitly to 'auto' or 'scale' to avoid this warning.
  "avoid this warning.", FutureWarning)
D:\Anaconda3\envs\python3\lib\site-packages\sklearn\svm\base.py:193: FutureWarning: The default value of gamma will change from 'auto' to 'scale' in version 0.22 to account better for unscaled features. Set gamma explicitly to 'auto' or 'scale' to avoid this warning.
  "avoid this warning.", FutureWarning)
D:\Anaconda3\envs\python3\lib\site-packages\sklearn\svm\base.py:193: FutureWarning: The default value of gamma will change from 'auto' to 'scale' in version 0.22 to account better for unscaled features. Set gamma explicitly to 'auto' or 'scale' to avoid this warning.
  "avoid this warning.", FutureWarning)
D:\Anaconda3\envs\python3\lib\site-packages\sklearn\svm\base.py:193: FutureWarning: The default value of gamma will change from 'auto' to 'scale' in version 0.22 to account better for unscaled features. Set gamma explicitly to 'auto' or 'scale' to avoid this warning.
  "avoid this warning.", FutureWarning)
D:\Anaconda3\envs\python3\lib\site-packages\sklearn\svm\base.py:193: FutureWarning: The default value of gamma will change from 'auto' to 'scale' in version 0.22 to account better for unscaled features. Set gamma explicitly to 'auto' or 'scale' to avoid this warning.
  "avoid this warning.", FutureWarning)
D:\Anaconda3\envs\python3\lib\site-packages\sklearn\svm\base.py:193: FutureWarning: The default value of gamma will change from 'auto' to 'scale' in version 0.22 to account better for unscaled features. Set gamma explicitly to 'auto' or 'scale' to avoid this warning.
  "avoid this warning.", FutureWarning)
D:\Anaconda3\envs\python3\lib\site-packages\sklearn\svm\base.py:193: FutureWarning: The default value of gamma will change from 'auto' to 'scale' in version 0.22 to account better for unscaled features. Set gamma explicitly to 'auto' or 'scale' to avoid this warning.
  "avoid this warning.", FutureWarning)
D:\Anaconda3\envs\python3\lib\site-packages\sklearn\svm\base.py:193: FutureWarning: The default value of gamma will change from 'auto' to 'scale' in version 0.22 to account better for unscaled features. Set gamma explicitly to 'auto' or 'scale' to avoid this warning.
  "avoid this warning.", FutureWarning)
D:\Anaconda3\envs\python3\lib\site-packages\sklearn\svm\base.py:193: FutureWarning: The default value of gamma will change from 'auto' to 'scale' in version 0.22 to account better for unscaled features. Set gamma explicitly to 'auto' or 'scale' to avoid this warning.
  "avoid this warning.", FutureWarning)

-0.030984216663715352
  • 4
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值