Get started learning C# with C# notebooks powered by .NET Interactive and VS Code.

Overview

.NET Interactive Notebooks for C#

Welcome to the home of .NET interactive notebooks for C#!

How to Install

  1. Download the .NET Coding Pack for VS Code for Windows or macOS.
  2. Install the .NET Interactive Notebooks extension.

For more information and resources, visit Learn to code C#.

C# 101

Download or clone this repo and open the csharp-101 folder in VS Code to get started with the C# 101 notebooks. Or, if you want just tap on one of the Notebook links below and automatically have it open in VS Code!

# Topic Notebook Link Video Link Documentation
1 Hello World 01 Notebook 01 Video Intro to C#
2 The Basics of Strings 02 Notebook 02 Video Intro to C#
3 Searching Strings 03 Notebook 03 Video Intro to C#
4 Numbers and Integers Math 04 Notebook 04 Video Numbers in C#
5 Numbers and Integer Precision 05 Notebook 05 Video Numbers in C#
6 Numbers and Decimals 06 Notebook 06 Video Numbers in C#
7 Branches (if) 07 Notebook 07 Video Branches and Loops in C#
8 What Are Loops? 08 Notebook 08 Video Branches and Loops in C#
9 Combining Branches and Loops 09 Notebook 09 Video Branches and Loops in C#
10 Arrays, Lists, and Collections 10 Notebook 10 Video Arrays, Lists, and Collections in C#
11 Search, Sort, and Index Lists 11 Notebook 11 Video Arrays, Lists, and Collections in C#
12 Lists of Other Types 12 Notebook 12 Video Arrays, Lists, and Collections in C#
13 Objects and Classes 13 Notebook 13 Video Object Oriented Coding in C#
14 Methods and Members 14 Notebook 14 Video Object Oriented Coding in C#
15 Methods and Exceptions 15 Notebook 15 Video Object Oriented Coding in C#

.NET Foundation

.NET Interative Notebooks for C# is a .NET Foundation project.

There are many .NET related projects on GitHub.

  • .NET home repo - links to 100s of .NET projects, from Microsoft and the community.
  • ASP.NET Core home - the best place to start learning about ASP.NET Core.

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the .NET Foundation Code of Conduct.

License

.NET (including the csharp-notebooks repo) is licensed under the MIT license.

Comments
  • User Input

    User Input

    Within these interactive notebooks, I am unable to find any examples on how to get a user's input? As I try Console.ReadLine() it proceeds to execute the next line of code.

    Example: string []answer = new string[10];

    for(int i = 0; i < answer.Length; i++) { answer[i]= Console.ReadLine(); }

    With this code, the cell keeps running for me with no prompt (like with Python) to enter an input.

    opened by Christo77793 7
  • Link to Marketplace no longer finds Notebook extension to install

    Link to Marketplace no longer finds Notebook extension to install

    Did you remove The Notebook extension for Visual Studio 2022 from the Marketplace? Where to get the latest version of the C# Notebook Extension for Visual Studio 2022?

    opened by SFC-Sarge 4
  • ML Notebooks should use Plotly.NET

    ML Notebooks should use Plotly.NET

    Replace XPlot with Plotly.NET.

    Blocked on..

    • Plotly.NET getting signed. https://github.com/plotly/Plotly.NET/issues/175
    • Also waiting on C# improvements https://github.com/plotly/Plotly.NET/issues/285
    opened by beccamc 4
  • What is the reason to support two versions of notebooks?

    What is the reason to support two versions of notebooks?

    I had forked this repository and started to translate it to Ukrainian (the first notebook is done). But there are two versions of each notebook (dib and ipynb). I don't want to double my work. Which one is better to choose? What is the reason to support two versions of notebooks?

    opened by RredCat 4
  • Data Prep and Feature Engineering Notebook

    Data Prep and Feature Engineering Notebook

    I'm not happy with this yet, but this is the shape of what I'm doing. I'm going to make more edits to the copy to make it less awkward, and add more description.

    opened by beccamc 3
  • DataFrame data processing example

    DataFrame data processing example

    Simple data processing example. This examples shows how to...

    • Replace null values.
    • Remove rows with null values.
    • Combine two identical data sources.
    • Transform columns into different formats.
    • Join two data sources.
    opened by beccamc 2
  • Are ML.NET notebooks using non-public #r nuget references?

    Are ML.NET notebooks using non-public #r nuget references?

    Are the ML.NET notebooks using non-public preview nugets?

    I tried to run the first ML.NET notebook 01- Intro to ... I get the following error:

    #r "nuget: Microsoft.ML, 2.0.0-preview.22356.1"
    
    C:\Users\nicho\AppData\Local\Temp\nuget\20332--ab38aca3-7c58-4abd-98f6-0079cd1c2c87\Project.fsproj : error NU1102: Unable to find package Microsoft.ML with version (>= 2.0.0-preview.22356.1)
    C:\Users\nicho\AppData\Local\Temp\nuget\20332--ab38aca3-7c58-4abd-98f6-0079cd1c2c87\Project.fsproj : error NU1102:   - Found 33 version(s) in nuget.org [ Nearest version: 2.0.0-preview.22313.1 ]
    C:\Users\nicho\AppData\Local\Temp\nuget\20332--ab38aca3-7c58-4abd-98f6-0079cd1c2c87\Project.fsproj : error NU1102:   - Found 0 version(s) in Microsoft Visual Studio Offline Packages
    

    This is the latest on nuget.org: #r "nuget: Microsoft.ML, 2.0.0-preview.22313.1"

    opened by nhirschey 1
  • Add Ipynb files

    Add Ipynb files

    Description

    Dib isn’t as common of a notebook file type as ipynb. Converting to ipynb allows these notebooks to work with VS, VS Code, and everywhere else ipynb is supported.

    opened by zewditu 1
  • ML Notebook Enhancements

    ML Notebook Enhancements

    • Add reference documentation links to classes like transforms and trainers. (i.e. LightGBM)
    • Include parameter names in method calls. (i.e. mlContext.Data.TrainTestSplit(data,testFraction: 0.2))
    • Use real data for examples. It makes it easier to understand the problem that's being solved opposed to randomly generated data.
    • Watch for code comments. Instead of embedding them in the code, promote them to text in a Markdown cell.

    • Put related code together. Break up cells containing large chunks of code and add Markdown cells explaining what each of the cells is doing.

    Example

    Original

    var context =new MLContext(seed: 1);
    var pipeline = context.Transforms.Concatenate("Features", "X")
      .Append(context.Auto().Regression("y", useLbfgs: false, useSdca: false, useFastForest: false));
    
    var monitor = new NotebookMonitor();
    var experiment = context.Auto().CreateExperiment();
    experiment.SetPipeline(pipeline)
      .SetEvaluateMetric(RegressionMetric.RootMeanSquaredError, "y")
      .SetTrainingTimeInSeconds(30)
      .SetDataset(trainTestSplit.TrainSet, trainTestSplit.TestSet)
      .SetMonitor(monitor);
    
    // Configure Visualizer			
    monitor.SetUpdate(monitor.Display());
    
    var res = await experiment.RunAsync();
    

    Update

    Initialize MLContext

    MLContext is the starting point for all ML.NET applications.

    var context =new MLContext(seed: 1);
    

    Define training pipeline

    • Concatenate: Takes the input column X and creates a feature vector in the Features column.
    • Regression: Defines the task AutoML needs to find the best algorithm and hyperparameters for. In this case, Lbfgs, Sdca, and FastForest algorithms won't be explored since their respective parameters are set to false.
    var pipeline = context.Transforms.Concatenate("Features", "X")
          .Append(context.Auto().Regression("y", useLbfgs: false, useSdca: false, useFastForest: false));
    

    Initialize Monitor

    The notebook monitor provides visualizations of the training progress as AutoML tries to find the best model for your data.

    var monitor = new NotebookMonitor();
    

    Initialize AutoML Experiment

    An AutoML experiment is a collection of trials in which algorithms are explored.

    var experiment = context.Auto().CreateExperiment();
    

    Configure AutoML Experiment

    The AutoML experiment tries to find the best algorithm using an evaluation metric. In this case, the evaluation metric selected is Root Mean Squared Error. The goal is to find the optimal evaluation metric in the provided training time which is set to 30 seconds. The longer you train, the more algorithms and hyperparameters AutoML is able to explore. The training set is the dataset that AutoML uses to train the model and the test set is used to calculate the evaluation metric to see how well a particular model selected by AutoML performs.

    experiment.SetPipeline(pipeline)
            .SetEvaluateMetric(RegressionMetric.RootMeanSquaredError, "y")
            .SetTrainingTimeInSeconds(30)
            .SetDataset(trainTestSplit.TrainSet, trainTestSplit.TestSet)
            .SetMonitor(monitor);
    

    Set monitor to display

    monitor.SetUpdate(monitor.Display());
    

    Run AutoML experiment

    var res = await experiment.RunAsync();
    

    • NotebookMonitor: Display evaluation metric for best trial, active trial, and y-axis on graph.
    • When adding feeds, add link to document on how to reference them in VS / dotnet CLI
    • When installing NuGet packages that are not part of the BCL, list them in a Markdown cell where the packages are installed, and add a link to NuGet. (i.e. Microsoft.ML).
    opened by luisquintanilla 0
  • Update Alien Example to use for loop instead of for-each ... so it can be updated in-place.

    Update Alien Example to use for loop instead of for-each ... so it can be updated in-place.

    Update Alien Example to use for loop instead of for-each ... so words array can be updated in-place.

    @katiesavage @jamesmontemagno Is this how it was intended to be?

    Resolves #62

    You can view the updated Notebook here: https://github.com/dotnet/csharp-notebooks/blob/32bc3eb9f1a2535d212506393e0a2dc561974693/csharp-scenarios/01-Alien-Translator.ipynb

    opened by JakeRadMSFT 0
  • Alien translator: modify a collection in a foreach loop

    Alien translator: modify a collection in a foreach loop

    The last code block of the Alien translator notebook lacks clarity.

    Since you use the same collection variable before and after the foreach loop, it seems like you want the "student" to modify the collection in-place, which is not possible using a foreach loop.

    Since the notebook is aimed at new C# programmers, it might be better to hint at a clearer pattern.

    Maybe I'm missing something?

    opened by mrlucmorin 2
  • ML Notebook Fixes: Fix Taxi Notebook Outputs & Data Prep

    ML Notebook Fixes: Fix Taxi Notebook Outputs & Data Prep

    • Taxi Notebook had an error when it uses a OneHotHashEncoder @LittleLittleCloud ... can we filter that out from Auto-Featurizer? OneHotEncoder works fine.
    • DataFrame/DataPrep notebook wasn't downloading one of it's data files.
    opened by JakeRadMSFT 0
  • Local and Authenticated NuGet source break Package Restore

    Local and Authenticated NuGet source break Package Restore

    The machine learning notebooks reference Microsoft.ML version 2.0.0-preview.22356.1 from a private Azure DevOps server. This preview version of the Microsoft.ML package is not available from nuget.org making it hard to run the notebooks.

    PackageManagement Error 3217 Invalid URI: The format of the URI could not be determined.

    opened by wldevries 12
Owner
.NET Platform
Home of the open source .NET platform
.NET Platform
Neural networks applied in recognizing guitar chords using python, AutoML.NET with C# and .NET Core

Chord Recognition Demo application The demo application is written in C# with .NETCore. As of July 9, 2020, the only version available is for windows

Andres Mauricio Rondon Patiño 24 Oct 22, 2022
U^2-Net - Portrait matting This repository explores possibilities of using the original u^2-net model for portrait matting.

U^2-Net - Portrait matting This repository explores possibilities of using the original u^2-net model for portrait matting.

Dennis Bappert 104 Nov 25, 2022
U-2-Net: U Square Net - Modified for paired image training of style transfer

U2-Net: U Square Net Modified for paired image training of style transfer This is an unofficial repo making use of the code which was made available b

Doron Adler 43 Oct 3, 2022
RGBD-Net - This repository contains a pytorch lightning implementation for the 3DV 2021 RGBD-Net paper.

[3DV 2021] We propose a new cascaded architecture for novel view synthesis, called RGBD-Net, which consists of two core components: a hierarchical depth regression network and a depth-aware generator network.

Phong Nguyen Ha 4 May 26, 2022
Starter kit for getting started in the Music Demixing Challenge.

Music Demixing Challenge - Starter Kit ?? Challenge page This repository is the Music Demixing Challenge Submission template and Starter kit! Clone th

AIcrowd 106 Dec 20, 2022
Jupyter notebooks for the code samples of the book "Deep Learning with Python"

Jupyter notebooks for the code samples of the book "Deep Learning with Python"

François Chollet 16.2k Dec 30, 2022
Vowpal Wabbit is a machine learning system which pushes the frontier of machine learning with techniques such as online, hashing, allreduce, reductions, learning2search, active, and interactive learning.

This is the Vowpal Wabbit fast online learning code. Why Vowpal Wabbit? Vowpal Wabbit is a machine learning system which pushes the frontier of machin

Vowpal Wabbit 8.1k Jan 6, 2023
Source code and notebooks to reproduce experiments and benchmarks on Bias Faces in the Wild (BFW).

Face Recognition: Too Bias, or Not Too Bias? Robinson, Joseph P., Gennady Livitz, Yann Henon, Can Qin, Yun Fu, and Samson Timoner. "Face recognition:

Joseph P. Robinson 41 Dec 12, 2022
Ready-to-use code and tutorial notebooks to boost your way into few-shot image classification.

Easy Few-Shot Learning Ready-to-use code and tutorial notebooks to boost your way into few-shot image classification. This repository is made for you

Sicara 399 Jan 8, 2023
📚 A collection of Jupyter notebooks for learning and experimenting with OpenVINO 👓

A collection of ready-to-run Python* notebooks for learning and experimenting with OpenVINO developer tools. The notebooks are meant to provide an introduction to OpenVINO basics and teach developers how to leverage our APIs for optimized deep learning inference in their applications.

OpenVINO Toolkit 840 Jan 3, 2023
Repository for scripts and notebooks from the book: Programming PyTorch for Deep Learning

Repository for scripts and notebooks from the book: Programming PyTorch for Deep Learning

Ian Pointer 368 Dec 17, 2022
AgeGuesser: deep learning based age estimation system. Powered by EfficientNet and Yolov5

AgeGuesser AgeGuesser is an end-to-end, deep-learning based Age Estimation system, presented at the CAIP 2021 conference. You can find the related pap

null 5 Nov 10, 2022
Code for paper "ASAP-Net: Attention and Structure Aware Point Cloud Sequence Segmentation"

ASAP-Net This project implements ASAP-Net of paper ASAP-Net: Attention and Structure Aware Point Cloud Sequence Segmentation (BMVC2020). Overview We i

Hanwen Cao 26 Aug 25, 2022
Train a deep learning net with OpenStreetMap features and satellite imagery.

DeepOSM Classify roads and features in satellite imagery, by training neural networks with OpenStreetMap (OSM) data. DeepOSM can: Download a chunk of

TrailBehind, Inc. 1.3k Nov 24, 2022
docTR by Mindee (Document Text Recognition) - a seamless, high-performing & accessible library for OCR-related tasks powered by Deep Learning.

docTR by Mindee (Document Text Recognition) - a seamless, high-performing & accessible library for OCR-related tasks powered by Deep Learning.

Mindee 1.5k Jan 1, 2023
On-device wake word detection powered by deep learning.

Porcupine Made in Vancouver, Canada by Picovoice Porcupine is a highly-accurate and lightweight wake word engine. It enables building always-listening

Picovoice 2.8k Dec 29, 2022
On-device speech-to-intent engine powered by deep learning

Rhino Made in Vancouver, Canada by Picovoice Rhino is Picovoice's Speech-to-Intent engine. It directly infers intent from spoken commands within a giv

Picovoice 510 Dec 30, 2022
On-device speech-to-index engine powered by deep learning.

On-device speech-to-index engine powered by deep learning.

Picovoice 30 Nov 24, 2022