Skip to content

Commit abba8a4

Browse files
authored
Merge pull request #18 from K-Ibadullaev/K-Ibadullaev-patch-1
Update SSA.py
2 parents 91aaca7 + 336cf09 commit abba8a4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/py_ssa_lib/SSA.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ def fit(self, df, L,ts, decomposition,idx_start_ts, **kwargs ):
125125
126126
idx_start_ts:int, the first column index of the data frame where the first nummeric value occours,
127127
i.e where the time series start(s). Used to cutoff irrelevant columns from the input data set.
128+
129+
ts: int, the row of the data set containing a time series
128130
129131
130132
Returns
@@ -133,6 +135,7 @@ def fit(self, df, L,ts, decomposition,idx_start_ts, **kwargs ):
133135
"""
134136

135137
self.df = df
138+
self.ts = ts
136139
self.idx_start_ts = idx_start_ts
137140
self.ts_df = self.df.iloc[ts,self.idx_start_ts:].T
138141
self.decomposition = decomposition
@@ -338,7 +341,7 @@ def reconstruct_ts(self, idx_chosen_components, return_as_df=False):
338341

339342
ts_rec = self.X_to_TS(chosen_components)
340343
if return_as_df==True:
341-
return pd.DataFrame(columns=self.df.columns, data=np.column_stack([self.df.iloc[:,:self.idx_start_ts].values,ts_rec.T ]))
344+
return pd.DataFrame(columns=self.df.columns, data=np.column_stack([self.df.iloc[self.ts,:self.idx_start_ts].values,ts_rec.T ]))
342345
return ts_rec.T
343346

344347

0 commit comments

Comments
 (0)