Skip to Content
Java: Data Science Made Easy
book

Java: Data Science Made Easy

by Richard M. Reese, Jennifer L. Reese, Alexey Grigorev
July 2017
Beginner to intermediate
715 pages
17h 3m
English
Packt Publishing
Content preview from Java: Data Science Made Easy

Feature importance

Finally, we can also see which features contribute most to the model, which are less important, and order our features according to their performance. XGBoost implements one such feature's important measure called FScore, which is the number of times a feature is used by the model. 

To extract FScore, we first need to create a feature map: a file that contains the names of the features:

List<String> featureNames = columnNames(dataframe);String fmap = "feature_map.fmap";try (PrintWriter printWriter = new PrintWriter(fileName)) {    for (int i = 0; i < featureNames.size(); i++) {        printWriter.print(i);        printWriter.print('t');        printWriter.print(featureNames.get(i));        printWriter.print('t');        printWriter.print("q"); printWriter.println(); ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Data Science Cookbook

Java Data Science Cookbook

Rushdi Shams
Java for Data Science

Java for Data Science

Walter Molina, Richard M. Reese, Shilpi Saxena, Jennifer L. Reese

Publisher Resources

ISBN: 9781788475655Supplemental Content