The development of the Internet of Things (IoT) has created an environment in which numerous sensors and actuators are connected to the Internet. Machines and management systems in factories use data from such sensors and actuators to improve their work efficiency, and are essential parts of today's smart factories. The vision of a smart factory is based on the concept of Industry 4.0 (I4.0), a subset of the fourth industrial revolution, in which smart factories support the operator and maintenance processes of the factory from an I4.0 perspective. The analysis of big data gathered by IoT devices in factories, particularly for the use of anomaly detection, can aid in achieving product quality stabilization. For example, if a large refrigerator in a warehouse breaks down, the quality of stock food will deteriorate, and food loss may become significant. In the case of anomaly detection, machine status monitoring and accident prediction are required to reduce the operation and maintenance costs. Furthermore, the introduction cost of such systems can be reduced by generalizing them (the systems). However, the data types as well as the sensor and actuator types, differ between factories. Therefore, nonparametric statistical methods are required for anomaly detection. By contrast, factor analysis requires a costless method, one that does not require an overhaul of machinery. Consequently, it is necessary to adopt a machine learning-based method using sampled data. In this study, we proposed a method of anomaly detection and factor analysis for cooling systems in smart factories using appropriate methodologies for detection and analysis. The proposed method consists of two phases: anomaly detection and factor analysis. In the anomaly detection stage, Gaussian kernel density estimation was used to calculate the occurrence distribution. Two types of anomaly scores, cumulative density value and KL divergence, were defined. The probability distribution was estimated with a constant window frame to reflect a tendency to increase. In the factor analysis stage, target values were predicted using LightGBM. The factor of abnormalities was detected by comparing the results of two predictions: one using all the features, and the other using the data, which excluded a factor to detect the contribution of the factor.