-
Notifications
You must be signed in to change notification settings - Fork 0
/
twitteruser.h
58 lines (40 loc) · 1.52 KB
/
twitteruser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <string>
#include <QDateTime>
#include "utils.h"
#include "tweet.h"
#include <vector>
#include "svm.h"
#ifndef TWITTERUSER_H
#define TWITTERUSER_H
namespace casimiro {
using std::vector;
using std::string;
enum ProfileType {
TopicProfile,
BOWProfile,
SVMProfile
};
class TwitterUser;
typedef vector<TwitterUser> TwitterUserVector;
typedef struct svm_model SVMModel;
class TwitterUser {
public:
TwitterUser(long _userId);
virtual ~TwitterUser();
virtual long getUserId() const;
virtual void loadSVMProfile(const string &_modelPath);
virtual void loadProfile(const QDateTime& _start, const QDateTime& _end);
virtual void loadBOWProfile(const QDateTime& _start, const QDateTime& _end);
virtual const StringFloatMap& getProfile() const;
virtual TweetVector getCandidates(const QDateTime& _start, const QDateTime& _end, ProfileType _profileType) const;
virtual TweetVector getRetweets(const QDateTime& _start, const QDateTime& _end) const;
virtual float cosineSimilarity(const StringFloatMap& _profile) const;
virtual TweetVector sortCandidates(const TweetVector& _candidates, const QDateTime& _recommendationTime, const StringIntMap& _topicLifeSpan = StringIntMap()) const;
private:
long m_userId;
StringFloatMap m_profile;
SVMModel* m_svmModel = nullptr;
static bool CandidateHasOldTopics(const Tweet& _candidate, const StringIntMap& _topicLifeSpan, const QDateTime& _retweetCreationTime);
};
}
#endif // TWITTERUSER_H