イクマス工業のAIイノベーション


1.カスタム商品の推奨

  • お客様が体験したことのない商品の好みを特定するのは難しいです
  • 2.推奨アルゴリズム


  • 予め設定されたルールベースの推奨ではなく、顧客データベースの人工知能推奨アルゴリズム


  • 代表的:YouTube推奨アルゴリズム
    ほとんどのクリック率は推奨ビデオから来ています
  • 3.個人化マーケティング戦略

  • 顧客の特性を分析し、各顧客に最適化されたサービスを提供する
    ->AIを利用して顧客の購買傾向を予測し、カスタムマーケティング情報
  • を得る

    4.お客様に便利なサービスを提供する

  • 多様な人工知能技術を利用してサービスを提供し、ショッピングの利便性を高める

    実習。ウェブサイトはどのように私に合う商品を推薦しますか?


    今回の実験ではnetflixデータを表示し,人工知能モデルを学習する.
    YouTube動画を見ていても思わず新しい動画をお勧めしていましたよね?
    インターネット上で運営されているビデオ、ショッピング、広告会社は、人工知能推奨アルゴリズムを使用して、新しい商品を展示します.
    データ構造の検証
    2019年にアップロードされたNetflixデータは以下の通りです.

    データは6234個のコンテンツの12個の変数の値を含む.
    変数の意味
    show id netflixコンテンツid
    typeコンテンツタイプ
    タイトルコンテンツタイトル
    監督
    キャスター

    date addedアップロード日
    release year導入年
    評価内容カテゴリex)
    durationコンテンツコンポーネント
    を選択します.
    ストーリーの概要を述べる
    データ学習
    これらのデータを用いて,プリセット学習アルゴリズムを用いて学習する.
    説明
    以下のコードを使用して、人工知能モデル学習を実行してください.ma.preprocess()実行ボタンをクリックして結果を表示します.
    「発行」ボタンをクリックして、作成したコードが正しいかどうかを確認します.
    import machine as ma
    
    def main():
        
        """
        지시사항 1번. 인공지능 모델 학습을 수행해보세요.
        """
        netflix_overall, cosine_sim, indices = ma.preprocess()
    
    
    if __name__ == "__main__":
        main()
    import numpy as np 
    import pandas as pd 
    import matplotlib.pyplot as plt
    import seaborn as sns
    
    import sys
    from tqdm import trange
    
    from sklearn.feature_extraction.text import CountVectorizer
    from sklearn.metrics.pairwise import cosine_similarity
    
    def clean_data(x):
        return str.lower(x.replace(" ", ""))
    
    def create_soup(x):
        return x['title']+ ' ' + x['director'] + ' ' + x['cast'] + ' ' +x['listed_in']+' '+ x['description']
    
    def preprocess():
    
        pd.set_option('display.max_columns', None)
        print("데이터 읽는 중...")
        netflix_overall=pd.read_csv("data/netflix_titles.csv")
    
        print("읽어 온 데이터를 출력합니다.")
        print(netflix_overall)
        
        filledna=netflix_overall.fillna('')
    
        features=['title','director','cast','listed_in','description']
        filledna=filledna[features]
    
        for feature in features:
            filledna[feature] = filledna[feature].apply(clean_data)
    
        filledna['soup'] = filledna.apply(create_soup, axis=1)
        
        count = CountVectorizer(stop_words='english')
        count_matrix = count.fit_transform(filledna['soup'])
    
        cosine_sim = cosine_similarity(count_matrix, count_matrix)
    
        filledna=filledna.reset_index()
        indices = pd.Series(filledna.index, index=filledna['title'])
        
        print("학습을 수행합니다.")
        
        for j in trange(20,file=sys.stdout, leave=False, unit_scale=True, desc='학습 진행률'):
            
            cosine_sim = cosine_similarity(count_matrix, count_matrix)
        
        print('학습이 완료되었습니다.')
        return netflix_overall, cosine_sim, indices
        

    実習。推奨アルゴリズムの結果の検証


    本練習では,コンテンツベースの推奨アルゴリズムを用いて新しいコンテンツを推奨する.
    コンテンツベースの推奨アルゴリズムは、コンテンツとコンテンツとの類似性を学習し、特定のコンテンツを選択する際に類似性の高いコンテンツをリストすることができる.
    したがって、過去に視聴したコンテンツデータがある場合は、これらのコンテンツと類似したコンテンツを推奨できます.
    本実験では,Netflixのビデオコンテンツデータの類似性に基づいて,最も近い推奨コンテンツを10個印刷する.
    説明
    右引用符の間に次の例の映画名を入力します.
  • Vagabond
  • Pororo - The Little Penguin
  • The Lord of the Rings: The Return of the King
  • Larva
    「≪実行|Run|emdw≫」ボタンをクリックして、出力結果を表示します.
  • コミットボタンをクリックして推奨アルゴリズムの結果出力が正しいことを確認します.
    import machine as ma
    
    def main():
        
        netflix_overall, cosine_sim, indices = ma.preprocess()
        
        """
        지시사항 1번. 따옴표 사이에 들어가 있는 영화명을 지우고 왼쪽 지문의 예시 중 원하는 영화명을 입력해보세요.
        """
        title = 'Pororo - The Little Penguin'
        
        print("{}와 비슷한 넷플릭스 콘텐츠를 추천합니다.".format(title))
        ma.get_recommendations_new(title, netflix_overall, cosine_sim, indices)
    
    
    if __name__ == "__main__":
        main()
    import numpy as np 
    import pandas as pd 
    import matplotlib.pyplot as plt
    import seaborn as sns
    
    from sklearn.feature_extraction.text import CountVectorizer
    from sklearn.metrics.pairwise import cosine_similarity
    
    def clean_data(x):
        return str.lower(x.replace(" ", ""))
    
    def create_soup(x):
        return x['title']+ ' ' + x['director'] + ' ' + x['cast'] + ' ' +x['listed_in']+' '+ x['description']
    
    def preprocess():
    
        netflix_overall=pd.read_csv("data/netflix_titles.csv")
    
        filledna=netflix_overall.fillna('')
    
        features=['title','director','cast','listed_in','description']
        filledna=filledna[features]
    
        for feature in features:
            filledna[feature] = filledna[feature].apply(clean_data)
    
        filledna['soup'] = filledna.apply(create_soup, axis=1)
        
        count = CountVectorizer(stop_words='english')
        count_matrix = count.fit_transform(filledna['soup'])
    
        cosine_sim = cosine_similarity(count_matrix, count_matrix)
    
        filledna=filledna.reset_index()
        indices = pd.Series(filledna.index, index=filledna['title'])
        
        return netflix_overall, cosine_sim, indices
        
        
    def get_recommendations_new(title, netflix_overall, cosine_sim, indices):
        
        pd.set_option('display.max_columns', None)
        title=title.replace(' ','').lower()
        
        try:
            idx = indices[title]
    
            sim_scores = list(enumerate(cosine_sim[idx]))
    
            sim_scores = sorted(sim_scores, key=lambda x: x[1], reverse=True)
    
            sim_scores = sim_scores[1:11]
    
            movie_indices = [i[0] for i in sim_scores]
    
            recomendation = netflix_overall[['title','country','release_year']].iloc[movie_indices]
            
            sim_pd = pd.DataFrame(sim_scores)[[1]]
            
            sim_pd = sim_pd.rename(columns={1:'Similiarity'})
    
            recomendation = recomendation.reset_index(drop=True)
    
            recomendation = pd.concat([recomendation, sim_pd], axis=1)
        
            recomendation.index += 1
            
            
            return print(recomendation)
        
        except:
            print("오류: 올바른 title 명을 적어주세요.")