<jupyter_start><jupyter_text>Predict the seasonal factors series<jupyter_code>The seasonal component and the seasonally adjusted series were obtained by X12-ARIMA method through EVIEWS.
dataset_name = 'sea'

fig, ax = plt.subplots(nrows=24, ncols=1, figsize=[10,60])

dat = pd.read_csv('USA19.csv')
dataset1 = np.array(dat["M1"])[:12]
dataset_tdiff1 = tdiff.apply(dataset1)
dataset2 = np.array(dat["M2"])[:12]
dataset_tdiff2 = tdiff.apply(dataset2)
dataset3 = np.array(dat["M3"])[:12]
dataset_tdiff3 = tdiff.apply(dataset3)
dataset4 = np.array(dat["M4"])[:12]
dataset_tdiff4 = tdiff.apply(dataset4)
dataset5 = np.array(dat["M5"])[:12]
dataset_tdiff5 = tdiff.apply(dataset5)
dataset6 = np.array(dat["M6"])[:12]
dataset_tdiff6 = tdiff.apply(dataset6)
dataset7 = np.array(dat["M7"])[:12]
dataset_tdiff7 = tdiff.apply(dataset7)
dataset8 = np.array(dat["M8"])[:12]
dataset_tdiff8 = tdiff.apply(dataset8)
dataset9 = np.array(dat["M9"])[:12]
dataset_tdiff9 = tdiff.apply(dataset9)
dataset10 = np.array(dat["M10"])[:12]
dataset_tdiff10 = tdiff.apply(dataset10)
dataset11 = np.array(dat["M11"])[:12]
dataset_tdiff11 = tdiff.apply(dataset11)
dataset12 = np.array(dat["M12"])[:12]
dataset_tdiff12 = tdiff.apply(dataset12)


ax[0].plot(dataset1)
ax[1].plot(dataset_tdiff1)
ax[2].plot(dataset2)
ax[3].plot(dataset_tdiff2)
ax[4].plot(dataset3)
ax[5].plot(dataset_tdiff3)
ax[6].plot(dataset4)
ax[7].plot(dataset_tdiff4)
ax[8].plot(dataset5)
ax[9].plot(dataset_tdiff5)
ax[10].plot(dataset6)
ax[11].plot(dataset_tdiff6)
ax[12].plot(dataset7)
ax[13].plot(dataset_tdiff7)
ax[14].plot(dataset8)
ax[15].plot(dataset_tdiff8)
ax[16].plot(dataset9)
ax[17].plot(dataset_tdiff9)
ax[18].plot(dataset10)
ax[19].plot(dataset_tdiff10)
ax[20].plot(dataset11)
ax[21].plot(dataset_tdiff11)
ax[22].plot(dataset12)
ax[23].plot(dataset_tdiff12)


ax[0].set_title(dataset_name)
test = np.array(dat["sea"])[132:144]
partitioners = {}
output = [ ]

partitioner = Grid.GridPartitioner(data=dataset1[:11], npart=5)
partitioners  = partitioner
model1 = chen.ConventionalFTS(partitioner=partitioners)
model1.name=dataset_name
model1.fit(dataset1[:11], save_model=True, file_path='model1'+dataset_name, order=1)
model1 = cUtil.load_obj('model1'+dataset_name)
forecasts = model1.predict(dataset1[9:11]) 
output.append(forecasts[1])

partitioner = Grid.GridPartitioner(data=dataset2[:11], npart=5)
partitioners  = partitioner
model1 = chen.ConventionalFTS(partitioner=partitioners)
model1.name=dataset_name
model1.fit(dataset2[:11], save_model=True, file_path='model1'+dataset_name, order=1)
model1 = cUtil.load_obj('model1'+dataset_name)
forecasts = model1.predict(dataset2[9:11]) 
output.append(forecasts[1])

partitioner = Grid.GridPartitioner(data=dataset3[:11], npart=5)
partitioners  = partitioner
model1 = chen.ConventionalFTS(partitioner=partitioners)
model1.name=dataset_name
model1.fit(dataset3[:11], save_model=True, file_path='model1'+dataset_name, order=1)
model1 = cUtil.load_obj('model1'+dataset_name)
forecasts = model1.predict(dataset3[9:11]) 
output.append(forecasts[1])

partitioner = Grid.GridPartitioner(data=dataset4[:11], npart=6)
partitioners  = partitioner
model1 = chen.ConventionalFTS(partitioner=partitioners)
model1.name=dataset_name
model1.fit(dataset4[:11], save_model=True, file_path='model1'+dataset_name, order=1)
model1 = cUtil.load_obj('model1'+dataset_name)
forecasts = model1.predict(dataset4[9:11]) 
output.append(forecasts[1])

partitioner = Grid.GridPartitioner(data=dataset5[:11], npart=3)
partitioners  = partitioner
model1 = chen.ConventionalFTS(partitioner=partitioners)
model1.name=dataset_name
model1.fit(dataset5[:11], save_model=True, file_path='model1'+dataset_name, order=1)
model1 = cUtil.load_obj('model1'+dataset_name)
forecasts = model1.predict(dataset5[9:11]) 
output.append(forecasts[1])

partitioner = Grid.GridPartitioner(data=dataset6[:11], npart=5)
partitioners  = partitioner
model1 = chen.ConventionalFTS(partitioner=partitioners)
model1.name=dataset_name
model1.fit(dataset6[:11], save_model=True, file_path='model1'+dataset_name, order=1)
model1 = cUtil.load_obj('model1'+dataset_name)
forecasts = model1.predict(dataset6[9:11]) 
output.append(forecasts[1])

partitioner = Grid.GridPartitioner(data=dataset7[:11], npart=6)
partitioners  = partitioner
model1 = chen.ConventionalFTS(partitioner=partitioners)
model1.name=dataset_name
model1.fit(dataset7[:11], save_model=True, file_path='model1'+dataset_name, order=1)
model1 = cUtil.load_obj('model1'+dataset_name)
forecasts = model1.predict(dataset7[9:11]) 
output.append(forecasts[1])

partitioner = Grid.GridPartitioner(data=dataset8[:11], npart=6)
partitioners  = partitioner
model1 = chen.ConventionalFTS(partitioner=partitioners)
model1.name=dataset_name
model1.fit(dataset8[:11], save_model=True, file_path='model1'+dataset_name, order=1)
model1 = cUtil.load_obj('model1'+dataset_name)
forecasts = model1.predict(dataset8[9:11]) 
output.append(forecasts[1])

partitioner = Grid.GridPartitioner(data=dataset9[:11], npart=5)
partitioners  = partitioner
model1 = chen.ConventionalFTS(partitioner=partitioners)
model1.name=dataset_name
model1.fit(dataset9[:11], save_model=True, file_path='model1'+dataset_name, order=1)
model1 = cUtil.load_obj('model1'+dataset_name)
forecasts = model1.predict(dataset9[9:11]) 
output.append(forecasts[1])

partitioner = Grid.GridPartitioner(data=dataset10[:11], npart=5)
partitioners  = partitioner
model1 = chen.ConventionalFTS(partitioner=partitioners)
model1.name=dataset_name
model1.fit(dataset10[:11], save_model=True, file_path='model1'+dataset_name, order=1)
model1 = cUtil.load_obj('model1'+dataset_name)
forecasts = model1.predict(dataset10[9:11]) 
output.append(forecasts[1])

partitioner = Grid.GridPartitioner(data=dataset11[:11], npart=5)
partitioners  = partitioner
model1 = chen.ConventionalFTS(partitioner=partitioners)
model1.name=dataset_name
model1.fit(dataset11[:11], save_model=True, file_path='model1'+dataset_name, order=1)
model1 = cUtil.load_obj('model1'+dataset_name)
forecasts = model1.predict(dataset11[9:11]) 
output.append(forecasts[1])

partitioner = Grid.GridPartitioner(data=dataset12[:11], npart=6)
partitioners  = partitioner
model1 = chen.ConventionalFTS(partitioner=partitioners)
model1.name=dataset_name
model1.fit(dataset12[:11], save_model=True, file_path='model1'+dataset_name, order=1)
model1 = cUtil.load_obj('model1'+dataset_name)
forecasts = model1.predict(dataset12[9:11]) 
output.append(forecasts[1])


print(output)
rmse = np.sqrt(np.nanmean((test - output) ** 2))
print(rmse)
np.savetxt('sea.csv', output, delimiter = ',')<jupyter_output><empty_output><jupyter_text>Predict  n-1 IMFs component series, the residual series and linearly summed up to get the final prediction results.<jupyter_code>dataset_name = 'USA19'

fig, ax = plt.subplots(nrows=2, ncols=1, figsize=[10,5])

dat = pd.read_csv('USA19.csv')
dataset = np.array(dat["volume"])[0:144]
dataset_tdiff = tdiff.apply(dataset)


ax[0].plot(dataset)
ax[1].plot(dataset_tdiff)

ax[0].set_title(dataset_name)
dat = pd.read_csv('USA19.csv')
dataset = np.array(dat["volume"])[0:144]
dataset1 = np.array(dat["CIMF5"])[:144]
dataset2 = np.array(dat["CIMF4"])[:144]
dataset3 = np.array(dat["CIMF3"])[:144]
dataset4 = np.array(dat["CIMF2"])[:144]
dataset5 = np.array(dat["CIMF1"])[:144]

from statsmodels.tsa.stattools import adfuller
result = adfuller(dataset1[:132])
print("CR项",result)
result = adfuller(dataset2[:132])
print("CIMF4项",result)
result = adfuller(dataset3[:132])
print("CIMF3项",result)
result = adfuller(dataset4[:132])
print("CIMF2项",result)
result = adfuller(dataset5[:132])
print("CIMF1项",result)
dataset_name = 'SH18-CR'

fig, ax = plt.subplots(nrows=2, ncols=1, figsize=[10,5])

dataset1 = np.array(dat["CR"])[:144]
dataset_tdiff1 = tdiff.apply(dataset1)


ax[0].plot(dataset1)
ax[1].plot(dataset_tdiff1)

ax[0].set_title(dataset_name)
partitioners = {}
partitioners_diff = {}


output = [ ]
test = dataset1[132:144]

for ss in range(1,101):

    partitioners_diff  = {}

    partitioner_diff  = FCM.FCMPartitioner(data=dataset1[:132], npart=64,  transformation=tdiff)
    partitioners_diff  = partitioner_diff 

    model2 = chen.ConventionalFTS(partitioner=partitioners_diff)
    model2.name=dataset_name
    model2.append_transformation(tdiff)
    model2.fit(dataset1[:132], save_model=True, file_path='model2'+dataset_name, order=1)


    model2 = cUtil.load_obj('model2'+dataset_name)
    forecasts = model2.predict(dataset1[131:143]) 
    
    output.append(forecasts)
    
ave = []
for j in range(0,12):
    sum = 0
    for i in range(0,100):
        sum += output[i][j]
    ave.append(sum/100)
    
print(ave)
rmse = np.sqrt(np.nanmean((test - ave) ** 2))
mae = np.nanmean(np.abs(test - ave))
mape = np.nanmean(np.abs(test - ave)/test)*100
print('RMSE=',rmse,'MAE=',mae,'MAPE=',mape)
np.savetxt('output.csv', ave, delimiter = ',')


fig, ax = plt.subplots(nrows=1, ncols=1, figsize=[20,10])
ax.plot(ave)
ax.plot(test)    
ax.set_title(dataset_name)
dataset_name = 'SH18-CIMF4'

fig, ax = plt.subplots(nrows=2, ncols=1, figsize=[10,5])

dataset2 = np.array(dat["CIMF4"])[0:144]
dataset_tdiff2 = tdiff.apply(dataset2)
test = dataset2[132:144]


ax[0].plot(dataset2)
ax[1].plot(dataset_tdiff2)

ax[0].set_title(dataset_name)
partitioners = {}
partitioners_diff = {}


output = [ ]

for ss in range(1,101):

    partitioners_diff  = {}

    partitioner_diff  = FCM.FCMPartitioner(data=dataset2[:132], npart=32,  transformation=tdiff)
    partitioners_diff  = partitioner_diff 

    model2 = chen.ConventionalFTS(partitioner=partitioners_diff)
    model2.name=dataset_name
    model2.append_transformation(tdiff)
    model2.fit(dataset2[:132], save_model=True, file_path='model2'+dataset_name, order=1)


    model2 = cUtil.load_obj('model2'+dataset_name)
    forecasts = model2.predict(dataset2[131:143]) 
    
    output.append(forecasts)
    
ave = []
for j in range(0,12):
    sum = 0
    for i in range(0,100):
        sum += output[i][j]
    ave.append(sum/100)
    
print(ave)
rmse = np.sqrt(np.nanmean((test - ave) ** 2))
mae = np.nanmean(np.abs(test - ave))
mape = np.nanmean(np.abs(test - ave)/test)*100
print('RMSE=',rmse,'MAE=',mae,'MAPE=',mape)
np.savetxt('output.csv', ave, delimiter = ',')

fig, ax = plt.subplots(nrows=1, ncols=1, figsize=[20,10])
ax.plot(ave)
ax.plot(test)    
ax.set_title(dataset_name)
partitioners = {}
partitioners_diff = {}


output = [ ]

for ss in range(1,101):

    partitioners = {}

    partitioner = FCM.FCMPartitioner(data=dataset2[:132], npart=43)
    partitioners = partitioner

    model2 = chen.ConventionalFTS(partitioner=partitioners)
    model2.name=dataset_name
    model2.fit(dataset2[:132], save_model=True, file_path='model2'+dataset_name, order=1)


    model2 = cUtil.load_obj('model2'+dataset_name)
    forecasts = model2.predict(dataset2[131:143])  
    
    output.append(forecasts)
    
ave = []
for j in range(0,12):
    sum = 0
    for i in range(0,100):
        sum += output[i][j]
    ave.append(sum/100)
    
print(ave)
rmse = np.sqrt(np.nanmean((test - ave) ** 2))
mae = np.nanmean(np.abs(test - ave))
mape = np.nanmean(np.abs(test - ave)/test)*100
print('RMSE=',rmse,'MAE=',mae,'MAPE=',mape)
np.savetxt('output.csv', ave, delimiter = ',')

fig, ax = plt.subplots(nrows=1, ncols=1, figsize=[20,10])
ax.plot(ave)
ax.plot(test)    
ax.set_title(dataset_name)
dataset_name = 'SH18-CIMF3'

fig, ax = plt.subplots(nrows=2, ncols=1, figsize=[10,5])

dataset3 = np.array(dat["CIMF3"])[:144]
dataset_tdiff3 = tdiff.apply(dataset3)
test = dataset3[132:144]


ax[0].plot(dataset3)
ax[1].plot(dataset_tdiff3)

ax[0].set_title(dataset_name)
partitioners = {}
partitioners_diff = {}


output = [ ]

for ss in range(1,101):

    partitioners_diff  = {}

    partitioner_diff  = FCM.FCMPartitioner(data=dataset3[:132], npart=12,  transformation=tdiff)
    partitioners_diff  = partitioner_diff 

    model2 = chen.ConventionalFTS(partitioner=partitioners_diff)
    model2.name=dataset_name
    model2.append_transformation(tdiff)
    model2.fit(dataset3[:132], save_model=True, file_path='model2'+dataset_name, order=1)


    model2 = cUtil.load_obj('model2'+dataset_name)
    forecasts = model2.predict(dataset3[131:143]) 
    
    output.append(forecasts)
    
ave = []
for j in range(0,12):
    sum = 0
    for i in range(0,100):
        sum += output[i][j]
    ave.append(sum/100)
    
print(ave)
rmse = np.sqrt(np.nanmean((test - ave) ** 2))
mae = np.nanmean(np.abs(test - ave))
mape = np.nanmean(np.abs(test - ave)/test)*100
print('RMSE=',rmse,'MAE=',mae,'MAPE=',mape)
np.savetxt('output.csv', ave, delimiter = ',')

fig, ax = plt.subplots(nrows=1, ncols=1, figsize=[20,10])
ax.plot(ave)
ax.plot(test)    
ax.set_title(dataset_name)
partitioners = {}
partitioners_diff = {}


output = [ ]

for ss in range(1,101):

    partitioners = {}

    partitioner = FCM.FCMPartitioner(data=dataset3[:132], npart=14)
    partitioners = partitioner

    model2 = chen.ConventionalFTS(partitioner=partitioners)
    model2.name=dataset_name
    model2.fit(dataset3[:132], save_model=True, file_path='model2'+dataset_name, order=1)


    model2 = cUtil.load_obj('model2'+dataset_name)
    forecasts = model2.predict(dataset3[131:143])  
    
    output.append(forecasts)
    
ave = []
for j in range(0,12):
    sum = 0
    for i in range(0,100):
        sum += output[i][j]
    ave.append(sum/100)
    
print(ave)
rmse = np.sqrt(np.nanmean((test - ave) ** 2))
mae = np.nanmean(np.abs(test - ave))
mape = np.nanmean(np.abs(test - ave)/test)*100
print('RMSE=',rmse,'MAE=',mae,'MAPE=',mape)
np.savetxt('output.csv', ave, delimiter = ',')

fig, ax = plt.subplots(nrows=1, ncols=1, figsize=[20,10])
ax.plot(ave)
ax.plot(test)    
ax.set_title(dataset_name)
dataset_name = 'SH18-CIMF2'

fig, ax = plt.subplots(nrows=2, ncols=1, figsize=[10,5])

dataset4 = np.array(dat["CIMF2"])[:144]
dataset_tdiff4 = tdiff.apply(dataset4)
test = dataset4[132:144]


ax[0].plot(dataset4)
ax[1].plot(dataset_tdiff4)

ax[0].set_title(dataset_name)
partitioners = {}
partitioners_diff = {}


output = [ ]

for ss in range(1,101):

    partitioners_diff  = {}

    partitioner_diff  = FCM.FCMPartitioner(data=dataset4[:132], npart=8,  transformation=tdiff)
    partitioners_diff  = partitioner_diff 

    model2 = chen.ConventionalFTS(partitioner=partitioners_diff)
    model2.name=dataset_name
    model2.append_transformation(tdiff)
    model2.fit(dataset4[:132], save_model=True, file_path='model2'+dataset_name, order=1)


    model2 = cUtil.load_obj('model2'+dataset_name)
    forecasts = model2.predict(dataset4[131:144]) 
    
    output.append(forecasts)
    
ave = []
for j in range(0,12):
    sum = 0
    for i in range(0,100):
        sum += output[i][j]
    ave.append(sum/100)
    
print(ave)
rmse = np.sqrt(np.nanmean((test - ave) ** 2))
mae = np.nanmean(np.abs(test - ave))
mape = np.nanmean(np.abs(test - ave)/test)*100
print('RMSE=',rmse,'MAE=',mae,'MAPE=',mape)
np.savetxt('output.csv', ave, delimiter = ',')

fig, ax = plt.subplots(nrows=1, ncols=1, figsize=[20,10])
ax.plot(ave)
ax.plot(test)    
ax.set_title(dataset_name)
partitioners = {}
partitioners_diff = {}


output = [ ]

for ss in range(1,101):

    partitioners = {}

    partitioner = FCM.FCMPartitioner(data=dataset4[:132], npart=10)
    partitioners = partitioner

    model2 = chen.ConventionalFTS(partitioner=partitioners)
    model2.name=dataset_name
    model2.fit(dataset4[:132], save_model=True, file_path='model2'+dataset_name, order=1)


    model2 = cUtil.load_obj('model2'+dataset_name)
    forecasts = model2.predict(dataset4[131:144])  
    
    output.append(forecasts)
    
ave = []
for j in range(0,12):
    sum = 0
    for i in range(0,100):
        sum += output[i][j]
    ave.append(sum/100)
    
print(ave)
rmse = np.sqrt(np.nanmean((test - ave) ** 2))
mae = np.nanmean(np.abs(test - ave))
mape = np.nanmean(np.abs(test - ave)/test)*100
print('RMSE=',rmse,'MAE=',mae,'MAPE=',mape)
np.savetxt('output.csv', ave, delimiter = ',')

fig, ax = plt.subplots(nrows=1, ncols=1, figsize=[20,10])
ax.plot(ave)
ax.plot(test)    
ax.set_title(dataset_name)
dataset_name = 'SH18-CIMF1'

fig, ax = plt.subplots(nrows=2, ncols=1, figsize=[10,5])

dataset5 = np.array(dat["CIMF1"])[:144]
dataset_tdiff5 = tdiff.apply(dataset5)
test = dataset5[132:144]


ax[0].plot(dataset5)
ax[1].plot(dataset_tdiff5)

ax[0].set_title(dataset_name)
partitioners = {}
partitioners_diff = {}


output = [ ]

for ss in range(1,101):

    partitioners_diff  = {}

    partitioner_diff  = FCM.FCMPartitioner(data=dataset5[:132], npart=5,  transformation=tdiff)
    partitioners_diff  = partitioner_diff 

    model2 = chen.ConventionalFTS(partitioner=partitioners_diff)
    model2.name=dataset_name
    model2.append_transformation(tdiff)
    model2.fit(dataset5[:132], save_model=True, file_path='model2'+dataset_name, order=1)


    model2 = cUtil.load_obj('model2'+dataset_name)
    forecasts = model2.predict(dataset5[131:143]) 
    
    output.append(forecasts)
    
ave = []
for j in range(0,12):
    sum = 0
    for i in range(0,100):
        sum += output[i][j]
    ave.append(sum/100)
    
print(ave)
rmse = np.sqrt(np.nanmean((test - ave) ** 2))
mae = np.nanmean(np.abs(test - ave))
mape = np.nanmean(np.abs(test - ave)/test)*100
print('RMSE=',rmse,'MAE=',mae,'MAPE=',mape)
np.savetxt('output.csv', ave, delimiter = ',')

fig, ax = plt.subplots(nrows=1, ncols=1, figsize=[20,10])
ax.plot(ave)
ax.plot(test)    
ax.set_title(dataset_name)
partitioners = {}
partitioners_diff = {}


output = [ ]

for ss in range(1,101):

    partitioners = {}

    partitioner = FCM.FCMPartitioner(data=dataset5[:132], npart=5)
    partitioners = partitioner

    model2 = chen.ConventionalFTS(partitioner=partitioners)
    model2.name=dataset_name
    model2.fit(dataset5[:132], save_model=True, file_path='model2'+dataset_name, order=1)


    model2 = cUtil.load_obj('model2'+dataset_name)
    forecasts = model2.predict(dataset5[131:143])  
    
    output.append(forecasts)
    
ave = []
for j in range(0,12):
    sum = 0
    for i in range(0,100):
        sum += output[i][j]
    ave.append(sum/100)
    
print(ave)
rmse = np.sqrt(np.nanmean((test - ave) ** 2))
mae = np.nanmean(np.abs(test - ave))
mape = np.nanmean(np.abs(test - ave)/np.abs(test))*100
print('RMSE=',rmse,'MAE=',mae,'MAPE=',mape)
np.savetxt('output.csv', ave, delimiter = ',')

fig, ax = plt.subplots(nrows=1, ncols=1, figsize=[20,10])
ax.plot(ave)
ax.plot(test)    
ax.set_title(dataset_name)
SEA = np.array(dat["S"])[:12]
OO = np.array(dat["S2"])[:12]

partitioners1 = {}
partitioners2 = {}
partitioners3 = {}
partitioners4 = {}
partitioners5 = {}
test = np.array(dat["volume"])[132:144]


output = [ ]

for ss in range(1,101):
    
    partitioner1 = FCM.FCMPartitioner(data=dataset1[:132], npart=71 , transformation=tdiff)
    model1 = chen.ConventionalFTS(partitioner=partitioner1)
    model1.name='CR'
    model1.append_transformation(tdiff)
    model1.fit(dataset1[:132], save_model=True, file_path='model1'+'CR', order=1)
    model1 = cUtil.load_obj('model1'+'CR')
    forecasts1 = np.array(model1.predict(dataset1[131:143])) 
    
    partitioner2 = FCM.FCMPartitioner(data=dataset2[:132], npart=43 , transformation=tdiff)
    model2 = chen.ConventionalFTS(partitioner=partitioner2)
    model2.name='CIMF4'
    model2.append_transformation(tdiff)
    model2.fit(dataset2[:132], save_model=True, file_path='model2'+'CIMF4', order=1)
    model2 = cUtil.load_obj('model2'+'CIMF4')
    forecasts2 = np.array(model2.predict(dataset2[131:143]))
    
    partitioner3 = FCM.FCMPartitioner(data=dataset3[:132], npart=15 , transformation=tdiff )
    model3 = chen.ConventionalFTS(partitioner=partitioner3)
    model3.name='CIMF3'
    model3.append_transformation(tdiff)
    model3.fit(dataset3[:132], save_model=True, file_path='model3'+'CIMF3', order=1)
    model3 = cUtil.load_obj('model3'+'CIMF3')
    forecasts3 =  np.array(model3.predict(dataset3[131:143]))  
    
    partitioner4 = FCM.FCMPartitioner(data=dataset4[:132], npart=10 , transformation=tdiff)
    model4 = chen.ConventionalFTS(partitioner=partitioner4)
    model4.name='CIMF2'
    model4.append_transformation(tdiff)
    model4.fit(dataset4[:132], save_model=True, file_path='model4'+'CIMF2', order=1)    
    model4 = cUtil.load_obj('model4'+'CIMF2')
    forecasts4 =  np.array(model4.predict(dataset4[131:143]))
    
    partitioner5 = FCM.FCMPartitioner(data=dataset5[:132], npart=5)
    model5 = chen.ConventionalFTS(partitioner=partitioner5)
    model5.name='CIMF1'
    model5.fit(dataset5[:132], save_model=True, file_path='model5'+'CIMF1', order=1)    
    model5 = cUtil.load_obj('model5'+'CIMF1')
    forecasts5 =  np.array(model5.predict(dataset5[131:143]))    
    
    forecasts = forecasts1 + forecasts2 + forecasts3 + forecasts4 + forecasts5 + SEA
    output.append(forecasts)
    
ave = []
for j in range(0,12):
    sum = 0
    for i in range(0,100):
        sum += output[i][j]
    ave.append(sum/100)

np.savetxt('output.csv', ave, delimiter = ',')
print(ave)
ae = np.nanmean(test - ave)
rmse = np.sqrt(np.nanmean((test - ave) ** 2))
mae = np.nanmean(np.abs(test - ave))
mape = np.nanmean(np.abs(test - ave)/test)*100
tic = rmse/(np.sqrt(np.nanmean(test ** 2))+np.sqrt(np.nanmean((ave+OO) ** 2)))
print('AE=',ae,'MAE=',mae,'RMSE=',rmse,'MAPE=',mape,'TIC=',tic)<jupyter_output>[19143.506913726356, 15955.397605889691, 28279.099310757145, 28526.7298433, 18298.282373230955, 12977.2389259973, 13565.656436657931, 13693.453447236661, 13443.952226783333, 22703.84645552143, 19031.54781478334, 11188.474143471425]
AE= 80.98454188703606 MAE= 1580.7259906774877 RMSE= 2548.5260909683307 MAPE= 8.654460987425114 TIC= 0.06727144113021659
{'fraction_non_alphanumeric': 0.16267920527359056, 'fraction_numerical': 0.07163601161665054, 'mean_word_length': 5.632222561907674, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '450450', 'license': 'MIT', 'n_tokens_mistral': 9210, 'n_tokens_neox': 8452, 'n_words': 1191, 'path': 'FCM-FTS.ipynb', 'repo_name': 'WuZK96/X12-ARIMA-ICEEMDAN-FCM-FTS', 'size': '21693'}