Posts

Showing posts from August 17, 2018

Using Sklearn with own text data

Image
Clash Royale CLAN TAG #URR8PPP .everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0; up vote 0 down vote favorite 1 I've been experimenting with scikit-learn for the past few months and have been finding it difficult to move away from the inbuilt datasets (such as Twenty Newsgroups and Iris ) and onto my own text datasets. I have finally managed to get something working, but am keen to get my code sense-checked just in case I'm tricking myself into thinking I'm doing better than I am. The following code is based on this Sklearn tutorial, but uses my own dataset of approximately 25,000 text files spread across 273 subdirectories in the main project folder. Each directory name serves as a descriptive label for the text files contained within it. The objectives of the following code are as follows: Iterate over each subdirectory path in the main project folder to extract the name of each of label (these are appended to the c

C# method declaration - IEnumerable vs List [closed]

Image
Clash Royale CLAN TAG #URR8PPP .everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0; up vote -5 down vote favorite Is it really a best practice to use IEnumerable<T> in method declaration, instead of List<T> ? Method1(IEnumerable<T> collections); Method2(List<T> collections); c# share | improve this question asked Feb 4 at 17:49 codeninja.sj 91 1 closed as off-topic by Malachi ♦ , t3chb0t, Mast, πάντα ῥεῖ, Sam Onela Feb 4 at 18:48 This question appears to be off-topic. The users who voted to close gave these specific reasons: "Questions must involve real code that you own or maintain. Pseudocode, hypothetical code, or stub code should be replaced by a concrete implementation. Questions seeking an explanation of someone else's code are also off-topic." – Mast, Sam Onela "Questions containing broken code or asking for advice abou