Low power wide area network (LPWAN) technologies offer affordable connectivity to massive number of low-power devices distributed over large geographical areas. Focus of this work is one of the most promising LPWAN technologies: LoRa. LoRa offers long range communication and strong resilience to interference by proprietary modulation technique based on Chirp Spread Spectrum (CSS). LoRa modulation trades data rate for sensitivity and communication range by spreading symbols within a fixed channel bandwidth. Collisions in LoRaWAN networks are strongly related with spreading factor (SF) assignment of nodes which indeed effects network performance. In this work, a simulation environment to evaluate the performance of SF assignment schemes is implemented. Furthermore, a novel smart SF assignment strategy which utilizes Support Vector Machine (SVM) and Decision Tree Classifier (DTC) machine learning techniques for optimization of SF assignment is proposed. It is observed and presented that the proposed smart SF assignment techniques give promising simulation results in terms of packet delivery ratio (PDR).