feature engineering is often an important place to use expert knowledge for particular application while the purpose of machine learning in many cases is to avoid having to create set of expert-designed rulesthat doesn' mean that prior knowledge of the application or domain should be discarded oftendomain experts can help in identifying useful features that are much more informative than the initial representation of the data imagine you work for travel agency and want to predict flight prices let' say you have record of prices together with datesairlinesstart locationsand destinations machine learning model might be able to build decent model from that some important factors in flight priceshowevercannot be learned for exampleflights are usually more expensive during peak vacation months and around holidays while the dates of some holidays (like christmasare fixedand their effect can therefore be learned from the dateothers might depend on the phases of the moon (like hanukkah and easteror be set by authorities (like school holidaysthese events cannot be learned from the data if each flight is only recorded using the (gregoriandate howeverit is easy to add feature that encodes whether flight was onprecedingor following public or school holiday in this wayprior knowledge about the nature of the task can be encoded in the features to aid machine learning algorithm adding feature does not force machine learning algorithm to use itand even if the holiday information turns out to be noninformative for flight pricesaugmenting the data with this information doesn' hurt we'll now look at one particular case of using expert knowledge--though in this case it might be more rightfully called "common sense the task is predicting bicycle rentals in front of andreas' house in new yorkciti bike operates network of bicycle rental stations with subscription system the stations are all over the city and provide convenient way to get around bike rental data is made public in an anonymized form and has been analyzed in various ways the task we want to solve is to predict for given time and day how many people will rent bike in front of andreas' house--so he knows if any bikes will be left for him we first load the data for august for this particular station as pandas data frame we resample the data into three-hour intervals to obtain the main trends for each dayin[ ]citibike mglearn datasets load_citibike( representing data and engineering features