# Analysis of Factors Influencing the Prices of Tourist Offers
## 3 Selecting Optimal Price Predictors
### Trip Representation  
The aim of the data set preparation stage, which was a highly time-consuming process, was to generate a set of feature vectors representing trips. The available raw data required a complex processing. The data originated from two tour operators identified as T1 and T2 in subsequent sections. Two types of trips, depending on the transport type, were taken into account, i.e., flight and own transport. Evaluation of features was performed independently for these two trip types. Due to huge amounts of available data, the first step was to sample a set of trips for future analysis. A few restrictions were imposed during the sampling process: no missing values were accepted, a trip was supposed to be offered at least 30 times and at least one price change should have been observed during the time the trip was offered. In this way, 51,419 (61% from T1) trips with flight transport and 34,839 (98% from T1) with their own transport were sampled. Each trip was a source of a number of feature vectors. The available raw data enabled us to define a set of handcrafted features representing a trip at a given time. Such a representation vector of a trip in a given moment contained a set of constant parameters equal for all vectors generated on the basis of that trip and a set of varying parameters different for each vector originating from the given trip, depending on the day. Figure 2: The process of feature evaluation. The constant parameters included accommodation and meal attributes, characteristics of local attractions, average weather parameters, season attributes indicating, for example, any holidays at the time of the trip, length of the trip, distance between the starting and destination locations and GDP per capita being a constant factor, because data were gathered during one year. Moreover, for trips with flight transport, several flight and airport attributes were incorporated. Time-varying variables included trip price per person per day, macroeconomic indices, and current temperature, both in the starting and destination location. Moreover, a few additional features were extracted on the basis of raw data. It was _delta_ denoting the number of days from the first day a trip was offered, _changes_ denoting the number of times the trip's price was already changed, _days_till_departure_ denoting the number of days from the current day until the departure, and _month_ denoting the current month. For some of the time-varying parameters, seven new features were extracted to represent the rate of change of these variables. To do it, the best fit slope was calculated on the basis of \(k\) last values of the corresponding parameter. The new features representing the slope are called by adding a __serie_ suffix to the original name, e.g., _barrel_price_serie_ was calculated on the basis of \(k\) last values of _barrel_price_. It was performed for \(k=2,3,4,5,6,7\) to observe the influence of \(k\) on further results, which is shown further in Section 3.3.1. To sum up, 56 features for trips with own transport and 60 for flight transport were extracted. The four flight attributes present only in the case of trips with flight transport were as follows: _flight_type_name_, _airport_distance_, _destination_from_airport_passengers_, and _direct_flight_. The full list of features divided into groups is presented in Table 1.  
Depending on the value of \(n\) and the values of \(k\), training data sets of different sizes were created, as it is shown in Table 2. If, for example, a trip was offered from 1 April to 30 April, then at most 23 feature vectors for \(n=7\) could be extracted on the basis of that trip, provided the trip was offered every day in April. Usually some gap days appeared during the lifetime of a trip. Therefore, the possible number of extracted vectors was usually lower. Table 2 presents numbers of feature vectors for \(k=3\).