An important feature of the nervous system is its ability to adapt to new stimuli. This adaptation allows for optimal encoding of the incoming information by dynamically changing the coding strategy based upon the incoming inputs to the neuron. At the level of single cells, this widespread phenomena is often referred to as spike-frequency adaptation, since it manifests as a history-dependent modulation of the neurons firing frequency. In this thesis I focus on how a neuron is able to adapt its activity to a specific input as well as on the function of such adaptive mechanisms. To study these adaptive processes different approaches have been used, from empirical observations of neural activities to detailed modeling of single cells. Here, I approach these problems by using simplified threshold models. In particular, I introduced a new generalization of the integrate-and-fire model (GIF) along with a convex fitting method allowing for efficient estimation of model parameters. Despite its relative simplicity I show that this neuron model is able to reproduce neuron behaviors with a high degree of accuracy. Moreover, using this method I was able to show that cortical neurons are equipped with two distinct adaptation mechanisms. First, a spike-triggered current that captures the complex influx of ions generated after the emission of a spike. While the second is a movement of the firing threshold, which possibly reflects the slow inactivation of sodium channels induced by the spiking activity. The precise dynamics of these adaptation processes is cell-type specific, explaining the difference of firing activity reported in different neuron types. Consequently, neuronal types can be classified based on model parameters. In Pyramidal neurons spike-dependent adaptation lasts for seconds and follows a scale-free dynamics, which is optimally tuned to encodes the natural inputs that pyramidal neurons receive in vivo. Finally using an extended version of the GIF model, I show that adaptation is not only a spike-dependent phenomenon, but also acts at the subthreshold level. In Pyramidal neurons the dynamics of the firing threshold is influenced by the subthreshold membrane potential. Spike-dependent and voltage-dependent adaptation interact in an activity-dependent way to ultimately shape the filtering properties of the membrane on the input statistics. Equipped with such a mechanism, Pyramidal neurons behave as integrators at low inputs and as a coincidence detectors at high inputs, maintaining sensitivity to input fluctuations across all regimes.