Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# сохранить предсказания в переменную predictions | |
predictions = clf.predict(test_input) | |
# создать из предсказаний объект DataFrame (и назвать колонку в нём Label) и сохранить в переменную predictions_df | |
predictions_df = pd.DataFrame(predictions, columns=['Label']) | |
# обозвать индексную колонку ImageId | |
predictions_df.index.name = 'ImageId' | |
# записать в файлик |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# таблица с результатами и параметрами | |
clf.grid_scores_ | |
# отфильтровать из неё записи, где параметр p был 2, а параметр weights был distance и положить результат в переменную means | |
means = filter(lambda x: x[0]['p'] == 2 and x[0]['weights'] == 'distance', clf.grid_scores_) | |
# нарисовать график, в котором по оси абсцисс параметр n_neighbors, а по оси ординат score | |
plt.plot([x[0]['n_neighbors'] for x in means], [x[1] for x in means]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::vector<cocaine_endpoint_t> new_endpoints; | |
std::vector<cocaine_endpoint_t> missing_endpoints2; | |
get_endpoints_diff(endpoints, new_endpoints, missing_endpoints); | |
if (!missing_endpoints.empty()) { | |
for (size_t i = 0; i < m_endpoints.size(); ++i) { | |
if (false == std::binary_search(endpoints_tmp.begin(), endpoints_tmp.end(), m_endpoints[i])) { | |
missing_endpoints2.push_back(m_endpoints[i]); | |
} |
NewerOlder