Human-Activity-Recognition--Using-Deep-NN icon indicating copy to clipboard operation
Human-Activity-Recognition--Using-Deep-NN copied to clipboard

throw some more light on the code

Open ariyurjana opened this issue 5 years ago • 2 comments

    def fit(self, X):
        # remove overlaping
        remove = int(X.shape[1] / 2)
        temp_X = X[:, -remove:, :]

Can you explain a bit more briefly as to why we are performing the above code ?

regards jana

ariyurjana avatar Jan 10 '20 11:01 ariyurjana

What version of python?

atomtony avatar Oct 30 '20 09:10 atomtony

Hi,

from sklearn.base import BaseEstimator, TransformerMixin
class scaling_tseries_data(BaseEstimator, TransformerMixin):
    from sklearn.preprocessing import StandardScaler
    def __init__(self):
        self.scale = None

    def transform(self, X):
        temp_X1 = X.reshape((X.shape[0] * X.shape[1], X.shape[2]))
        temp_X1 = self.scale.transform(temp_X1)
        return temp_X1.reshape(X.shape)

    def fit(self, X):
        # remove overlaping
        remove = int(X.shape[1] / 2)
        temp_X = X[:, -remove:, :]
        # flatten data
        temp_X = temp_X.reshape((temp_X.shape[0] *

temp_X.shape[1], temp_X.shape[2])) scale = StandardScaler() scale.fit(temp_X) ##saving for furter usage ## will use in predicton pipeline pickle.dump(scale,open('Scale_2class.p','wb')) self.scale = scale return self

My question is regarding these two lines

        remove = int(X.shape[1] / 2)
        temp_X = X[:, -remove:, :]

I understand that you are trying to split the data into two datasets, but why is this required.

regards

On Fri, Oct 30, 2020 at 2:59 PM atomtony [email protected] wrote:

What version of python

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/UdiBhaskar/Human-Activity-Recognition--Using-Deep-NN/issues/1#issuecomment-719444909, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJFPWC2MMV4DBWE7F7HKXXLSNKBQRANCNFSM4KFGQSEQ .

ariyurjana avatar Nov 01 '20 00:11 ariyurjana