Sales analysis last few days

The third day

1. csv file reads are far better than excel files faster;

2. range in panython3 is python2 in the xrange;

The fourth day

3. found 300 days Fitting a serious accuracy problems, have turned negative, first I have to deal with a negative value is 0, the situation remains, then, I began to suspect that fit their predict beyond the scope lead, but the discovery of x even predict and fit the same, y_predict still very far off the mark; then, so I suspect that is not what the data need to be standardized. Later I found standardScaler, stability data really good.

Generating an array of the same information

new_array = np.zeros((5,4)) for i in range(3): new_array[i] = np.array([0.25]*4)

Fifth day

scaler scaling problems

Scaler find a problem, before all your data scaler, found to have problems, the fact is that each row of data is scaled so that it can sense; but this can also be achieved with dimensions scaled, can predict the data back; or because of the dimension problem and can not be scaled back;

But another problem has come; the problem is the forecast for this scaling is only temporary and thus narrow the gap by reducing the data to improve the accuracy; but in fact scaled back once, ie after amplification, found that the gap is still very obvious. I think the problem is actually forecasting a standardized meaning not great; classification scale field sense is relatively large, this is because in the calculation of the scaling variable weights may be reduced because of the different dimensions resulting from heavy influence from above; but is different in the regression above.

Dimensionality reduction

1 liter of 2-dimensional data dimension, is achieved by reshape (-1,1); two-dimensional one-dimensional reduction () can be achieved by np.array.flatten.

It can also be achieved by way of a for statement:

X=[[[1,2,3],[3,4,5]]]

X = [x for y in X for x in y]

print(X)

X = [x for y in X for x in y]

print(X)

output:

[[1, 2, 3], [3, 4, 5]] [1, 2, 3, 3, 4, 5]

Sixth day

Later, I decided to look at our positioning system data filtering

ravel()

The multidimensional array dimensionality reduction is a one-dimensional array.

z = np.array ([[[[3]]], [[[3]]]]) z.ravel ()

array([3, 3])

Guess you like

Origin www.cnblogs.com/xiashiwendao/p/11257092.html