<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Reducing time window
Step1:  So, fridge is learnt as a 3 state appliance. What if we wanted to specify it to use 2 states? The latest version of nilmtk allows us to specify the number of states for an appliance.
Step2:  Now, fridge is learnt as a 2 state appliance.
Let us try the same thing with FHMM now
<ASSISTANT_TASK:>
Python Code:
ds.set_window(start='2014-04-01 00:00:00', end='2014-05-01 00:00:00')
elec
fridge_elecmeter = elec['fridge']
fridge_elecmeter
fridge_mg = MeterGroup([fridge_elecmeter])
co.train(fridge_mg)
co.model
Explanation: Reducing time window
End of explanation
num_states_dict = {fridge_elecmeter:2}
co = CombinatorialOptimisation()
co.train(fridge_mg, num_states_dict=num_states_dict)
co.model
Explanation: So, fridge is learnt as a 3 state appliance. What if we wanted to specify it to use 2 states? The latest version of nilmtk allows us to specify the number of states for an appliance.
End of explanation
from nilmtk.disaggregate import FHMM
f = FHMM()
f.train(fridge_mg)
f.model.means_
f = FHMM()
f.train(fridge_mg, num_states_dict)
f.model.means_
Explanation: Now, fridge is learnt as a 2 state appliance.
Let us try the same thing with FHMM now
End of explanation
<END_TASK>